Tobin Ehlis | 2d9deec | 2016-04-21 14:19:26 -0600 | [diff] [blame] | 1 | /* Copyright (c) 2015-2016 The Khronos Group Inc. |
| 2 | * Copyright (c) 2015-2016 Valve Corporation |
| 3 | * Copyright (c) 2015-2016 LunarG, Inc. |
| 4 | * Copyright (C) 2015-2016 Google Inc. |
| 5 | * |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
| 17 | * |
| 18 | * Author: Courtney Goeltzenleuchter <courtneygo@google.com> |
| 19 | * Author: Tobin Ehlis <tobine@google.com> |
| 20 | * Author: Chris Forbes <chrisf@ijw.co.nz> |
| 21 | * Author: Mark Lobodzinski <mark@lunarg.com> |
| 22 | */ |
| 23 | #ifndef CORE_VALIDATION_ERROR_ENUMS_H_ |
| 24 | #define CORE_VALIDATION_ERROR_ENUMS_H_ |
| 25 | |
| 26 | // Mem Tracker ERROR codes |
| 27 | typedef enum _MEM_TRACK_ERROR { |
| 28 | MEMTRACK_NONE, // Used for INFO & other non-error messages |
| 29 | MEMTRACK_INVALID_CB, // Cmd Buffer invalid |
| 30 | MEMTRACK_INVALID_MEM_OBJ, // Invalid Memory Object |
| 31 | MEMTRACK_INVALID_ALIASING, // Invalid Memory Aliasing |
| 32 | MEMTRACK_INVALID_LAYOUT, // Invalid Layout |
| 33 | MEMTRACK_INTERNAL_ERROR, // Bug in Mem Track Layer internal data structures |
| 34 | MEMTRACK_FREED_MEM_REF, // MEM Obj freed while it still has obj and/or CB refs |
| 35 | MEMTRACK_MEM_OBJ_CLEAR_EMPTY_BINDINGS, // Clearing bindings on mem obj that doesn't have any bindings |
| 36 | MEMTRACK_MISSING_MEM_BINDINGS, // Trying to retrieve mem bindings, but none found (may be internal error) |
| 37 | MEMTRACK_INVALID_OBJECT, // Attempting to reference generic VK Object that is invalid |
| 38 | MEMTRACK_MEMORY_BINDING_ERROR, // Error during one of many calls that bind memory to object or CB |
| 39 | MEMTRACK_MEMORY_LEAK, // Failure to call vkFreeMemory on Mem Obj prior to DestroyDevice |
| 40 | MEMTRACK_INVALID_STATE, // Memory not in the correct state |
| 41 | MEMTRACK_RESET_CB_WHILE_IN_FLIGHT, // vkResetCommandBuffer() called on a CB that hasn't completed |
| 42 | MEMTRACK_INVALID_FENCE_STATE, // Invalid Fence State signaled or used |
| 43 | MEMTRACK_REBIND_OBJECT, // Non-sparse object bindings are immutable |
| 44 | MEMTRACK_INVALID_USAGE_FLAG, // Usage flags specified at image/buffer create conflict w/ use of object |
| 45 | MEMTRACK_INVALID_MAP, // Size flag specified at alloc is too small for mapping range |
| 46 | } MEM_TRACK_ERROR; |
| 47 | |
| 48 | // Draw State ERROR codes |
| 49 | typedef enum _DRAW_STATE_ERROR { |
| 50 | // TODO: Remove the comments here or expand them. There isn't any additional information in the |
| 51 | // comments than in the name in almost all cases. |
| 52 | DRAWSTATE_NONE, // Used for INFO & other non-error messages |
| 53 | DRAWSTATE_INTERNAL_ERROR, // Error with DrawState internal data structures |
| 54 | DRAWSTATE_NO_PIPELINE_BOUND, // Unable to identify a bound pipeline |
| 55 | DRAWSTATE_INVALID_POOL, // Invalid DS pool |
| 56 | DRAWSTATE_INVALID_SET, // Invalid DS |
| 57 | DRAWSTATE_INVALID_RENDER_AREA, // Invalid renderArea |
| 58 | DRAWSTATE_INVALID_LAYOUT, // Invalid DS layout |
| 59 | DRAWSTATE_INVALID_IMAGE_LAYOUT, // Invalid Image layout |
| 60 | DRAWSTATE_INVALID_PIPELINE, // Invalid Pipeline handle referenced |
| 61 | DRAWSTATE_INVALID_PIPELINE_LAYOUT, // Invalid PipelineLayout |
| 62 | DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, // Attempt to create a pipeline |
| 63 | // with invalid state |
| 64 | DRAWSTATE_INVALID_COMMAND_BUFFER, // Invalid CommandBuffer referenced |
| 65 | DRAWSTATE_INVALID_BARRIER, // Invalid Barrier |
| 66 | DRAWSTATE_INVALID_BUFFER, // Invalid Buffer |
| 67 | DRAWSTATE_INVALID_QUERY, // Invalid Query |
| 68 | DRAWSTATE_INVALID_FENCE, // Invalid Fence |
| 69 | DRAWSTATE_INVALID_SEMAPHORE, // Invalid Semaphore |
| 70 | DRAWSTATE_INVALID_EVENT, // Invalid Event |
| 71 | DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, // binding in vkCmdBindVertexData() too |
| 72 | // large for PSO's |
| 73 | // pVertexBindingDescriptions array |
| 74 | DRAWSTATE_VTX_INDEX_ALIGNMENT_ERROR, // binding offset in |
| 75 | // vkCmdBindIndexBuffer() out of |
| 76 | // alignment based on indexType |
| 77 | // DRAWSTATE_MISSING_DOT_PROGRAM, // No "dot" program in order |
| 78 | // to generate png image |
| 79 | DRAWSTATE_OUT_OF_MEMORY, // malloc failed |
| 80 | DRAWSTATE_INVALID_DESCRIPTOR_SET, // Descriptor Set handle is unknown |
| 81 | DRAWSTATE_DESCRIPTOR_TYPE_MISMATCH, // Type in layout vs. update are not the |
| 82 | // same |
| 83 | DRAWSTATE_DESCRIPTOR_STAGEFLAGS_MISMATCH, // StageFlags in layout are not |
| 84 | // the same throughout a single |
| 85 | // VkWriteDescriptorSet update |
| 86 | DRAWSTATE_DESCRIPTOR_UPDATE_OUT_OF_BOUNDS, // Descriptors set for update out |
| 87 | // of bounds for corresponding |
| 88 | // layout section |
| 89 | DRAWSTATE_DESCRIPTOR_POOL_EMPTY, // Attempt to allocate descriptor from a |
| 90 | // pool with no more descriptors of that |
| 91 | // type available |
| 92 | DRAWSTATE_CANT_FREE_FROM_NON_FREE_POOL, // Invalid to call |
| 93 | // vkFreeDescriptorSets on Sets |
| 94 | // allocated from a NON_FREE Pool |
| 95 | DRAWSTATE_INVALID_UPDATE_INDEX, // Index of requested update is invalid for |
| 96 | // specified descriptors set |
| 97 | DRAWSTATE_INVALID_UPDATE_STRUCT, // Struct in DS Update tree is of invalid |
| 98 | // type |
| 99 | DRAWSTATE_NUM_SAMPLES_MISMATCH, // Number of samples in bound PSO does not |
| 100 | // match number in FB of current RenderPass |
| 101 | DRAWSTATE_NO_END_COMMAND_BUFFER, // Must call vkEndCommandBuffer() before |
| 102 | // QueueSubmit on that commandBuffer |
| 103 | DRAWSTATE_NO_BEGIN_COMMAND_BUFFER, // Binding cmds or calling End on CB that |
| 104 | // never had vkBeginCommandBuffer() |
| 105 | // called on it |
| 106 | DRAWSTATE_COMMAND_BUFFER_SINGLE_SUBMIT_VIOLATION, // Cmd Buffer created with |
| 107 | // VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT |
| 108 | // flag is submitted |
| 109 | // multiple times |
| 110 | DRAWSTATE_INVALID_SECONDARY_COMMAND_BUFFER, // vkCmdExecuteCommands() called |
| 111 | // with a primary commandBuffer |
| 112 | // in pCommandBuffers array |
| 113 | DRAWSTATE_VIEWPORT_NOT_BOUND, // Draw submitted with no viewport state bound |
| 114 | DRAWSTATE_SCISSOR_NOT_BOUND, // Draw submitted with no scissor state bound |
| 115 | DRAWSTATE_LINE_WIDTH_NOT_BOUND, // Draw submitted with no line width state |
| 116 | // bound |
| 117 | DRAWSTATE_DEPTH_BIAS_NOT_BOUND, // Draw submitted with no depth bias state |
| 118 | // bound |
| 119 | DRAWSTATE_BLEND_NOT_BOUND, // Draw submitted with no blend state bound when |
| 120 | // color write enabled |
| 121 | DRAWSTATE_DEPTH_BOUNDS_NOT_BOUND, // Draw submitted with no depth bounds |
| 122 | // state bound when depth enabled |
| 123 | DRAWSTATE_STENCIL_NOT_BOUND, // Draw submitted with no stencil state bound |
| 124 | // when stencil enabled |
| 125 | DRAWSTATE_INDEX_BUFFER_NOT_BOUND, // Draw submitted with no depth-stencil |
| 126 | // state bound when depth write enabled |
| 127 | DRAWSTATE_PIPELINE_LAYOUTS_INCOMPATIBLE, // Draw submitted PSO Pipeline |
| 128 | // layout that's not compatible |
| 129 | // with layout from |
| 130 | // BindDescriptorSets |
| 131 | DRAWSTATE_RENDERPASS_INCOMPATIBLE, // Incompatible renderpasses between |
| 132 | // secondary cmdBuffer and primary |
| 133 | // cmdBuffer or framebuffer |
| 134 | DRAWSTATE_FRAMEBUFFER_INCOMPATIBLE, // Incompatible framebuffer between |
| 135 | // secondary cmdBuffer and active |
| 136 | // renderPass |
| 137 | DRAWSTATE_INVALID_RENDERPASS, // Use of a NULL or otherwise invalid |
| 138 | // RenderPass object |
| 139 | DRAWSTATE_INVALID_RENDERPASS_CMD, // Invalid cmd submitted while a |
| 140 | // RenderPass is active |
| 141 | DRAWSTATE_NO_ACTIVE_RENDERPASS, // Rendering cmd submitted without an active |
| 142 | // RenderPass |
| 143 | DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, // DescriptorSet bound but it was |
| 144 | // never updated. This is a warning |
| 145 | // code. |
| 146 | DRAWSTATE_DESCRIPTOR_SET_NOT_BOUND, // DescriptorSet used by pipeline at |
| 147 | // draw time is not bound, or has been |
| 148 | // disturbed (which would have flagged |
| 149 | // previous warning) |
| 150 | DRAWSTATE_INVALID_DYNAMIC_OFFSET_COUNT, // DescriptorSets bound with |
| 151 | // different number of dynamic |
| 152 | // descriptors that were included in |
| 153 | // dynamicOffsetCount |
| 154 | DRAWSTATE_CLEAR_CMD_BEFORE_DRAW, // Clear cmd issued before any Draw in |
| 155 | // CommandBuffer, should use RenderPass Ops |
| 156 | // instead |
| 157 | DRAWSTATE_BEGIN_CB_INVALID_STATE, // CB state at Begin call is bad. Can be |
| 158 | // Primary/Secondary CB created with |
| 159 | // mismatched FB/RP information or CB in |
| 160 | // RECORDING state |
| 161 | DRAWSTATE_INVALID_CB_SIMULTANEOUS_USE, // CmdBuffer is being used in |
| 162 | // violation of |
| 163 | // VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT |
| 164 | // rules (i.e. simultaneous use w/o |
| 165 | // that bit set) |
| 166 | DRAWSTATE_INVALID_COMMAND_BUFFER_RESET, // Attempting to call Reset (or |
| 167 | // Begin on recorded cmdBuffer) that |
| 168 | // was allocated from Pool w/o |
| 169 | // VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT |
| 170 | // bit set |
| 171 | DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, // Count for viewports and scissors |
| 172 | // mismatch and/or state doesn't match |
| 173 | // count |
| 174 | DRAWSTATE_INVALID_IMAGE_ASPECT, // Image aspect is invalid for the current |
| 175 | // operation |
| 176 | DRAWSTATE_MISSING_ATTACHMENT_REFERENCE, // Attachment reference must be |
| 177 | // present in active subpass |
| 178 | DRAWSTATE_SAMPLER_DESCRIPTOR_ERROR, // A Descriptor of *_SAMPLER type is |
| 179 | // being updated with an invalid or bad |
| 180 | // Sampler |
| 181 | DRAWSTATE_INCONSISTENT_IMMUTABLE_SAMPLER_UPDATE, // Descriptors of |
| 182 | // *COMBINED_IMAGE_SAMPLER |
| 183 | // type are being updated |
| 184 | // where some, but not all, |
| 185 | // of the updates use |
| 186 | // immutable samplers |
| 187 | DRAWSTATE_IMAGEVIEW_DESCRIPTOR_ERROR, // A Descriptor of *_IMAGE or |
| 188 | // *_ATTACHMENT type is being updated |
| 189 | // with an invalid or bad ImageView |
| 190 | DRAWSTATE_BUFFERVIEW_DESCRIPTOR_ERROR, // A Descriptor of *_TEXEL_BUFFER |
| 191 | // type is being updated with an |
| 192 | // invalid or bad BufferView |
| 193 | DRAWSTATE_BUFFERINFO_DESCRIPTOR_ERROR, // A Descriptor of |
| 194 | // *_[UNIFORM|STORAGE]_BUFFER_[DYNAMIC] |
| 195 | // type is being updated with an |
| 196 | // invalid or bad BufferView |
| 197 | DRAWSTATE_DYNAMIC_OFFSET_OVERFLOW, // At draw time the dynamic offset |
| 198 | // combined with buffer offset and range |
| 199 | // oversteps size of buffer |
| 200 | DRAWSTATE_DOUBLE_DESTROY, // Destroying an object twice |
| 201 | DRAWSTATE_OBJECT_INUSE, // Destroying or modifying an object in use by a |
| 202 | // command buffer |
| 203 | DRAWSTATE_QUEUE_FORWARD_PROGRESS, // Queue cannot guarantee forward progress |
| 204 | DRAWSTATE_INVALID_BUFFER_MEMORY_OFFSET, // Dynamic Buffer Offset |
| 205 | // violates memory requirements limit |
| 206 | DRAWSTATE_INVALID_TEXEL_BUFFER_OFFSET, // Dynamic Texel Buffer Offsets |
| 207 | // violate device limit |
| 208 | DRAWSTATE_INVALID_UNIFORM_BUFFER_OFFSET, // Dynamic Uniform Buffer Offsets |
| 209 | // violate device limit |
| 210 | DRAWSTATE_INVALID_STORAGE_BUFFER_OFFSET, // Dynamic Storage Buffer Offsets |
| 211 | // violate device limit |
| 212 | DRAWSTATE_INDEPENDENT_BLEND, // If independent blending is not enabled, all |
| 213 | // elements of pAttachmentsMustBeIdentical |
| 214 | DRAWSTATE_DISABLED_LOGIC_OP, // If logic operations is not enabled, logicOpEnable |
| 215 | // must be VK_FALSE |
| 216 | DRAWSTATE_INVALID_LOGIC_OP, // If logicOpEnable is VK_TRUE, logicOp must |
| 217 | // must be a valid VkLogicOp value |
| 218 | DRAWSTATE_INVALID_QUEUE_INDEX, // Specified queue index exceeds number |
| 219 | // of queried queue families |
| 220 | DRAWSTATE_PUSH_CONSTANTS_ERROR, // Push constants exceed maxPushConstantSize |
| 221 | } DRAW_STATE_ERROR; |
| 222 | |
| 223 | typedef enum _SHADER_CHECKER_ERROR { |
| 224 | SHADER_CHECKER_NONE, |
| 225 | SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, // Type mismatch between shader stages or shader and pipeline |
| 226 | SHADER_CHECKER_OUTPUT_NOT_CONSUMED, // Entry appears in output interface, but missing in input |
| 227 | SHADER_CHECKER_INPUT_NOT_PRODUCED, // Entry appears in input interface, but missing in output |
| 228 | SHADER_CHECKER_NON_SPIRV_SHADER, // Shader image is not SPIR-V |
| 229 | SHADER_CHECKER_INCONSISTENT_SPIRV, // General inconsistency within a SPIR-V module |
| 230 | SHADER_CHECKER_UNKNOWN_STAGE, // Stage is not supported by analysis |
| 231 | SHADER_CHECKER_INCONSISTENT_VI, // VI state contains conflicting binding or attrib descriptions |
| 232 | SHADER_CHECKER_MISSING_DESCRIPTOR, // Shader attempts to use a descriptor binding not declared in the layout |
| 233 | SHADER_CHECKER_BAD_SPECIALIZATION, // Specialization map entry points outside specialization data block |
| 234 | SHADER_CHECKER_MISSING_ENTRYPOINT, // Shader module does not contain the requested entrypoint |
| 235 | SHADER_CHECKER_PUSH_CONSTANT_OUT_OF_RANGE, // Push constant variable is not in a push constant range |
| 236 | SHADER_CHECKER_PUSH_CONSTANT_NOT_ACCESSIBLE_FROM_STAGE, // Push constant range exists, but not accessible from stage |
| 237 | SHADER_CHECKER_DESCRIPTOR_TYPE_MISMATCH, // Descriptor type does not match shader resource type |
| 238 | SHADER_CHECKER_DESCRIPTOR_NOT_ACCESSIBLE_FROM_STAGE, // Descriptor used by shader, but not accessible from stage |
| 239 | SHADER_CHECKER_FEATURE_NOT_ENABLED, // Shader uses capability requiring a feature not enabled on device |
| 240 | SHADER_CHECKER_BAD_CAPABILITY, // Shader uses capability not supported by Vulkan (OpenCL features) |
| 241 | } SHADER_CHECKER_ERROR; |
| 242 | |
| 243 | #endif // CORE_VALIDATION_ERROR_ENUMS_H_ |