Use proper type for scratch buffer memory requirements

Explicitly set type for top and botom level AS memory requirements
Fixes #622
This commit is contained in:
Sascha Willems 2019-11-09 10:47:31 +01:00
parent 40c5e64faf
commit f544895708
3 changed files with 9 additions and 3 deletions

View file

@ -183,6 +183,7 @@ public:
VkAccelerationStructureMemoryRequirementsInfoNV memoryRequirementsInfo{};
memoryRequirementsInfo.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV;
memoryRequirementsInfo.type = VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV;
memoryRequirementsInfo.accelerationStructure = bottomLevelAS.accelerationStructure;
VkMemoryRequirements2 memoryRequirements2{};
@ -220,6 +221,7 @@ public:
VkAccelerationStructureMemoryRequirementsInfoNV memoryRequirementsInfo{};
memoryRequirementsInfo.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV;
memoryRequirementsInfo.type = VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV;
memoryRequirementsInfo.accelerationStructure = topLevelAS.accelerationStructure;
VkMemoryRequirements2 memoryRequirements2{};
@ -336,7 +338,7 @@ public:
// Acceleration structure build requires some scratch space to store temporary information
VkAccelerationStructureMemoryRequirementsInfoNV memoryRequirementsInfo{};
memoryRequirementsInfo.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV;
memoryRequirementsInfo.type = VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV;
memoryRequirementsInfo.type = VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV;
VkMemoryRequirements2 memReqBottomLevelAS;
memoryRequirementsInfo.accelerationStructure = bottomLevelAS.accelerationStructure;