aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-10-23 14:21:05 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-10-26 16:24:10 -0600
commit014ded8f27412b0d3d29dc40352d938253a57368 (patch)
tree2c7f67895d02b73a28aef86ff09193fcb1a3d344 /loader
parentabd50880e9bee98cb77aec5186781d4098934e0c (diff)
downloadusermoji-014ded8f27412b0d3d29dc40352d938253a57368.tar.xz
bug-14258: Make descriptor pools and command pools more consistent
Diffstat (limited to 'loader')
-rw-r--r--loader/gpa_helper.h12
-rw-r--r--loader/table_ops.h12
-rw-r--r--loader/trampoline.c29
-rwxr-xr-xloader/vk-loader-generate.py2
4 files changed, 33 insertions, 22 deletions
diff --git a/loader/gpa_helper.h b/loader/gpa_helper.h
index d462694a..11de1aa4 100644
--- a/loader/gpa_helper.h
+++ b/loader/gpa_helper.h
@@ -221,10 +221,10 @@ static inline void* globalGetProcAddr(const char *name)
return (void*) vkDestroyCommandPool;
if (!strcmp(name, "ResetCommandPool"))
return (void*) vkResetCommandPool;
- if (!strcmp(name, "CreateCommandBuffer"))
- return (void*) vkCreateCommandBuffer;
- if (!strcmp(name, "DestroyCommandBuffer"))
- return (void*) vkDestroyCommandBuffer;
+ if (!strcmp(name, "AllocCommandBuffers"))
+ return (void*) vkAllocCommandBuffers;
+ if (!strcmp(name, "FreeCommandBuffers"))
+ return (void*) vkFreeCommandBuffers;
if (!strcmp(name, "BeginCommandBuffer"))
return (void*) vkBeginCommandBuffer;
if (!strcmp(name, "EndCommandBuffer"))
@@ -366,8 +366,8 @@ static inline void *loader_non_passthrough_gdpa(const char *name)
return (void*) vkDestroyDevice;
if (!strcmp(name, "GetDeviceQueue"))
return (void*) vkGetDeviceQueue;
- if (!strcmp(name, "CreateCommandBuffer"))
- return (void*) vkCreateCommandBuffer;
+ if (!strcmp(name, "AllocCommandBuffers"))
+ return (void*) vkAllocCommandBuffers;
return NULL;
}
diff --git a/loader/table_ops.h b/loader/table_ops.h
index a10fe8a1..6edb7496 100644
--- a/loader/table_ops.h
+++ b/loader/table_ops.h
@@ -116,8 +116,8 @@ static inline void loader_init_device_dispatch_table(VkLayerDispatchTable *table
table->CreateCommandPool = (PFN_vkCreateCommandPool) gpa(dev, "vkCreateCommandPool");
table->DestroyCommandPool = (PFN_vkDestroyCommandPool) gpa(dev, "vkDestroyCommandPool");
table->ResetCommandPool = (PFN_vkResetCommandPool) gpa(dev, "vkResetCommandPool");
- table->CreateCommandBuffer = (PFN_vkCreateCommandBuffer) gpa(dev, "vkCreateCommandBuffer");
- table->DestroyCommandBuffer = (PFN_vkDestroyCommandBuffer) gpa(dev, "vkDestroyCommandBuffer");
+ table->AllocCommandBuffers = (PFN_vkAllocCommandBuffers) gpa(dev, "vkAllocCommandBuffers");
+ table->FreeCommandBuffers = (PFN_vkFreeCommandBuffers) gpa(dev, "vkFreeCommandBuffers");
table->BeginCommandBuffer = (PFN_vkBeginCommandBuffer) gpa(dev, "vkBeginCommandBuffer");
table->EndCommandBuffer = (PFN_vkEndCommandBuffer) gpa(dev, "vkEndCommandBuffer");
table->ResetCommandBuffer = (PFN_vkResetCommandBuffer) gpa(dev, "vkResetCommandBuffer");
@@ -346,10 +346,10 @@ static inline void *loader_lookup_device_dispatch_table(
return (void *) table->DestroyCommandPool;
if (!strcmp(name, "ResetCommandPool"))
return (void *) table->ResetCommandPool;
- if (!strcmp(name, "CreateCommandBuffer"))
- return (void *) table->CreateCommandBuffer;
- if (!strcmp(name, "DestroyCommandBuffer"))
- return (void *) table->DestroyCommandBuffer;
+ if (!strcmp(name, "AllocCommandBuffers"))
+ return (void *) table->AllocCommandBuffers;
+ if (!strcmp(name, "FreeCommandBuffers"))
+ return (void *) table->FreeCommandBuffers;
if (!strcmp(name, "BeginCommandBuffer"))
return (void *) table->BeginCommandBuffer;
if (!strcmp(name, "EndCommandBuffer"))
diff --git a/loader/trampoline.c b/loader/trampoline.c
index a2f5d1a5..012473d1 100644
--- a/loader/trampoline.c
+++ b/loader/trampoline.c
@@ -929,22 +929,22 @@ LOADER_EXPORT void VKAPI vkDestroyDescriptorPool(VkDevice device, VkDescriptorPo
}
-LOADER_EXPORT VkResult VKAPI vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool)
+LOADER_EXPORT VkResult VKAPI vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags)
{
const VkLayerDispatchTable *disp;
disp = loader_get_dispatch(device);
- return disp->ResetDescriptorPool(device, descriptorPool);
+ return disp->ResetDescriptorPool(device, descriptorPool, flags);
}
-LOADER_EXPORT VkResult VKAPI vkAllocDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets)
+LOADER_EXPORT VkResult VKAPI vkAllocDescriptorSets(VkDevice device, const VkDescriptorSetAllocInfo* pAllocInfo, VkDescriptorSet* pDescriptorSets)
{
const VkLayerDispatchTable *disp;
disp = loader_get_dispatch(device);
- return disp->AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets);
+ return disp->AllocDescriptorSets(device, pAllocInfo, pDescriptorSets);
}
LOADER_EXPORT VkResult VKAPI vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets)
@@ -1037,28 +1037,39 @@ LOADER_EXPORT VkResult VKAPI vkResetCommandPool(VkDevice device, VkCmdPool cmdPo
return disp->ResetCommandPool(device, cmdPool, flags);
}
-LOADER_EXPORT VkResult VKAPI vkCreateCommandBuffer(VkDevice device, const VkCmdBufferCreateInfo* pCreateInfo, VkCmdBuffer* pCmdBuffer)
+LOADER_EXPORT VkResult VKAPI vkAllocCommandBuffers(
+ VkDevice device,
+ const VkCmdBufferAllocInfo* pAllocInfo,
+ VkCmdBuffer* pCmdBuffers)
{
const VkLayerDispatchTable *disp;
VkResult res;
disp = loader_get_dispatch(device);
- res = disp->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer);
+ res = disp->AllocCommandBuffers(device, pAllocInfo, pCmdBuffers);
if (res == VK_SUCCESS) {
- loader_init_dispatch(*pCmdBuffer, disp);
+ for (uint32_t i =0; i < pAllocInfo->count; i++) {
+ if (pCmdBuffers[i]) {
+ loader_init_dispatch(pCmdBuffers[i], disp);
+ }
+ }
}
return res;
}
-LOADER_EXPORT void VKAPI vkDestroyCommandBuffer(VkDevice device, VkCmdBuffer cmdBuffer)
+LOADER_EXPORT void VKAPI vkFreeCommandBuffers(
+ VkDevice device,
+ VkCmdPool cmdPool,
+ uint32_t count,
+ const VkCmdBuffer* pCommandBuffers)
{
const VkLayerDispatchTable *disp;
disp = loader_get_dispatch(device);
- disp->DestroyCommandBuffer(device, cmdBuffer);
+ disp->FreeCommandBuffers(device, cmdPool, count, pCommandBuffers);
}
LOADER_EXPORT VkResult VKAPI vkBeginCommandBuffer(VkCmdBuffer cmdBuffer, const VkCmdBufferBeginInfo* pBeginInfo)
diff --git a/loader/vk-loader-generate.py b/loader/vk-loader-generate.py
index b51c6e4a..6439703e 100755
--- a/loader/vk-loader-generate.py
+++ b/loader/vk-loader-generate.py
@@ -49,7 +49,7 @@ class Subcommand(object):
# Dont be cute trying to use a general rule to programmatically populate this list
# it just obsfucates what is going on!
wsi_creates_dispatchable_object = ["CreateSwapchainKHR"]
- creates_dispatchable_object = ["CreateDevice", "GetDeviceQueue", "CreateCommandBuffer"] + wsi_creates_dispatchable_object
+ creates_dispatchable_object = ["CreateDevice", "GetDeviceQueue", "AllocCommandBuffers"] + wsi_creates_dispatchable_object
if name in creates_dispatchable_object:
return True
else: