mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-14 18:00:54 +00:00
Implement a few more API entry points, some are stubbed out
This commit is contained in:
1 parent
5e624d0f58
commit
f6b6104977
13 files changed
+425
-23
No files matched your search
@@ -55,16 +55,6 @@ In no particular order, features that are not planned until after 1.0.
|
||||
|
||||
Note 1, unsupported entry points:
|
||||
|
||||
* vkGetPhysicalDeviceSparseImageFormatProperties
|
||||
* vkEnumerateDeviceExtensionProperties
|
||||
* vkEnumerateDeviceLayerProperties
|
||||
* vkGetPhysicalDeviceSurfaceSupportKHR
|
||||
* vkInvalidateMappedMemoryRanges
|
||||
* vkGetDeviceMemoryCommitment
|
||||
* vkGetImageSparseMemoryRequirements
|
||||
* vkQueueBindSparseBufferMemory
|
||||
* vkQueueBindSparseImageOpaqueMemory
|
||||
* vkQueueBindSparseImageMemory
|
||||
* vkResetFences
|
||||
* vkWaitForFences
|
||||
* vkCreateEvent
|
||||
@@ -72,12 +62,6 @@ Note 1, unsupported entry points:
|
||||
* vkGetEventStatus
|
||||
* vkSetEvent
|
||||
* vkResetEvent
|
||||
* vkGetPipelineCacheSize
|
||||
* vkGetPipelineCacheData
|
||||
* vkMergePipelineCaches
|
||||
* vkCreateComputePipelines
|
||||
* vkResetDescriptorPool
|
||||
* vkGetRenderAreaGranularity
|
||||
* vkCmdFillBuffer
|
||||
* vkCmdSetEvent
|
||||
* vkCmdResetEvent
|
||||
|
||||
@@ -986,8 +986,7 @@ void WrappedVulkan::ProcessChunk(uint64_t offset, VulkanChunkType context)
|
||||
Serialise_vkCreateGraphicsPipelines(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, 0, NULL, NULL);
|
||||
break;
|
||||
case CREATE_COMPUTE_PIPE:
|
||||
//VKTODOMED:
|
||||
//Serialise_vkCreateComputePipelines(GetMainSerialiser(), VK_NULL_HANDLE, NULL, NULL);
|
||||
Serialise_vkCreateComputePipelines(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, 0, NULL, NULL);
|
||||
break;
|
||||
case GET_SWAPCHAIN_IMAGE:
|
||||
Serialise_vkGetSwapchainImagesKHR(GetMainSerialiser(), VK_NULL_HANDLE, VK_NULL_HANDLE, NULL, NULL);
|
||||
|
||||
@@ -529,6 +529,16 @@ public:
|
||||
VkImageCreateFlags flags,
|
||||
VkImageFormatProperties* pImageFormatProperties);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetPhysicalDeviceSparseImageFormatProperties,
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkFormat format,
|
||||
VkImageType type,
|
||||
uint32_t samples,
|
||||
VkImageUsageFlags usage,
|
||||
VkImageTiling tiling,
|
||||
uint32_t* pNumProperties,
|
||||
VkSparseImageFormatProperties* pProperties);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetPhysicalDeviceProperties,
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkPhysicalDeviceProperties* pProperties);
|
||||
@@ -664,6 +674,16 @@ public:
|
||||
uint32_t memRangeCount,
|
||||
const VkMappedMemoryRange* pMemRanges);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkInvalidateMappedMemoryRanges,
|
||||
VkDevice device,
|
||||
uint32_t memRangeCount,
|
||||
const VkMappedMemoryRange* pMemRanges);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetDeviceMemoryCommitment,
|
||||
VkDevice device,
|
||||
VkDeviceMemory memory,
|
||||
VkDeviceSize* pCommittedMemoryInBytes);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetBufferMemoryRequirements,
|
||||
VkDevice device,
|
||||
VkBuffer buffer,
|
||||
@@ -673,6 +693,12 @@ public:
|
||||
VkDevice device,
|
||||
VkImage image,
|
||||
VkMemoryRequirements* pMemoryRequirements);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetImageSparseMemoryRequirements,
|
||||
VkDevice device,
|
||||
VkImage image,
|
||||
uint32_t* pNumRequirements,
|
||||
VkSparseImageMemoryRequirements* pSparseMemoryRequirements);
|
||||
|
||||
// Memory management API functions
|
||||
|
||||
@@ -687,6 +713,24 @@ public:
|
||||
VkImage image,
|
||||
VkDeviceMemory mem,
|
||||
VkDeviceSize memOffset);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkQueueBindSparseBufferMemory,
|
||||
VkQueue queue,
|
||||
VkBuffer buffer,
|
||||
uint32_t numBindings,
|
||||
const VkSparseMemoryBindInfo* pBindInfo);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkQueueBindSparseImageOpaqueMemory,
|
||||
VkQueue queue,
|
||||
VkImage image,
|
||||
uint32_t numBindings,
|
||||
const VkSparseMemoryBindInfo* pBindInfo);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkQueueBindSparseImageMemory,
|
||||
VkQueue queue,
|
||||
VkImage image,
|
||||
uint32_t numBindings,
|
||||
const VkSparseImageMemoryBindInfo* pBindInfo);
|
||||
|
||||
// Buffer functions
|
||||
|
||||
@@ -766,6 +810,13 @@ public:
|
||||
uint32_t count,
|
||||
const VkGraphicsPipelineCreateInfo* pCreateInfos,
|
||||
VkPipeline* pPipelines);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkCreateComputePipelines,
|
||||
VkDevice device,
|
||||
VkPipelineCache pipelineCache,
|
||||
uint32_t count,
|
||||
const VkComputePipelineCreateInfo* pCreateInfos,
|
||||
VkPipeline* pPipelines);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyPipeline,
|
||||
VkDevice device,
|
||||
@@ -779,6 +830,21 @@ public:
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkDestroyPipelineCache,
|
||||
VkDevice device,
|
||||
VkPipelineCache pipelineCache);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(size_t, vkGetPipelineCacheSize,
|
||||
VkDevice device,
|
||||
VkPipelineCache pipelineCache);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetPipelineCacheData,
|
||||
VkDevice device,
|
||||
VkPipelineCache pipelineCache,
|
||||
void* pData);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkMergePipelineCaches,
|
||||
VkDevice device,
|
||||
VkPipelineCache destCache,
|
||||
uint32_t srcCacheCount,
|
||||
const VkPipelineCache* pSrcCaches);
|
||||
|
||||
// Pipeline layout functions
|
||||
|
||||
@@ -829,6 +895,10 @@ public:
|
||||
uint32_t count,
|
||||
const VkDescriptorSetLayout* pSetLayouts,
|
||||
VkDescriptorSet* pDescriptorSets);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkResetDescriptorPool,
|
||||
VkDevice device,
|
||||
VkDescriptorPool descriptorPool);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkUpdateDescriptorSets,
|
||||
VkDevice device,
|
||||
@@ -844,6 +914,11 @@ public:
|
||||
const VkDescriptorSet* pDescriptorSets);
|
||||
|
||||
// Command pool functions
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetRenderAreaGranularity,
|
||||
VkDevice device,
|
||||
VkRenderPass renderPass,
|
||||
VkExtent2D* pGranularity);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkCreateCommandPool,
|
||||
VkDevice device,
|
||||
@@ -1156,7 +1231,7 @@ public:
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkCmdDbgMarkerEnd,
|
||||
VkCmdBuffer cmdBuffer);
|
||||
|
||||
// KHR functions
|
||||
// Windowing extension functions
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkGetPhysicalDeviceSurfaceSupportKHR,
|
||||
VkPhysicalDevice physicalDevice,
|
||||
|
||||
@@ -77,6 +77,7 @@ void InitInstanceReplayTables(VkInstance instance)
|
||||
|
||||
#define InstanceGPA(func) table->func = (CONCAT(PFN_vk, func))table->GetInstanceProcAddr(instance, STRINGIZE(CONCAT(vk, func)));
|
||||
|
||||
InstanceGPA(GetPhysicalDeviceSurfaceSupportKHR)
|
||||
InstanceGPA(DbgCreateMsgCallback)
|
||||
InstanceGPA(DbgDestroyMsgCallback)
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
HookInit(GetPhysicalDeviceFeatures); \
|
||||
HookInit(GetPhysicalDeviceImageFormatProperties); \
|
||||
HookInit(GetPhysicalDeviceFormatProperties); \
|
||||
HookInit(GetPhysicalDeviceSparseImageFormatProperties); \
|
||||
HookInit(GetPhysicalDeviceProperties); \
|
||||
HookInit(GetPhysicalDeviceQueueFamilyProperties); \
|
||||
HookInit(GetPhysicalDeviceMemoryProperties); \
|
||||
@@ -50,8 +51,13 @@
|
||||
HookInit(MapMemory); \
|
||||
HookInit(UnmapMemory); \
|
||||
HookInit(FlushMappedMemoryRanges); \
|
||||
HookInit(InvalidateMappedMemoryRanges); \
|
||||
HookInit(GetDeviceMemoryCommitment); \
|
||||
HookInit(BindBufferMemory); \
|
||||
HookInit(BindImageMemory); \
|
||||
HookInit(QueueBindSparseBufferMemory); \
|
||||
HookInit(QueueBindSparseImageOpaqueMemory); \
|
||||
HookInit(QueueBindSparseImageMemory); \
|
||||
HookInit(CreateBuffer); \
|
||||
HookInit(DestroyBuffer); \
|
||||
HookInit(CreateBufferView); \
|
||||
@@ -68,8 +74,12 @@
|
||||
HookInit(CreateShaderModule); \
|
||||
HookInit(DestroyShaderModule); \
|
||||
HookInit(CreateGraphicsPipelines); \
|
||||
HookInit(CreateComputePipelines); \
|
||||
HookInit(DestroyPipeline); \
|
||||
HookInit(CreatePipelineCache); \
|
||||
HookInit(GetPipelineCacheSize); \
|
||||
HookInit(GetPipelineCacheData); \
|
||||
HookInit(MergePipelineCaches); \
|
||||
HookInit(DestroyPipelineCache); \
|
||||
HookInit(CreatePipelineLayout); \
|
||||
HookInit(DestroyPipelineLayout); \
|
||||
@@ -88,10 +98,12 @@
|
||||
HookInit(CreateDescriptorSetLayout); \
|
||||
HookInit(DestroyDescriptorSetLayout); \
|
||||
HookInit(CreateDescriptorPool); \
|
||||
HookInit(ResetDescriptorPool); \
|
||||
HookInit(DestroyDescriptorPool); \
|
||||
HookInit(AllocDescriptorSets); \
|
||||
HookInit(UpdateDescriptorSets); \
|
||||
HookInit(FreeDescriptorSets); \
|
||||
HookInit(GetRenderAreaGranularity); \
|
||||
HookInit(CreateCommandPool); \
|
||||
HookInit(DestroyCommandPool); \
|
||||
HookInit(ResetCommandPool); \
|
||||
@@ -156,6 +168,7 @@
|
||||
HookDefine2(VkResult, vkGetPhysicalDeviceFeatures, VkPhysicalDevice, physicalDevice, VkPhysicalDeviceFeatures*, pFeatures); \
|
||||
HookDefine3(VkResult, vkGetPhysicalDeviceFormatProperties, VkPhysicalDevice, physicalDevice, VkFormat, format, VkFormatProperties*, pFormatProperties); \
|
||||
HookDefine7(VkResult, vkGetPhysicalDeviceImageFormatProperties, VkPhysicalDevice, physicalDevice, VkFormat, format, VkImageType, type, VkImageTiling, tiling, VkImageUsageFlags, usage, VkImageCreateFlags, flags, VkImageFormatProperties*, pImageFormatProperties); \
|
||||
HookDefine8(VkResult, vkGetPhysicalDeviceSparseImageFormatProperties, VkPhysicalDevice, physicalDevice, VkFormat, format, VkImageType, type, uint32_t, samples, VkImageUsageFlags, usage, VkImageTiling, tiling, uint32_t*, pNumProperties, VkSparseImageFormatProperties*, pProperties); \
|
||||
HookDefine2(VkResult, vkGetPhysicalDeviceProperties, VkPhysicalDevice, physicalDevice, VkPhysicalDeviceProperties*, pProperties); \
|
||||
HookDefine3(VkResult, vkGetPhysicalDeviceQueueFamilyProperties, VkPhysicalDevice, physicalDevice, uint32_t*, pCount, VkQueueFamilyProperties*, pQueueFamilyProperties); \
|
||||
HookDefine2(VkResult, vkGetPhysicalDeviceMemoryProperties, VkPhysicalDevice, physicalDevice, VkPhysicalDeviceMemoryProperties*, pMemoryProperties); \
|
||||
@@ -170,8 +183,13 @@
|
||||
HookDefine6(VkResult, vkMapMemory, VkDevice, device, VkDeviceMemory, mem, VkDeviceSize, offset, VkDeviceSize, size, VkMemoryMapFlags, flags, void**, ppData); \
|
||||
HookDefine2(void, vkUnmapMemory, VkDevice, device, VkDeviceMemory, mem); \
|
||||
HookDefine3(VkResult, vkFlushMappedMemoryRanges, VkDevice, device, uint32_t, memRangeCount, const VkMappedMemoryRange*, pMemRanges); \
|
||||
HookDefine3(VkResult, vkInvalidateMappedMemoryRanges, VkDevice, device, uint32_t, memRangeCount, const VkMappedMemoryRange*, pMemRanges); \
|
||||
HookDefine3(VkResult, vkGetDeviceMemoryCommitment, VkDevice, device, VkDeviceMemory, memory, VkDeviceSize*, pCommittedMemoryInBytes); \
|
||||
HookDefine4(VkResult, vkBindBufferMemory, VkDevice, device, VkBuffer, buffer, VkDeviceMemory, mem, VkDeviceSize, memOffset); \
|
||||
HookDefine4(VkResult, vkBindImageMemory, VkDevice, device, VkImage, image, VkDeviceMemory, mem, VkDeviceSize, memOffset); \
|
||||
HookDefine4(VkResult, vkQueueBindSparseBufferMemory, VkQueue, queue, VkBuffer, buffer, uint32_t, numBindings, const VkSparseMemoryBindInfo*, pBindInfo); \
|
||||
HookDefine4(VkResult, vkQueueBindSparseImageOpaqueMemory, VkQueue, queue, VkImage, image, uint32_t, numBindings, const VkSparseMemoryBindInfo*, pBindInfo); \
|
||||
HookDefine4(VkResult, vkQueueBindSparseImageMemory, VkQueue, queue, VkImage, image, uint32_t, numBindings, const VkSparseImageMemoryBindInfo*, pBindInfo); \
|
||||
HookDefine3(VkResult, vkCreateBuffer, VkDevice, device, const VkBufferCreateInfo*, pCreateInfo, VkBuffer*, pBuffer); \
|
||||
HookDefine2(void, vkDestroyBuffer, VkDevice, device, VkBuffer, buffer); \
|
||||
HookDefine3(VkResult, vkCreateBufferView, VkDevice, device, const VkBufferViewCreateInfo*, pCreateInfo, VkBufferView*, pView); \
|
||||
@@ -188,9 +206,13 @@
|
||||
HookDefine3(VkResult, vkCreateShaderModule, VkDevice, device, const VkShaderModuleCreateInfo*, pCreateInfo, VkShaderModule*, pShaderModule); \
|
||||
HookDefine2(void, vkDestroyShaderModule, VkDevice, device, VkShaderModule, shaderModule); \
|
||||
HookDefine5(VkResult, vkCreateGraphicsPipelines, VkDevice, device, VkPipelineCache, pipelineCache, uint32_t, count, const VkGraphicsPipelineCreateInfo*, pCreateInfos, VkPipeline*, pPipelines); \
|
||||
HookDefine5(VkResult, vkCreateComputePipelines, VkDevice, device, VkPipelineCache, pipelineCache, uint32_t, count, const VkComputePipelineCreateInfo*, pCreateInfos, VkPipeline*, pPipelines); \
|
||||
HookDefine2(void, vkDestroyPipeline, VkDevice, device, VkPipeline, pipeline); \
|
||||
HookDefine3(VkResult, vkCreatePipelineCache, VkDevice, device, const VkPipelineCacheCreateInfo*, pCreateInfo, VkPipelineCache*, pPipelineCache); \
|
||||
HookDefine2(void, vkDestroyPipelineCache, VkDevice, device, VkPipelineCache, pipelineCache); \
|
||||
HookDefine2(size_t, vkGetPipelineCacheSize, VkDevice, device, VkPipelineCache, pipelineCache); \
|
||||
HookDefine3(VkResult, vkGetPipelineCacheData, VkDevice, device, VkPipelineCache, pipelineCache, void*, pData); \
|
||||
HookDefine4(VkResult, vkMergePipelineCaches, VkDevice, device, VkPipelineCache, pipelineCache, uint32_t, srcCacheCount, const VkPipelineCache*, pSrcCaches); \
|
||||
HookDefine3(VkResult, vkCreatePipelineLayout, VkDevice, device, const VkPipelineLayoutCreateInfo*, pCreateInfo, VkPipelineLayout*, pPipelineLayout); \
|
||||
HookDefine2(void, vkDestroyPipelineLayout, VkDevice, device, VkPipelineLayout, pipelineLayout); \
|
||||
HookDefine3(VkResult, vkCreateSemaphore, VkDevice, device, const VkSemaphoreCreateInfo*, pCreateInfo, VkSemaphore*, pSemaphore); \
|
||||
@@ -209,6 +231,7 @@
|
||||
HookDefine2(void, vkDestroyDescriptorSetLayout, VkDevice, device, VkDescriptorSetLayout, descriptorSetLayout); \
|
||||
HookDefine3(VkResult, vkCreateDescriptorPool, VkDevice, device, const VkDescriptorPoolCreateInfo*, pCreateInfo, VkDescriptorPool*, pDescriptorPool); \
|
||||
HookDefine2(void, vkDestroyDescriptorPool, VkDevice, device, VkDescriptorPool, descriptorPool); \
|
||||
HookDefine2(VkResult, vkResetDescriptorPool, VkDevice, device, VkDescriptorPool, descriptorPool); \
|
||||
HookDefine6(VkResult, vkAllocDescriptorSets, VkDevice, device, VkDescriptorPool, descriptorPool, VkDescriptorSetUsage, setUsage, uint32_t, count, const VkDescriptorSetLayout*, pSetLayouts, VkDescriptorSet*, pDescriptorSets); \
|
||||
HookDefine5(void, vkUpdateDescriptorSets, VkDevice, device, uint32_t, writeCount, const VkWriteDescriptorSet*, pDescriptorWrites, uint32_t, copyCount, const VkCopyDescriptorSet*, pDescriptorCopies); \
|
||||
HookDefine4(VkResult, vkFreeDescriptorSets, VkDevice, device, VkDescriptorPool, descriptorPool, uint32_t, count, const VkDescriptorSet*, pDescriptorSets); \
|
||||
@@ -258,6 +281,7 @@
|
||||
HookDefine2(void, vkDestroyFramebuffer, VkDevice, device, VkFramebuffer, framebuffer); \
|
||||
HookDefine3(VkResult, vkCreateRenderPass, VkDevice, device, const VkRenderPassCreateInfo*, pCreateInfo, VkRenderPass*, pRenderPass); \
|
||||
HookDefine2(void, vkDestroyRenderPass, VkDevice, device, VkRenderPass, renderPass); \
|
||||
HookDefine3(VkResult, vkGetRenderAreaGranularity, VkDevice, device, VkRenderPass, renderPass, VkExtent2D*, pGranularity); \
|
||||
HookDefine3(void, vkCmdBeginRenderPass, VkCmdBuffer, cmdBuffer, const VkRenderPassBeginInfo*, pRenderPassBegin, VkRenderPassContents, contents); \
|
||||
HookDefine1(void, vkCmdEndRenderPass, VkCmdBuffer, cmdBuffer); \
|
||||
HookDefine5(VkResult, vkDbgCreateMsgCallback, VkInstance, instance, VkFlags, msgFlags, const PFN_vkDbgMsgCallback, pfnMsgCallback, void*, pUserData, VkDbgMsgCallback*, pMsgCallback); \
|
||||
|
||||
@@ -110,6 +110,51 @@ void VulkanCreationInfo::Pipeline::Init(const VkGraphicsPipelineCreateInfo* pCre
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::Pipeline::Init(const VkComputePipelineCreateInfo* pCreateInfo)
|
||||
{
|
||||
flags = pCreateInfo->flags;
|
||||
|
||||
// need to figure out which states are valid to be NULL
|
||||
|
||||
// VkPipelineShaderStageCreateInfo
|
||||
RDCEraseEl(shaders);
|
||||
shaders[0] = VKMGR()->GetNonDispWrapper(pCreateInfo->stage.shader)->id;
|
||||
|
||||
topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
||||
primitiveRestartEnable = false;
|
||||
|
||||
patchControlPoints = 0;
|
||||
|
||||
viewportCount = 0;
|
||||
|
||||
// VkPipelineRasterStateCreateInfo
|
||||
depthClipEnable = false;
|
||||
rasterizerDiscardEnable = false;
|
||||
fillMode = VK_FILL_MODE_SOLID;
|
||||
cullMode = VK_CULL_MODE_NONE;
|
||||
frontFace = VK_FRONT_FACE_CW;
|
||||
|
||||
// VkPipelineMultisampleStateCreateInfo
|
||||
rasterSamples = 1;
|
||||
sampleShadingEnable = false;
|
||||
minSampleShading = 1.0f;
|
||||
sampleMask = ~0U;
|
||||
|
||||
// VkPipelineDepthStencilStateCreateInfo
|
||||
depthTestEnable = false;
|
||||
depthWriteEnable = false;
|
||||
depthCompareOp = VK_COMPARE_OP_ALWAYS;
|
||||
depthBoundsEnable = false;
|
||||
stencilTestEnable = false;
|
||||
RDCEraseEl(front);
|
||||
RDCEraseEl(back);
|
||||
|
||||
// VkPipelineColorBlendStateCreateInfo
|
||||
alphaToCoverageEnable = false;
|
||||
logicOpEnable = false;
|
||||
logicOp = VK_LOGIC_OP_NOOP;
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::RenderPass::Init(const VkRenderPassCreateInfo* pCreateInfo)
|
||||
{
|
||||
// VKTODOMED figure out how subpasses work
|
||||
|
||||
@@ -32,6 +32,7 @@ struct VulkanCreationInfo
|
||||
struct Pipeline
|
||||
{
|
||||
void Init(const VkGraphicsPipelineCreateInfo* pCreateInfo);
|
||||
void Init(const VkComputePipelineCreateInfo* pCreateInfo);
|
||||
|
||||
// VkGraphicsPipelineCreateInfo
|
||||
VkPipelineCreateFlags flags;
|
||||
|
||||
@@ -65,6 +65,8 @@ class VulkanResourceManager : public ResourceManager<WrappedVkRes*, TypedRealHan
|
||||
typename UnwrapHelper<realtype>::Outer *wrapped = GetWrapped(obj);
|
||||
VkResourceRecord *ret = wrapped->record = ResourceManager::AddResourceRecord(wrapped->id);
|
||||
|
||||
ret->Resource = (WrappedVkRes *)wrapped;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -169,7 +171,11 @@ class VulkanResourceManager : public ResourceManager<WrappedVkRes*, TypedRealHan
|
||||
{
|
||||
// delete all of our children
|
||||
for(auto it = record->pooledChildren.begin(); it != record->pooledChildren.end(); ++it)
|
||||
(*it)->Delete(this);
|
||||
{
|
||||
// unset record->pool so we don't recurse
|
||||
(*it)->pool = NULL;
|
||||
ReleaseWrappedResource((VkDescriptorSet)(uint64_t)(*it)->Resource, true);
|
||||
}
|
||||
record->pooledChildren.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -631,6 +631,8 @@ struct VkResourceRecord : public ResourceRecord
|
||||
|
||||
VkResourceRecord *bakedCommands;
|
||||
|
||||
WrappedVkRes *Resource;
|
||||
|
||||
// a list of resources that are made dirty by submitting this command buffer
|
||||
set<ResourceId> dirtied;
|
||||
|
||||
|
||||
@@ -322,6 +322,27 @@ VkResult WrappedVulkan::vkFreeDescriptorSets(
|
||||
return ret;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkResetDescriptorPool(
|
||||
VkDevice device,
|
||||
VkDescriptorPool descriptorPool)
|
||||
{
|
||||
// need to free all child descriptor pools. Application is responsible for
|
||||
// ensuring no concurrent use with alloc/free from this pool, the same as
|
||||
// for DestroyDescriptorPool.
|
||||
VkResourceRecord *record = GetRecord(descriptorPool);
|
||||
|
||||
// delete all of the children
|
||||
for(auto it = record->pooledChildren.begin(); it != record->pooledChildren.end(); ++it)
|
||||
{
|
||||
// unset record->pool so we don't recurse
|
||||
(*it)->pool = NULL;
|
||||
GetResourceManager()->ReleaseWrappedResource((VkDescriptorSet)(uint64_t)(*it)->Resource, true);
|
||||
}
|
||||
record->pooledChildren.clear();
|
||||
|
||||
return ObjDisp(device)->ResetDescriptorPool(Unwrap(device), Unwrap(descriptorPool));
|
||||
}
|
||||
|
||||
bool WrappedVulkan::Serialise_vkUpdateDescriptorSets(
|
||||
Serialiser* localSerialiser,
|
||||
VkDevice device,
|
||||
|
||||
@@ -51,6 +51,19 @@ VkResult WrappedVulkan::vkGetPhysicalDeviceImageFormatProperties(
|
||||
return ObjDisp(physicalDevice)->GetPhysicalDeviceImageFormatProperties(Unwrap(physicalDevice), format, type, tiling, usage, flags, pImageFormatProperties);
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetPhysicalDeviceSparseImageFormatProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkFormat format,
|
||||
VkImageType type,
|
||||
uint32_t samples,
|
||||
VkImageUsageFlags usage,
|
||||
VkImageTiling tiling,
|
||||
uint32_t* pNumProperties,
|
||||
VkSparseImageFormatProperties* pProperties)
|
||||
{
|
||||
return ObjDisp(physicalDevice)->GetPhysicalDeviceSparseImageFormatProperties(Unwrap(physicalDevice), format, type, samples, usage, tiling, pNumProperties, pProperties);
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetPhysicalDeviceProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkPhysicalDeviceProperties* pProperties)
|
||||
@@ -103,3 +116,52 @@ VkResult WrappedVulkan::vkGetImageMemoryRequirements(
|
||||
{
|
||||
return ObjDisp(device)->GetImageMemoryRequirements(Unwrap(device), Unwrap(image), pMemoryRequirements);
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetImageSparseMemoryRequirements(
|
||||
VkDevice device,
|
||||
VkImage image,
|
||||
uint32_t* pNumRequirements,
|
||||
VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
|
||||
{
|
||||
return ObjDisp(device)->GetImageSparseMemoryRequirements(Unwrap(device), Unwrap(image), pNumRequirements, pSparseMemoryRequirements);
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetRenderAreaGranularity(
|
||||
VkDevice device,
|
||||
VkRenderPass renderPass,
|
||||
VkExtent2D* pGranularity)
|
||||
{
|
||||
return ObjDisp(device)->GetRenderAreaGranularity(Unwrap(device), Unwrap(renderPass), pGranularity);
|
||||
}
|
||||
|
||||
size_t WrappedVulkan::vkGetPipelineCacheSize(
|
||||
VkDevice device,
|
||||
VkPipelineCache pipelineCache)
|
||||
{
|
||||
// we don't want the application to use pipeline caches at all, and especially
|
||||
// don't want to return any data for future use.
|
||||
return 0;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetPipelineCacheData(
|
||||
VkDevice device,
|
||||
VkPipelineCache pipelineCache,
|
||||
void* pData)
|
||||
{
|
||||
// we don't want the application to use pipeline caches at all, and especially
|
||||
// don't want to return any data for future use.
|
||||
return VK_UNSUPPORTED;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkMergePipelineCaches(
|
||||
VkDevice device,
|
||||
VkPipelineCache destCache,
|
||||
uint32_t srcCacheCount,
|
||||
const VkPipelineCache* pSrcCaches)
|
||||
{
|
||||
// hopefully we'll never get here, because we don't ever return a valid pipeline
|
||||
// cache ourselves, our UUID should not match anyone's so the application should
|
||||
// not upload a pipeline cache from elsewhere. So there will be nothing to merge,
|
||||
// in theory.
|
||||
return VK_UNSUPPORTED;
|
||||
}
|
||||
@@ -374,6 +374,23 @@ VkResult WrappedVulkan::vkFlushMappedMemoryRanges(
|
||||
return ret;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkInvalidateMappedMemoryRanges(
|
||||
VkDevice device,
|
||||
uint32_t memRangeCount,
|
||||
const VkMappedMemoryRange* pMemRanges)
|
||||
{
|
||||
// VKTODOHIGH stub function
|
||||
return ObjDisp(device)->InvalidateMappedMemoryRanges(Unwrap(device), memRangeCount, pMemRanges);
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkGetDeviceMemoryCommitment(
|
||||
VkDevice device,
|
||||
VkDeviceMemory memory,
|
||||
VkDeviceSize* pCommittedMemoryInBytes)
|
||||
{
|
||||
return ObjDisp(device)->GetDeviceMemoryCommitment(Unwrap(device), Unwrap(memory), pCommittedMemoryInBytes);
|
||||
}
|
||||
|
||||
// Generic API object functions
|
||||
|
||||
bool WrappedVulkan::Serialise_vkBindBufferMemory(
|
||||
@@ -504,6 +521,72 @@ VkResult WrappedVulkan::vkBindImageMemory(
|
||||
return ObjDisp(device)->BindImageMemory(Unwrap(device), Unwrap(image), Unwrap(mem), memOffset);
|
||||
}
|
||||
|
||||
bool WrappedVulkan::Serialise_vkQueueBindSparseBufferMemory(
|
||||
Serialiser* localSerialiser,
|
||||
VkQueue queue,
|
||||
VkBuffer buffer,
|
||||
uint32_t numBindings,
|
||||
const VkSparseMemoryBindInfo* pBindInfo)
|
||||
{
|
||||
// VKTODOHIGH stub function
|
||||
return true;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkQueueBindSparseBufferMemory(
|
||||
VkQueue queue,
|
||||
VkBuffer buffer,
|
||||
uint32_t numBindings,
|
||||
const VkSparseMemoryBindInfo* pBindInfo)
|
||||
{
|
||||
// VKTODOHIGH stub function
|
||||
RDCWARN("Sparse memory operations are not yet implemented");
|
||||
return ObjDisp(queue)->QueueBindSparseBufferMemory(Unwrap(queue), Unwrap(buffer), numBindings, pBindInfo);
|
||||
}
|
||||
|
||||
bool WrappedVulkan::Serialise_vkQueueBindSparseImageOpaqueMemory(
|
||||
Serialiser* localSerialiser,
|
||||
VkQueue queue,
|
||||
VkImage image,
|
||||
uint32_t numBindings,
|
||||
const VkSparseMemoryBindInfo* pBindInfo)
|
||||
{
|
||||
// VKTODOHIGH stub function
|
||||
return true;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkQueueBindSparseImageOpaqueMemory(
|
||||
VkQueue queue,
|
||||
VkImage image,
|
||||
uint32_t numBindings,
|
||||
const VkSparseMemoryBindInfo* pBindInfo)
|
||||
{
|
||||
// VKTODOHIGH stub function
|
||||
RDCWARN("Sparse memory operations are not yet implemented");
|
||||
return ObjDisp(queue)->QueueBindSparseImageOpaqueMemory(Unwrap(queue), Unwrap(image), numBindings, pBindInfo);
|
||||
}
|
||||
|
||||
bool WrappedVulkan::Serialise_vkQueueBindSparseImageMemory(
|
||||
Serialiser* localSerialiser,
|
||||
VkQueue queue,
|
||||
VkImage image,
|
||||
uint32_t numBindings,
|
||||
const VkSparseImageMemoryBindInfo* pBindInfo)
|
||||
{
|
||||
// VKTODOHIGH stub function
|
||||
return true;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkQueueBindSparseImageMemory(
|
||||
VkQueue queue,
|
||||
VkImage image,
|
||||
uint32_t numBindings,
|
||||
const VkSparseImageMemoryBindInfo* pBindInfo)
|
||||
{
|
||||
// VKTODOHIGH stub function
|
||||
RDCWARN("Sparse memory operations are not yet implemented");
|
||||
return ObjDisp(queue)->QueueBindSparseImageMemory(Unwrap(queue), Unwrap(image), numBindings, pBindInfo);
|
||||
}
|
||||
|
||||
bool WrappedVulkan::Serialise_vkCreateBuffer(
|
||||
Serialiser* localSerialiser,
|
||||
VkDevice device,
|
||||
|
||||
@@ -424,12 +424,12 @@ VkResult WrappedVulkan::vkCreateGraphicsPipelines(
|
||||
VkResourceRecord *cacherecord = GetRecord(pipelineCache);
|
||||
record->AddParent(cacherecord);
|
||||
|
||||
VkResourceRecord *layoutrecord = GetRecord(pCreateInfos->layout);
|
||||
VkResourceRecord *layoutrecord = GetRecord(pCreateInfos[i].layout);
|
||||
record->AddParent(layoutrecord);
|
||||
|
||||
for(uint32_t i=0; i < pCreateInfos->stageCount; i++)
|
||||
for(uint32_t s=0; s < pCreateInfos[i].stageCount; s++)
|
||||
{
|
||||
VkResourceRecord *shaderrecord = GetRecord(pCreateInfos->pStages[i].shader);
|
||||
VkResourceRecord *shaderrecord = GetRecord(pCreateInfos[i].pStages[s].shader);
|
||||
record->AddParent(shaderrecord);
|
||||
}
|
||||
}
|
||||
@@ -442,3 +442,102 @@ VkResult WrappedVulkan::vkCreateGraphicsPipelines(
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool WrappedVulkan::Serialise_vkCreateComputePipelines(
|
||||
Serialiser* localSerialiser,
|
||||
VkDevice device,
|
||||
VkPipelineCache pipelineCache,
|
||||
uint32_t count,
|
||||
const VkComputePipelineCreateInfo* pCreateInfos,
|
||||
VkPipeline* pPipelines)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, devId, GetResID(device));
|
||||
SERIALISE_ELEMENT(ResourceId, cacheId, GetResID(pipelineCache));
|
||||
SERIALISE_ELEMENT(VkComputePipelineCreateInfo, info, *pCreateInfos);
|
||||
SERIALISE_ELEMENT(ResourceId, id, GetResID(*pPipelines));
|
||||
|
||||
if(m_State == READING)
|
||||
{
|
||||
VkPipeline pipe = VK_NULL_HANDLE;
|
||||
|
||||
// use original ID
|
||||
m_CreationInfo.m_Pipeline[id].Init(&info);
|
||||
|
||||
device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
|
||||
pipelineCache = GetResourceManager()->GetLiveHandle<VkPipelineCache>(cacheId);
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateComputePipelines(Unwrap(device), Unwrap(pipelineCache), 1, &info, &pipe);
|
||||
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: 0x%08x", ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), pipe);
|
||||
GetResourceManager()->AddLiveResource(id, pipe);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
VkResult WrappedVulkan::vkCreateComputePipelines(
|
||||
VkDevice device,
|
||||
VkPipelineCache pipelineCache,
|
||||
uint32_t count,
|
||||
const VkComputePipelineCreateInfo* pCreateInfos,
|
||||
VkPipeline* pPipelines)
|
||||
{
|
||||
VkComputePipelineCreateInfo *unwrapped = GetTempArray<VkComputePipelineCreateInfo>(count);
|
||||
|
||||
for(uint32_t i=0; i < count; i++)
|
||||
{
|
||||
unwrapped[i] = pCreateInfos[i];
|
||||
unwrapped[i].stage.shader = Unwrap(unwrapped[i].stage.shader);
|
||||
unwrapped[i].layout = Unwrap(unwrapped[i].layout);
|
||||
unwrapped[i].basePipelineHandle = Unwrap(unwrapped[i].basePipelineHandle);
|
||||
}
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateComputePipelines(Unwrap(device), Unwrap(pipelineCache), count, unwrapped, pPipelines);
|
||||
|
||||
if(ret == VK_SUCCESS)
|
||||
{
|
||||
for(uint32_t i=0; i < count; i++)
|
||||
{
|
||||
ResourceId id = GetResourceManager()->WrapResource(Unwrap(device), pPipelines[i]);
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
Chunk *chunk = NULL;
|
||||
|
||||
{
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(CREATE_COMPUTE_PIPE);
|
||||
Serialise_vkCreateComputePipelines(localSerialiser, device, pipelineCache, 1, &pCreateInfos[i], &pPipelines[i]);
|
||||
|
||||
chunk = scope.Get();
|
||||
}
|
||||
|
||||
VkResourceRecord *record = GetResourceManager()->AddResourceRecord(pPipelines[i]);
|
||||
record->AddChunk(chunk);
|
||||
|
||||
VkResourceRecord *cacherecord = GetRecord(pipelineCache);
|
||||
record->AddParent(cacherecord);
|
||||
|
||||
VkResourceRecord *layoutrecord = GetRecord(pCreateInfos[i].layout);
|
||||
record->AddParent(layoutrecord);
|
||||
|
||||
VkResourceRecord *shaderrecord = GetRecord(pCreateInfos[i].stage.shader);
|
||||
record->AddParent(shaderrecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, pPipelines[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
Reference in new issue
Block a user