layers: Removing old GetExtensionSupport API call
authorTobin Ehlis <tobin@lunarg.com>
Thu, 16 Apr 2015 17:17:12 +0000 (11:17 -0600)
committerTobin Ehlis <tobin@lunarg.com>
Thu, 16 Apr 2015 18:39:55 +0000 (12:39 -0600)
layers/basic.cpp
layers/draw_state.cpp
layers/glave_snapshot.c
layers/mem_tracker.cpp
layers/multi.cpp
layers/param_checker.cpp
vk-layer-generate.py
vulkan.py

index d82c6c5..eddb9fc 100644 (file)
@@ -114,30 +114,6 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
     return VK_SUCCESS;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName)
-{
-    VkResult result;
-
-    /* This entrypoint is NOT going to init it's own dispatch table since loader calls here early */
-    if (!strncmp(pExtName, "vkLayerExtension1", strlen("vkLayerExtension1")))
-    {
-        result = VK_SUCCESS;
-    } else if (!strncmp(pExtName, "Basic", strlen("Basic")))
-    {
-        result = VK_SUCCESS;
-    } else if (!tableMap.empty() && (tableMap.find(gpu) != tableMap.end()))
-    {
-        printf("At start of wrapped vkGetExtensionSupport() call w/ gpu: %p\n", (void*)gpu);
-        VkLayerDispatchTable* pTable = tableMap[gpu];
-        result = pTable->GetExtensionSupport(gpu, pExtName);
-        printf("Completed wrapped vkGetExtensionSupport() call w/ gpu: %p\n", (void*)gpu);
-    } else
-    {
-        result = VK_ERROR_INVALID_EXTENSION;
-    }
-    return result;
-}
-
 VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice(VkPhysicalGpu gpu, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice)
 {
     VkLayerDispatchTable* pTable = tableMap[gpu];
@@ -203,8 +179,6 @@ VK_LAYER_EXPORT void * VKAPI vkGetProcAddr(VkPhysicalGpu gpu, const char* pName)
         return (void *) vkGetProcAddr;
     else if (!strncmp("vkCreateDevice", pName, sizeof ("vkCreateDevice")))
         return (void *) vkCreateDevice;
-    else if (!strncmp("vkGetExtensionSupport", pName, sizeof ("vkGetExtensionSupport")))
-        return (void *) vkGetExtensionSupport;
     else if (!strncmp("vkEnumerateLayers", pName, sizeof ("vkEnumerateLayers")))
         return (void *) vkEnumerateLayers;
     else if (!strncmp("vkGetFormatInfo", pName, sizeof ("vkGetFormatInfo")))
index bdeaba5..5dbf962 100644 (file)
@@ -1519,24 +1519,6 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
     return VK_SUCCESS;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName)
-{
-    VkResult result;
-
-    /* This entrypoint is NOT going to init its own dispatch table since loader calls here early */
-    if (!strcmp(pExtName, "DrawState") || !strcmp(pExtName, "drawStateDumpDotFile") ||
-        !strcmp(pExtName, "drawStateDumpCommandBufferDotFile") || !strcmp(pExtName, "drawStateDumpPngFile"))
-    {
-        result = VK_SUCCESS;
-    } else if (nextTable.GetExtensionSupport != NULL)
-    {
-        result = nextTable.GetExtensionSupport(gpu, pExtName);
-    } else {
-        result = VK_ERROR_INVALID_EXTENSION;
-    }
-    return result;
-}
-
 VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
 {
     if (gpu != NULL)
@@ -2754,8 +2736,6 @@ VK_LAYER_EXPORT void* VKAPI vkGetProcAddr(VkPhysicalGpu gpu, const char* funcNam
         return (void*) vkCreateDevice;
     if (!strcmp(funcName, "vkDestroyDevice"))
         return (void*) vkDestroyDevice;
-    if (!strcmp(funcName, "vkGetExtensionSupport"))
-        return (void*) vkGetExtensionSupport;
     if (!strcmp(funcName, "vkEnumerateLayers"))
         return (void*) vkEnumerateLayers;
     if (!strcmp(funcName, "vkQueueSubmit"))
index dabb414..0554d97 100644 (file)
@@ -541,18 +541,6 @@ VK_LAYER_EXPORT VkResult VKAPI vkDestroyDevice(VkDevice device)
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName)
-{
-    VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu;
-    loader_platform_thread_lock_mutex(&objLock);
-    ll_increment_use_count((void*)gpu, VK_OBJECT_TYPE_PHYSICAL_GPU);
-    loader_platform_thread_unlock_mutex(&objLock);
-    pCurObj = gpuw;
-    loader_platform_thread_once(&tabOnce, initGlaveSnapshot);
-    VkResult result = nextTable.GetExtensionSupport((VkPhysicalGpu)gpuw->nextObject, pExtName);
-    return result;
-}
-
 VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
 {
     if (gpu != NULL) {
index d67887e..684cb22 100644 (file)
@@ -943,23 +943,6 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
     return VK_SUCCESS;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName)
-{
-    VkResult result;
-    /* This entrypoint is NOT going to init its own dispatch table since loader calls here early */
-    if (!strcmp(pExtName, "MemTracker"))
-    {
-        result = VK_SUCCESS;
-    } else if (nextTable.GetExtensionSupport != NULL)
-    {
-        result = nextTable.GetExtensionSupport(gpu, pExtName);
-    } else
-    {
-        result = VK_ERROR_INVALID_EXTENSION;
-    }
-    return result;
-}
-
 VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxLayerCount,
     size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
 {
@@ -2003,8 +1986,6 @@ VK_LAYER_EXPORT void* VKAPI vkGetProcAddr(VkPhysicalGpu gpu, const char* funcNam
         return (void*) vkCreateDevice;
     if (!strcmp(funcName, "vkDestroyDevice"))
         return (void*) vkDestroyDevice;
-    if (!strcmp(funcName, "vkGetExtensionSupport"))
-        return (void*) vkGetExtensionSupport;
     if (!strcmp(funcName, "vkEnumerateLayers"))
         return (void*) vkEnumerateLayers;
     if (!strcmp(funcName, "vkQueueSubmit"))
index c590620..785cfc7 100644 (file)
@@ -111,21 +111,6 @@ VK_LAYER_EXPORT VkResult VKAPI multi1EnumerateLayers(VkPhysicalGpu gpu, size_t m
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI multi1GetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName)
-{
-    VkResult result;
-
-    if (!tableMap1.empty() && (tableMap1.find(gpu) != tableMap1.end()))
-    {
-        VkLayerDispatchTable* pTable = tableMap1[gpu];
-        result = pTable->GetExtensionSupport(gpu, pExtName);
-    } else
-    {
-        result = VK_ERROR_INVALID_EXTENSION;
-    }
-    return result;
-}
-
 VK_LAYER_EXPORT void * VKAPI multi1GetProcAddr(VkPhysicalGpu gpu, const char* pName)
 {
     VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu;
@@ -143,8 +128,6 @@ VK_LAYER_EXPORT void * VKAPI multi1GetProcAddr(VkPhysicalGpu gpu, const char* pN
         return (void *) multi1CreateGraphicsPipeline;
     else if (!strncmp("vkStorePipeline", pName, sizeof ("vkStorePipeline")))
         return (void *) multi1StorePipeline;
-    else if (!strncmp("vkGetExtensionSupport", pName, sizeof ("vkGetExtensionSupport")))
-        return (void *) multi1GetExtensionSupport;
     else {
         if (gpuw->pGPA == NULL)
             return NULL;
@@ -226,21 +209,6 @@ VK_LAYER_EXPORT VkResult VKAPI multi2EnumerateLayers(VkPhysicalGpu gpu, size_t m
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI multi2GetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName)
-{
-    VkResult result;
-
-    if (!tableMap2.empty() && (tableMap2.find(gpu) != tableMap2.end()))
-    {
-        VkLayerDispatchTable* pTable = tableMap2[gpu];
-        result = pTable->GetExtensionSupport(gpu, pExtName);
-    } else
-    {
-        result = VK_ERROR_INVALID_EXTENSION;
-    }
-    return result;
-}
-
 VK_LAYER_EXPORT void * VKAPI multi2GetProcAddr(VkPhysicalGpu gpu, const char* pName)
 {
     VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu;
@@ -258,8 +226,6 @@ VK_LAYER_EXPORT void * VKAPI multi2GetProcAddr(VkPhysicalGpu gpu, const char* pN
         return (void *) multi2CreateCommandBuffer;
     else if (!strncmp("vkBeginCommandBuffer", pName, sizeof ("vkBeginCommandBuffer")))
         return (void *) multi2BeginCommandBuffer;
-    else if (!strncmp("vkGetExtensionSupport", pName, sizeof ("vkGetExtensionSupport")))
-        return (void *) multi2GetExtensionSupport;
     else {
         if (gpuw->pGPA == NULL)
             return NULL;
@@ -337,32 +303,6 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
     return VK_SUCCESS;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName)
-{
-    VkResult result;
-
-    /* This entrypoint is NOT going to init it's own dispatch table since loader calls here early */
-    if (!strncmp(pExtName, "multi1", strlen("multi1")))
-    {
-        result = VK_SUCCESS;
-    } else if (!strncmp(pExtName, "multi2", strlen("multi2")))
-    {
-        result = VK_SUCCESS;
-    } else if (!tableMap1.empty() && (tableMap1.find(gpu) != tableMap1.end()))
-    {
-        VkLayerDispatchTable* pTable = tableMap1[gpu];
-        result = pTable->GetExtensionSupport(gpu, pExtName);
-    } else if (!tableMap2.empty() && (tableMap2.find(gpu) != tableMap2.end()))
-    {
-        VkLayerDispatchTable* pTable = tableMap2[gpu];
-        result = pTable->GetExtensionSupport(gpu, pExtName);
-    } else
-    {
-        result = VK_ERROR_INVALID_EXTENSION;
-    }
-    return result;
-}
-
 VK_LAYER_EXPORT void * VKAPI vkGetProcAddr(VkPhysicalGpu gpu, const char* pName)
 {
     // to find each layers GPA routine Loader will search via "<layerName>GetProcAddr"
index 008aa7b..77040ef 100644 (file)
@@ -304,15 +304,6 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
     return VK_SUCCESS;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName)
-{
-    pCurObj = (VkBaseLayerObject *) gpu;
-    loader_platform_thread_once(&tabOnce, initParamChecker);
-
-    VkResult result = nextTable.GetExtensionSupport(gpu, pExtName);
-    return result;
-}
-
 VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
 {
     char str[1024];
index 2af7eb9..a74b4eb 100755 (executable)
@@ -258,28 +258,6 @@ class Subcommand(object):
         ggei_body.append('}')
         return "\n".join(ggei_body)
 
-    def _gen_layer_get_extension_support(self, layer="Generic"):
-        ges_body = []
-        ges_body.append('VK_LAYER_EXPORT VkResult VKAPI xglGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName)')
-        ges_body.append('{')
-        ges_body.append('    VkResult result;')
-        ges_body.append('    VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu;')
-        ges_body.append('')
-        ges_body.append('    /* This entrypoint is NOT going to init its own dispatch table since loader calls here early */')
-        ges_body.append('    if (!strncmp(pExtName, "%s", strlen("%s")))' % (layer, layer))
-        ges_body.append('    {')
-        ges_body.append('        result = VK_SUCCESS;')
-        ges_body.append('    } else if (nextTable.GetExtensionSupport != NULL)')
-        ges_body.append('    {')
-        ges_body.append('        result = nextTable.GetExtensionSupport((VkPhysicalGpu)gpuw->nextObject, pExtName);')
-        ges_body.append('    } else')
-        ges_body.append('    {')
-        ges_body.append('        result = VK_ERROR_INVALID_EXTENSION;')
-        ges_body.append('    }')
-        ges_body.append('    return result;')
-        ges_body.append('}')
-        return "\n".join(ges_body)
-
     def _generate_dispatch_entrypoints(self, qual=""):
         if qual:
             qual += " "
@@ -297,8 +275,6 @@ class Subcommand(object):
                         intercept = self._gen_layer_dbg_callback_register()
                     elif 'DbgUnregisterMsgCallback' == proto.name:
                         intercept = self._gen_layer_dbg_callback_unregister()
-                    elif 'GetExtensionSupport' == proto.name:
-                        funcs.append(self._gen_layer_get_extension_support(self.layer_name))
                     elif 'GetGlobalExtensionInfo' == proto.name:
                         funcs.append(self._gen_layer_get_global_extension_info(self.layer_name))
                 if intercept is not None:
@@ -475,7 +451,7 @@ class GenericLayerSubcommand(Subcommand):
         return '#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include "loader_platform.h"\n#include "vkLayer.h"\n//The following is #included again to catch certain OS-specific functions being used:\n#include "loader_platform.h"\n\n#include "layers_config.h"\n#include "layers_msg.h"\n\nstatic VkLayerDispatchTable nextTable;\nstatic VkBaseLayerObject *pCurObj;\n\nstatic LOADER_PLATFORM_THREAD_ONCE_DECLARATION(tabOnce);'
 
     def generate_intercept(self, proto, qual):
-        if proto.name in [ 'DbgRegisterMsgCallback', 'DbgUnregisterMsgCallback' , 'GetExtensionSupport', 'GetGlobalExtensionInfo']:
+        if proto.name in [ 'DbgRegisterMsgCallback', 'DbgUnregisterMsgCallback' , 'GetGlobalExtensionInfo']:
             # use default version
             return None
         decl = proto.c_func(prefix="vk", attr="VKAPI")
@@ -774,36 +750,6 @@ class APIDumpSubcommand(Subcommand):
                      '        return VK_SUCCESS;\n'
                      '    }\n'
                          '}' % (qual, decl, self.layer_name, ret_val, proto.c_call(),f_open, log_func, f_close, stmt, self.layer_name))
-        elif 'GetExtensionSupport' == proto.name:
-            funcs.append('%s%s\n'
-                         '{\n'
-                         '    VkResult result;\n'
-                         '    /* This entrypoint is NOT going to init its own dispatch table since loader calls here early */\n'
-                         '    if (!strncmp(pExtName, "%s", strlen("%s")))\n'
-                         '    {\n'
-                         '        result = VK_SUCCESS;\n'
-                         '    } else if (nextTable.GetExtensionSupport != NULL)\n'
-                         '    {\n'
-                         '        result = nextTable.%s;\n'
-                         '        %s    %s        %s\n'
-                         '    } else\n'
-                         '    {\n'
-                         '        result = VK_ERROR_INVALID_EXTENSION;\n'
-                         '    }\n'
-                         '%s'
-                         '}' % (qual, decl, self.layer_name, self.layer_name, proto.c_call(), f_open, log_func, f_close, stmt))
-#        elif 'vkphysicalgpu' == proto.params[0].ty.lower():
-#            c_call = proto.c_call().replace("(" + proto.params[0].name, "((VkPhysicalGpu)gpuw->nextObject", 1)
-#            funcs.append('%s%s\n'
-#                     '{\n'
-#                     '    using namespace StreamControl;\n'
-#                     '    VkBaseLayerObject* gpuw = (VkBaseLayerObject *) %s;\n'
-#                     '    pCurObj = gpuw;\n'
-#                     '    loader_platform_thread_once(&tabOnce, init%s);\n'
-#                     '    %snextTable.%s;\n'
-#                     '    %s%s%s\n'
-#                     '%s'
-#                     '}' % (qual, decl, proto.params[0].name, self.layer_name, ret_val, c_call, f_open, log_func, f_close, stmt))
         else:
             funcs.append('%s%s\n'
                      '{\n'
@@ -1254,26 +1200,6 @@ class ObjectTrackerSubcommand(Subcommand):
                      '        return VK_SUCCESS;\n'
                      '    }\n'
                          '}' % (qual, decl, using_line, self.layer_name, ret_val, proto.c_call(), create_line, destroy_line, stmt, self.layer_name))
-        elif 'GetExtensionSupport' == proto.name:
-            funcs.append('%s%s\n'
-                     '{\n'
-                     '    VkResult result;\n'
-                     '    /* This entrypoint is NOT going to init its own dispatch table since loader calls this early */\n'
-                     '    if (!strncmp(pExtName, "%s", strlen("%s")) ||\n'
-                     '        !strncmp(pExtName, "objTrackGetObjectCount", strlen("objTrackGetObjectCount")) ||\n'
-                     '        !strncmp(pExtName, "objTrackGetObjects", strlen("objTrackGetObjects")))\n'
-                     '    {\n'
-                     '        result = VK_SUCCESS;\n'
-                     '    } else if (nextTable.GetExtensionSupport != NULL)\n'
-                     '    {\n'
-                     '    %s'
-                     '        result = nextTable.%s;\n'
-                     '    } else\n'
-                     '    {\n'
-                     '        result = VK_ERROR_INVALID_EXTENSION;\n'
-                     '    }\n'
-                     '%s'
-                     '}' % (qual, decl, self.layer_name, self.layer_name, using_line, proto.c_call(),  stmt))
         elif 'GetGpuInfo' in proto.name:
             gpu_state =  '    if (infoType == VK_INFO_TYPE_PHYSICAL_GPU_QUEUE_PROPERTIES) {\n'
             gpu_state += '        if (pData != NULL) {\n'
index ab069ac..d921bef 100755 (executable)
--- a/vulkan.py
+++ b/vulkan.py
@@ -255,10 +255,6 @@ core = Extension(
              Param("size_t*", "pDataSize"),
              Param("void*", "pData")]),
 
-        Proto("VkResult", "GetExtensionSupport",
-            [Param("VkPhysicalGpu", "gpu"),
-             Param("const char*", "pExtName")]),
-
         Proto("VkResult", "EnumerateLayers",
             [Param("VkPhysicalGpu", "gpu"),
              Param("size_t", "maxLayerCount"),