DescriptorPool (VkDevice, VkDescriptorPoolUsage, deUint32, const VkDescriptorPoolCreateInfo*) {}
};
+class DescriptorSet
+{
+public:
+ DescriptorSet (VkDevice, VkDescriptorPool, VkDescriptorSetUsage, VkDescriptorSetLayout) {}
+};
+
class Pipeline
{
public:
return VK_SUCCESS;
}
+VkResult allocDescriptorSets (VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, deUint32 count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets, deUint32* pCount)
+{
+ for (deUint32 ndx = 0; ndx < count; ++ndx)
+ {
+ try
+ {
+ pDescriptorSets[ndx] = VkDescriptorSet((deUint64)(deUintptr)new DescriptorSet(device, descriptorPool, setUsage, pSetLayouts[ndx]));
+ }
+ catch (const std::bad_alloc&)
+ {
+ *pCount = ndx;
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+ catch (VkResult res)
+ {
+ *pCount = ndx;
+ return res;
+ }
+ }
+
+ *pCount = count;
+ return VK_SUCCESS;
+}
+
+VkResult freeDescriptorSets (VkDevice, VkDescriptorPool, deUint32 count, const VkDescriptorSet* pDescriptorSets)
+{
+ for (deUint32 ndx = 0; ndx < count; ++ndx)
+ {
+ // \note: delete cannot fail
+ delete reinterpret_cast<DescriptorSet*>((deUintptr)pDescriptorSets[ndx].getInternal());
+ }
+
+ return VK_SUCCESS;
+}
+
#include "vkNullDriverImpl.inl"
} // extern "C"
return VK_SUCCESS;
}
-VkResult allocDescriptorSets (VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, deUint32 count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets, deUint32* pCount)
-{
- DE_UNREF(device);
- DE_UNREF(descriptorPool);
- DE_UNREF(setUsage);
- DE_UNREF(count);
- DE_UNREF(pSetLayouts);
- DE_UNREF(pDescriptorSets);
- DE_UNREF(pCount);
- return VK_SUCCESS;
-}
-
-VkResult freeDescriptorSets (VkDevice device, VkDescriptorPool descriptorPool, deUint32 count, const VkDescriptorSet* pDescriptorSets)
-{
- DE_UNREF(device);
- DE_UNREF(descriptorPool);
- DE_UNREF(count);
- DE_UNREF(pDescriptorSets);
- return VK_SUCCESS;
-}
-
VkResult updateDescriptorSets (VkDevice device, deUint32 writeCount, const VkWriteDescriptorSet* pDescriptorWrites, deUint32 copyCount, const VkCopyDescriptorSet* pDescriptorCopies)
{
DE_UNREF(device);
"vkGetPhysicalDeviceMemoryProperties",
"vkGetBufferMemoryRequirements",
"vkGetImageMemoryRequirements",
- "vkMapMemory"
+ "vkMapMemory",
+ "vkAllocDescriptorSets",
+ "vkFreeDescriptorSets",
]
specialFuncs = [f for f in api.functions if f.name in specialFuncNames]
createFuncs = [f for f in api.functions if (f.name[:8] == "vkCreate" or f.name == "vkAllocMemory") and not f in specialFuncs]