layers: Add extension Validation so loader will add layers with Validation
authorJon Ashburn <jon@lunarg.com>
Tue, 14 Apr 2015 20:12:59 +0000 (14:12 -0600)
committerChia-I Wu <olv@lunarg.com>
Thu, 16 Apr 2015 09:48:20 +0000 (17:48 +0800)
Also fix extension supported list in DrawState and ObjectTracker to include
their local extensions in GetGlobalExtensionInfo()

layers/draw_state.cpp
layers/mem_tracker.cpp
layers/param_checker.cpp
vk-layer-generate.py

index e74fa18..1ad7c1d 100644 (file)
@@ -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)
index 152a4e9..fe48633 100644 (file)
@@ -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(
index c3cc839..9455074 100644 (file)
@@ -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(
index d9a7581..5e9c54a 100755 (executable)
@@ -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('{')