From: Jon Ashburn Date: Tue, 14 Apr 2015 20:12:59 +0000 (-0600) Subject: layers: Add extension Validation so loader will add layers with Validation X-Git-Tag: upstream/1.1.92~5770 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94b12ef51a6495efbec92d56754ef6c2947daf98;p=platform%2Fupstream%2FVulkan-Tools.git layers: Add extension Validation so loader will add layers with Validation Also fix extension supported list in DrawState and ObjectTracker to include their local extensions in GetGlobalExtensionInfo() --- diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index e74fa18..1ad7c1d 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -1470,10 +1470,14 @@ struct extProps { uint32_t version; const char * const name; }; -#define DRAW_STATE_LAYER_EXT_ARRAY_SIZE 1 +#define DRAW_STATE_LAYER_EXT_ARRAY_SIZE 5 static const struct extProps dsExts[DRAW_STATE_LAYER_EXT_ARRAY_SIZE] = { // TODO what is the version? - 0x10, "DrawState" + 0x10, "DrawState", + 0x10, "Validation", + 0x10, "drawStateDumpDotFile", + 0x10, "drawStateDumpCommandBufferDotFile", + 0x10, "drawStateDumpPngFile" }; VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo( @@ -1637,6 +1641,8 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateGraphicsPipelineDerivative( track_pipeline(pCreateInfo, pPipeline); loader_platform_thread_unlock_mutex(&globalLock); + + return result; } VK_LAYER_EXPORT VkResult VKAPI vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, VkSampler* pSampler) diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp index 152a4e9..fe48633 100644 --- a/layers/mem_tracker.cpp +++ b/layers/mem_tracker.cpp @@ -878,10 +878,11 @@ struct extProps { uint32_t version; const char * const name; }; -#define MEM_TRACKER_LAYER_EXT_ARRAY_SIZE 1 +#define MEM_TRACKER_LAYER_EXT_ARRAY_SIZE 2 static const struct extProps mtExts[MEM_TRACKER_LAYER_EXT_ARRAY_SIZE] = { // TODO what is the version? - 0x10, "MemTracker" + 0x10, "MemTracker", + 0x10, "Validation" }; VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo( diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp index c3cc839..9455074 100644 --- a/layers/param_checker.cpp +++ b/layers/param_checker.cpp @@ -262,10 +262,11 @@ struct extProps { const char * const name; }; -#define PARAM_CHECKER_LAYER_EXT_ARRAY_SIZE 1 +#define PARAM_CHECKER_LAYER_EXT_ARRAY_SIZE 2 static const struct extProps pcExts[PARAM_CHECKER_LAYER_EXT_ARRAY_SIZE] = { // TODO what is the version? 0x10, "ParamChecker", + 0x10, "Validation", }; VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo( diff --git a/vk-layer-generate.py b/vk-layer-generate.py index d9a7581..5e9c54a 100755 --- a/vk-layer-generate.py +++ b/vk-layer-generate.py @@ -200,11 +200,21 @@ class Subcommand(object): ggei_body.append(' uint32_t version;') ggei_body.append(' const char * const name;') ggei_body.append('};') - ggei_body.append('#define LAYER_EXT_ARRAY_SIZE 1') - ggei_body.append('static const struct extProps layerExts[LAYER_EXT_ARRAY_SIZE] = {') - ggei_body.append(' // TODO what is the version?') - ggei_body.append(' {0x10, "%s"}' % layer) - ggei_body.append('};') + if layer == 'ObjectTracker': + ggei_body.append('#define LAYER_EXT_ARRAY_SIZE 4') + ggei_body.append('static const struct extProps layerExts[LAYER_EXT_ARRAY_SIZE] = {') + ggei_body.append(' // TODO what is the version?') + ggei_body.append(' {0x10, "%s"},' % layer) + ggei_body.append(' {0x10, "Validation"},') + ggei_body.append(' {0x10, "objTrackGetObjectCount"},') + ggei_body.append(' {0x10, "objTrackGetObjects"}') + ggei_body.append('};') + else: + ggei_body.append('#define LAYER_EXT_ARRAY_SIZE 1') + ggei_body.append('static const struct extProps layerExts[LAYER_EXT_ARRAY_SIZE] = {') + ggei_body.append(' // TODO what is the version?') + ggei_body.append(' {0x10, "%s"}' % layer) + ggei_body.append('};') ggei_body.append('') ggei_body.append('VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(VkExtensionInfoType infoType, uint32_t extensionIndex, size_t* pDataSize, void* pData)') ggei_body.append('{')