Tobin Ehlis | 246ba4d | 2014-11-18 16:38:08 -0700 | [diff] [blame] | 1 | /* |
| 2 | * XGL |
| 3 | * |
| 4 | * Copyright (C) 2014 LunarG, Inc. |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | * copy of this software and associated documentation files (the "Software"), |
| 8 | * to deal in the Software without restriction, including without limitation |
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 | * and/or sell copies of the Software, and to permit persons to whom the |
| 11 | * Software is furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included |
| 14 | * in all copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 22 | * DEALINGS IN THE SOFTWARE. |
| 23 | */ |
| 24 | #include "xglLayer.h" |
| 25 | // Draw State ERROR codes |
| 26 | typedef enum _DRAW_STATE_ERROR |
| 27 | { |
| 28 | DRAWSTATE_NONE = 0, // Used for INFO & other non-error messages |
| 29 | DRAWSTATE_DESCRIPTOR_MAX_EXCEEDED = 1, // Descriptor Count of DS Mapping exceeds MAX_SLOTS |
| 30 | DRAWSTATE_SLOT_REMAPPING = 2, // DS Slot being mapped to a different type than previously |
| 31 | DRAWSTATE_NO_PIPELINE_BOUND = 3, // Unable to identify a bound pipeline |
| 32 | DRAWSTATE_NO_DS_BOUND = 4, // Unable to identify a bound DS |
| 33 | DRAWSTATE_DS_SLOT_NUM_MISMATCH = 5, // Number of slots in DS mapping exceeds actual DS slots |
| 34 | DRAWSTATE_UNKNOWN_DS_MAPPING = 6, // Shader slot mapping is not recognized |
| 35 | DRAWSTATE_DS_MAPPING_MISMATCH = 7, // DS Mapping mismatch |
| 36 | DRAWSTATE_INVALID_DS = 8, // Invalid DS referenced |
| 37 | DRAWSTATE_DS_END_WITHOUT_BEGIN = 9, // EndDSUpdate called w/o corresponding BeginDSUpdate |
| 38 | DRAWSTATE_DS_ATTACH_WITHOUT_BEGIN = 10, // Attempt to attach descriptors to DS w/ calling BeginDSUpdate |
| 39 | DRAWSTATE_DS_SAMPLE_ATTACH_FAILED = 11, // Error while attempting to Attach Sampler mapping to DS Slot |
| 40 | DRAWSTATE_DS_IMAGE_ATTACH_FAILED = 12, // Error while attempting to Attach Image mapping to DS Slot |
| 41 | DRAWSTATE_DS_MEMORY_ATTACH_FAILED = 13, // Error while attempting to Attach Mem mapping to DS Slot |
| 42 | DRAWSTATE_DS_NESTED_DS_ATTACH_FAILED = 14, // Error while attempting to Attach Nested DS mapping to DS Slot |
| 43 | DRAWSTATE_CLEAR_DS_FAILED = 15, // Error while attempting ClearDS |
| 44 | DRAWSTATE_INVALID_PIPELINE = 16, // Invalid DS referenced |
Tobin Ehlis | db20d60 | 2014-11-25 10:24:15 -0700 | [diff] [blame] | 45 | DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS = 17, // binding in xglCmdBindVertexData() too large for PSO's pVertexBindingDescriptions array |
Tobin Ehlis | 9dc93af | 2014-11-21 08:58:46 -0700 | [diff] [blame] | 46 | DRAWSTATE_INVALID_DYNAMIC_STATE_OBJECT = 18, // Invalid dyn state object |
Tobin Ehlis | f27eba7 | 2014-12-16 17:34:50 -0700 | [diff] [blame] | 47 | DRAWSTATE_MISSING_DOT_PROGRAM = 19, // No "dot" program in order to generate png image |
Tobin Ehlis | 8be20fd | 2015-01-07 17:49:29 -0700 | [diff] [blame] | 48 | DRAWSTATE_BINDING_DS_NO_END_UPDATE = 20, // DS bound to CmdBuffer w/o call to xglEndDescriptorSetUpdate()) |
Tobin Ehlis | 246ba4d | 2014-11-18 16:38:08 -0700 | [diff] [blame] | 49 | } DRAW_STATE_ERROR; |
Tobin Ehlis | 5742e77 | 2014-11-20 09:49:17 -0700 | [diff] [blame] | 50 | |
| 51 | typedef enum _DRAW_TYPE |
| 52 | { |
| 53 | DRAW = 0, |
| 54 | DRAW_INDEXED = 1, |
| 55 | DRAW_INDIRECT = 2, |
| 56 | DRAW_INDEXED_INDIRECT = 3, |
| 57 | DRAW_BEGIN_RANGE = DRAW, |
| 58 | DRAW_END_RANGE = DRAW_INDEXED_INDIRECT, |
| 59 | NUM_DRAW_TYPES = (DRAW_END_RANGE - DRAW_BEGIN_RANGE + 1), |
| 60 | } DRAW_TYPE; |
Tobin Ehlis | 8356288 | 2014-11-27 15:43:39 -0700 | [diff] [blame] | 61 | |
| 62 | //prototypes for extension functions |
| 63 | XGL_VOID drawStateDumpDotFile(char* outFileName); |
Tobin Ehlis | f27eba7 | 2014-12-16 17:34:50 -0700 | [diff] [blame] | 64 | XGL_VOID drawStateDumpPngFile(char* outFileName); |
| 65 | // Func ptr typedefs |
Tobin Ehlis | 8356288 | 2014-11-27 15:43:39 -0700 | [diff] [blame] | 66 | typedef XGL_VOID (*DRAW_STATE_DUMP_DOT_FILE)(char*); |
Tobin Ehlis | f27eba7 | 2014-12-16 17:34:50 -0700 | [diff] [blame] | 67 | typedef XGL_VOID (*DRAW_STATE_DUMP_PNG_FILE)(char*); |