From: Mike Stroyan Date: Wed, 8 Apr 2015 16:31:48 +0000 (-0600) Subject: layers: indirect GPA in dispatch table X-Git-Tag: upstream/1.1.92~5755 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=411a5237821fb6d150708d65289d0aae5393501f;p=platform%2Fupstream%2FVulkan-Tools.git layers: indirect GPA in dispatch table layer_initialize_dispatch_table was using gpa pointer without lookup. That could put the loader GPA function in for the lowest dispatch table instead of the icd GPA function. Use the same return from GPA call for GPA itself. There was code fixing up GPA dispatch in draw_state.cpp and mem_tracker.cpp. Remove that now that layer_initialize_dispatch_table does the right thing. --- diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 18e2738..1fe60c3 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -1426,9 +1426,6 @@ static void initDrawState(void) layer_initialize_dispatch_table(&nextTable, fpNextGPA, (VkPhysicalGpu) pCurObj->nextObject); - PFN_vkGetProcAddr fpGetProcAddr = (PFN_vkGetProcAddr)fpNextGPA((VkPhysicalGpu) pCurObj->nextObject, (char *) "vkGetProcAddr"); - nextTable.GetProcAddr = fpGetProcAddr; - if (!globalLockInitialized) { // TODO/TBD: Need to delete this mutex sometime. How??? One diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp index 967272a..b6a46b3 100644 --- a/layers/mem_tracker.cpp +++ b/layers/mem_tracker.cpp @@ -817,9 +817,6 @@ static void initMemTracker(void) layer_initialize_dispatch_table(&nextTable, fpNextGPA, (VkPhysicalGpu) pCurObj->nextObject); - PFN_vkGetProcAddr fpGetProcAddr = (PFN_vkGetProcAddr)fpNextGPA((VkPhysicalGpu) pCurObj->nextObject, (char *) "vkGetProcAddr"); - nextTable.GetProcAddr = fpGetProcAddr; - if (!globalLockInitialized) { // TODO/TBD: Need to delete this mutex sometime. How??? One diff --git a/vk-generate.py b/vk-generate.py index 92bac91..120d7b4 100755 --- a/vk-generate.py +++ b/vk-generate.py @@ -220,10 +220,7 @@ class DispatchTableOpsSubcommand(Subcommand): for proto in self.protos: if 'WsiX11AssociateConnection' == proto.name: stmts.append("#if defined(__linux__) || defined(XCB_NVIDIA)") - if proto.name == "GetProcAddr": - stmts.append("table->%s = gpa; /* direct assignment */" % - proto.name) - elif self.is_dispatchable_object_first_param(proto) or proto.name == "CreateInstance": + if self.is_dispatchable_object_first_param(proto) or proto.name == "CreateInstance": stmts.append("table->%s = (PFN_vk%s) gpa(gpu, \"vk%s\");" % (proto.name, proto.name, proto.name)) else: