Home | History | Annotate | Download | only in layers
      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 (at) google.com>
     19  * Author: Tobin Ehlis <tobine (at) google.com>
     20  * Author: Chris Forbes <chrisf (at) ijw.co.nz>
     21  * Author: Mark Lobodzinski <mark (at) lunarg.com>
     22  */
     23 #ifndef CORE_VALIDATION_ERROR_ENUMS_H_
     24 #define CORE_VALIDATION_ERROR_ENUMS_H_
     25 
     26 // Mem Tracker ERROR codes
     27 enum MEM_TRACK_ERROR {
     28     MEMTRACK_NONE,
     29     MEMTRACK_INVALID_CB,
     30     MEMTRACK_INVALID_MEM_OBJ,
     31     MEMTRACK_INVALID_ALIASING,
     32     MEMTRACK_INTERNAL_ERROR,
     33     MEMTRACK_FREED_MEM_REF,
     34     MEMTRACK_INVALID_OBJECT,
     35     MEMTRACK_MEMORY_LEAK,
     36     MEMTRACK_INVALID_STATE,
     37     MEMTRACK_RESET_CB_WHILE_IN_FLIGHT,
     38     MEMTRACK_INVALID_FENCE_STATE,
     39     MEMTRACK_REBIND_OBJECT,
     40     MEMTRACK_INVALID_USAGE_FLAG,
     41     MEMTRACK_INVALID_MAP,
     42     MEMTRACK_INVALID_MEM_TYPE,
     43     MEMTRACK_INVALID_MEM_REGION,
     44     MEMTRACK_OBJECT_NOT_BOUND,
     45 };
     46 
     47 // Draw State ERROR codes
     48 enum DRAW_STATE_ERROR {
     49     DRAWSTATE_NONE,
     50     DRAWSTATE_INTERNAL_ERROR,
     51     DRAWSTATE_NO_PIPELINE_BOUND,
     52     DRAWSTATE_INVALID_SET,
     53     DRAWSTATE_INVALID_RENDER_AREA,
     54     DRAWSTATE_INVALID_LAYOUT,
     55     DRAWSTATE_INVALID_IMAGE_LAYOUT,
     56     DRAWSTATE_INVALID_PIPELINE,
     57     DRAWSTATE_INVALID_PIPELINE_CREATE_STATE,
     58     DRAWSTATE_INVALID_COMMAND_BUFFER,
     59     DRAWSTATE_INVALID_BARRIER,
     60     DRAWSTATE_INVALID_BUFFER,
     61     DRAWSTATE_INVALID_IMAGE,
     62     DRAWSTATE_INVALID_BUFFER_VIEW,
     63     DRAWSTATE_INVALID_IMAGE_VIEW,
     64     DRAWSTATE_INVALID_QUERY,
     65     DRAWSTATE_INVALID_QUERY_POOL,
     66     DRAWSTATE_INVALID_DESCRIPTOR_POOL,
     67     DRAWSTATE_INVALID_COMMAND_POOL,
     68     DRAWSTATE_INVALID_FENCE,
     69     DRAWSTATE_INVALID_EVENT,
     70     DRAWSTATE_INVALID_SAMPLER,
     71     DRAWSTATE_INVALID_FRAMEBUFFER,
     72     DRAWSTATE_INVALID_DEVICE_MEMORY,
     73     DRAWSTATE_INVALID_EXTENTS,
     74     DRAWSTATE_INVALID_FEATURE,
     75     DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS,
     76     DRAWSTATE_VTX_INDEX_ALIGNMENT_ERROR,
     77     DRAWSTATE_OUT_OF_MEMORY,
     78     DRAWSTATE_INVALID_DESCRIPTOR_SET,
     79     DRAWSTATE_DESCRIPTOR_TYPE_MISMATCH,
     80     DRAWSTATE_DESCRIPTOR_STAGEFLAGS_MISMATCH,
     81     DRAWSTATE_DESCRIPTOR_UPDATE_OUT_OF_BOUNDS,
     82     DRAWSTATE_DESCRIPTOR_POOL_EMPTY,
     83     DRAWSTATE_CANT_FREE_FROM_NON_FREE_POOL,
     84     DRAWSTATE_INVALID_WRITE_UPDATE,
     85     DRAWSTATE_INVALID_COPY_UPDATE,
     86     DRAWSTATE_INVALID_UPDATE_STRUCT,
     87     DRAWSTATE_NUM_SAMPLES_MISMATCH,
     88     DRAWSTATE_NO_END_COMMAND_BUFFER,
     89     DRAWSTATE_NO_BEGIN_COMMAND_BUFFER,
     90     DRAWSTATE_COMMAND_BUFFER_SINGLE_SUBMIT_VIOLATION,
     91     DRAWSTATE_INVALID_SECONDARY_COMMAND_BUFFER,
     92     DRAWSTATE_VIEWPORT_NOT_BOUND,
     93     DRAWSTATE_SCISSOR_NOT_BOUND,
     94     DRAWSTATE_LINE_WIDTH_NOT_BOUND,
     95     DRAWSTATE_DEPTH_BIAS_NOT_BOUND,
     96     DRAWSTATE_BLEND_NOT_BOUND,
     97     DRAWSTATE_DEPTH_BOUNDS_NOT_BOUND,
     98     DRAWSTATE_STENCIL_NOT_BOUND,
     99     DRAWSTATE_INDEX_BUFFER_NOT_BOUND,
    100     DRAWSTATE_PIPELINE_LAYOUTS_INCOMPATIBLE,
    101     DRAWSTATE_RENDERPASS_INCOMPATIBLE,
    102     DRAWSTATE_RENDERPASS_TOO_MANY_CLEAR_VALUES,
    103     DRAWSTATE_FRAMEBUFFER_INCOMPATIBLE,
    104     DRAWSTATE_INVALID_FRAMEBUFFER_CREATE_INFO,
    105     DRAWSTATE_INVALID_RENDERPASS,
    106     DRAWSTATE_INVALID_RENDERPASS_CMD,
    107     DRAWSTATE_NO_ACTIVE_RENDERPASS,
    108     DRAWSTATE_INVALID_IMAGE_USAGE,
    109     DRAWSTATE_INVALID_ATTACHMENT_INDEX,
    110     DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED,
    111     DRAWSTATE_DESCRIPTOR_SET_NOT_BOUND,
    112     DRAWSTATE_INVALID_DYNAMIC_OFFSET_COUNT,
    113     DRAWSTATE_CLEAR_CMD_BEFORE_DRAW,
    114     DRAWSTATE_BEGIN_CB_INVALID_STATE,
    115     DRAWSTATE_INVALID_CB_SIMULTANEOUS_USE,
    116     DRAWSTATE_INVALID_COMMAND_BUFFER_RESET,
    117     DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH,
    118     DRAWSTATE_INVALID_IMAGE_ASPECT,
    119     DRAWSTATE_MISSING_ATTACHMENT_REFERENCE,
    120     DRAWSTATE_SAMPLER_DESCRIPTOR_ERROR,
    121     DRAWSTATE_INCONSISTENT_IMMUTABLE_SAMPLER_UPDATE,
    122     DRAWSTATE_IMAGEVIEW_DESCRIPTOR_ERROR,
    123     DRAWSTATE_BUFFERVIEW_DESCRIPTOR_ERROR,
    124     DRAWSTATE_BUFFERINFO_DESCRIPTOR_ERROR,
    125     DRAWSTATE_DYNAMIC_OFFSET_OVERFLOW,
    126     DRAWSTATE_DOUBLE_DESTROY,
    127     DRAWSTATE_OBJECT_INUSE,
    128     DRAWSTATE_QUEUE_FORWARD_PROGRESS,
    129     DRAWSTATE_INVALID_BUFFER_MEMORY_OFFSET,
    130     DRAWSTATE_INVALID_TEXEL_BUFFER_OFFSET,
    131     DRAWSTATE_INVALID_UNIFORM_BUFFER_OFFSET,
    132     DRAWSTATE_INVALID_STORAGE_BUFFER_OFFSET,
    133     DRAWSTATE_INDEPENDENT_BLEND,
    134     DRAWSTATE_DISABLED_LOGIC_OP,
    135     DRAWSTATE_INVALID_QUEUE_INDEX,
    136     DRAWSTATE_INVALID_QUEUE_FAMILY,
    137     DRAWSTATE_IMAGE_TRANSFER_GRANULARITY,
    138     DRAWSTATE_PUSH_CONSTANTS_ERROR,
    139     DRAWSTATE_INVALID_SUBPASS_INDEX,
    140     DRAWSTATE_MISMATCHED_IMAGE_FORMAT,
    141     DRAWSTATE_MISMATCHED_IMAGE_ASPECT,
    142     DRAWSTATE_INVALID_IMAGE_FILTER,
    143     DRAWSTATE_MISMATCHED_IMAGE_TYPE,
    144     DRAWSTATE_SWAPCHAIN_NO_SYNC_FOR_ACQUIRE,
    145     DRAWSTATE_SWAPCHAIN_INVALID_IMAGE,
    146     DRAWSTATE_SWAPCHAIN_IMAGE_NOT_ACQUIRED,
    147     DRAWSTATE_SWAPCHAIN_ALREADY_EXISTS,
    148     DRAWSTATE_SWAPCHAIN_WRONG_SURFACE,
    149     DRAWSTATE_SWAPCHAIN_CREATE_BEFORE_QUERY,
    150     DRAWSTATE_SWAPCHAIN_UNSUPPORTED_QUEUE,
    151     DRAWSTATE_SWAPCHAIN_BAD_IMAGE_COUNT,
    152     DRAWSTATE_SWAPCHAIN_BAD_EXTENTS,
    153     DRAWSTATE_SWAPCHAIN_BAD_PRE_TRANSFORM,
    154     DRAWSTATE_SWAPCHAIN_BAD_COMPOSITE_ALPHA,
    155     DRAWSTATE_SWAPCHAIN_BAD_LAYER_COUNT,
    156     DRAWSTATE_SWAPCHAIN_BAD_USAGE_FLAGS,
    157     DRAWSTATE_SWAPCHAIN_TOO_MANY_IMAGES,
    158     DRAWSTATE_SWAPCHAIN_BAD_PRESENT_MODE,
    159     DRAWSTATE_SWAPCHAIN_BAD_FORMAT,
    160     DRAWSTATE_SWAPCHAIN_REPLACED,
    161     DRAWSTATE_SWAPCHAIN_IMAGES_NOT_FOUND,
    162     DRAWSTATE_EXTENSION_NOT_ENABLED,
    163     DRAWSTATE_INVALID_IMAGE_SUBRANGE,
    164 };
    165 
    166 // Shader Checker ERROR codes
    167 enum SHADER_CHECKER_ERROR {
    168     SHADER_CHECKER_NONE,
    169     SHADER_CHECKER_INTERFACE_TYPE_MISMATCH,
    170     SHADER_CHECKER_OUTPUT_NOT_CONSUMED,
    171     SHADER_CHECKER_INPUT_NOT_PRODUCED,
    172     SHADER_CHECKER_NON_SPIRV_SHADER,
    173     SHADER_CHECKER_INCONSISTENT_SPIRV,
    174     SHADER_CHECKER_UNKNOWN_STAGE,
    175     SHADER_CHECKER_INCONSISTENT_VI,
    176     SHADER_CHECKER_MISSING_DESCRIPTOR,
    177     SHADER_CHECKER_BAD_SPECIALIZATION,
    178     SHADER_CHECKER_MISSING_ENTRYPOINT,
    179     SHADER_CHECKER_PUSH_CONSTANT_OUT_OF_RANGE,
    180     SHADER_CHECKER_PUSH_CONSTANT_NOT_ACCESSIBLE_FROM_STAGE,
    181     SHADER_CHECKER_DESCRIPTOR_TYPE_MISMATCH,
    182     SHADER_CHECKER_DESCRIPTOR_NOT_ACCESSIBLE_FROM_STAGE,
    183     SHADER_CHECKER_FEATURE_NOT_ENABLED,
    184     SHADER_CHECKER_BAD_CAPABILITY,
    185     SHADER_CHECKER_MISSING_INPUT_ATTACHMENT,
    186     SHADER_CHECKER_INPUT_ATTACHMENT_TYPE_MISMATCH,
    187 };
    188 
    189 // Device Limits ERROR codes
    190 enum DEV_LIMITS_ERROR {
    191     DEVLIMITS_NONE,
    192     DEVLIMITS_INVALID_INSTANCE,
    193     DEVLIMITS_INVALID_PHYSICAL_DEVICE,
    194     DEVLIMITS_MISSING_QUERY_COUNT,
    195     DEVLIMITS_MUST_QUERY_COUNT,
    196     DEVLIMITS_INVALID_FEATURE_REQUESTED,
    197     DEVLIMITS_COUNT_MISMATCH,
    198 };
    199 
    200 enum IMAGE_ERROR {
    201     IMAGE_INVALID_FORMAT_LIMITS_VIOLATION,
    202     IMAGE_ZERO_AREA_SUBREGION,
    203 };
    204 
    205 enum SWAPCHAIN_ERROR {
    206     SWAPCHAIN_INVALID_HANDLE,                     // Handle used that isn't currently valid
    207     SWAPCHAIN_NULL_POINTER,                       // Pointer set to NULL, instead of being a valid pointer
    208     SWAPCHAIN_EXT_NOT_ENABLED_BUT_USED,           // Did not enable WSI extension, but called WSI function
    209     SWAPCHAIN_DEL_OBJECT_BEFORE_CHILDREN,         // Called vkDestroyDevice() before vkDestroySwapchainKHR()
    210     SWAPCHAIN_CREATE_UNSUPPORTED_SURFACE,         // Called vkCreateSwapchainKHR() with a pCreateInfo->surface that wasn't supported
    211     SWAPCHAIN_CREATE_SWAP_WITHOUT_QUERY,          // Called vkCreateSwapchainKHR() without calling a query
    212     SWAPCHAIN_CREATE_SWAP_OUT_OF_BOUNDS_EXTENTS,  // Called vkCreateSwapchainKHR() with out-of-bounds imageExtent
    213     SWAPCHAIN_CREATE_SWAP_EXTENTS_NO_MATCH_WIN,   // Called vkCreateSwapchainKHR w/imageExtent that doesn't match window's extent
    214     SWAPCHAIN_CREATE_SWAP_BAD_PRE_TRANSFORM,      // Called vkCreateSwapchainKHR() with a non-supported preTransform
    215     SWAPCHAIN_CREATE_SWAP_BAD_COMPOSITE_ALPHA,    // Called vkCreateSwapchainKHR() with a non-supported compositeAlpha
    216     SWAPCHAIN_CREATE_SWAP_BAD_IMG_ARRAY_LAYERS,   // Called vkCreateSwapchainKHR() with a non-supported imageArrayLayers
    217     SWAPCHAIN_CREATE_SWAP_BAD_IMG_USAGE_FLAGS,    // Called vkCreateSwapchainKHR() with a non-supported imageUsageFlags
    218     SWAPCHAIN_CREATE_SWAP_BAD_IMG_COLOR_SPACE,    // Called vkCreateSwapchainKHR() with a non-supported imageColorSpace
    219     SWAPCHAIN_CREATE_SWAP_BAD_IMG_FORMAT,         // Called vkCreateSwapchainKHR() with a non-supported imageFormat
    220     SWAPCHAIN_CREATE_SWAP_BAD_IMG_FMT_CLR_SP,     // Called vkCreateSwapchainKHR() with a non-supported imageColorSpace
    221     SWAPCHAIN_CREATE_SWAP_BAD_PRESENT_MODE,       // Called vkCreateSwapchainKHR() with a non-supported presentMode
    222     SWAPCHAIN_CREATE_SWAP_BAD_SHARING_MODE,       // Called vkCreateSwapchainKHR() with a non-supported imageSharingMode
    223     SWAPCHAIN_CREATE_SWAP_BAD_SHARING_VALUES,     // Called vkCreateSwapchainKHR() with bad values when imageSharingMode is
    224                                                   // VK_SHARING_MODE_CONCURRENT
    225     SWAPCHAIN_BAD_BOOL,       // VkBool32 that doesn't have value of VK_TRUE or VK_FALSE (e.g. is a non-zero form of true)
    226     SWAPCHAIN_PRIOR_COUNT,    // Query must be called first to get value of pCount, then called second time
    227     SWAPCHAIN_INVALID_COUNT,  // Second time a query called, the pCount value didn't match first time
    228     SWAPCHAIN_WRONG_STYPE,    // The sType for a struct has the wrong value
    229     SWAPCHAIN_WRONG_NEXT,     // The pNext for a struct is not NULL
    230     SWAPCHAIN_ZERO_VALUE,     // A value should be non-zero
    231     SWAPCHAIN_GET_SUPPORTED_DISPLAYS_WITHOUT_QUERY,  // vkGetDisplayPlaneSupportedDisplaysKHR should be called after querying
    232                                                      // device display plane properties
    233     SWAPCHAIN_PLANE_INDEX_TOO_LARGE,  // a planeIndex value is larger than what vkGetDisplayPlaneSupportedDisplaysKHR returns
    234 };
    235 
    236 #endif  // CORE_VALIDATION_ERROR_ENUMS_H_
    237