Remove acceleration structure host commands usage
This commit is contained in:
parent
0d732cc4a4
commit
94873f7eaf
5 changed files with 90 additions and 212 deletions
|
|
@ -125,19 +125,8 @@ public:
|
|||
accelerationStructureBuildRangeInfo.transformOffset = 0;
|
||||
std::vector<VkAccelerationStructureBuildRangeInfoKHR*> accelerationBuildStructureRangeInfos = { &accelerationStructureBuildRangeInfo };
|
||||
|
||||
if (accelerationStructureFeatures.accelerationStructureHostCommands)
|
||||
{
|
||||
// Implementation supports building acceleration structure building on host
|
||||
vkBuildAccelerationStructuresKHR(
|
||||
device,
|
||||
VK_NULL_HANDLE,
|
||||
1,
|
||||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Acceleration structure needs to be build on the device
|
||||
// Build the acceleration structure on the device via a one-time command buffer submission
|
||||
// Some implementations may support acceleration structure building on the host (VkPhysicalDeviceAccelerationStructureFeaturesKHR->accelerationStructureHostCommands), but we prefer device builds
|
||||
VkCommandBuffer commandBuffer = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
|
||||
vkCmdBuildAccelerationStructuresKHR(
|
||||
commandBuffer,
|
||||
|
|
@ -145,7 +134,6 @@ public:
|
|||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
vulkanDevice->flushCommandBuffer(commandBuffer, queue);
|
||||
}
|
||||
|
||||
deleteScratchBuffer(scratchBuffer);
|
||||
}
|
||||
|
|
@ -225,19 +213,8 @@ public:
|
|||
accelerationStructureBuildRangeInfo.transformOffset = 0;
|
||||
std::vector<VkAccelerationStructureBuildRangeInfoKHR*> accelerationBuildStructureRangeInfos = { &accelerationStructureBuildRangeInfo };
|
||||
|
||||
if (accelerationStructureFeatures.accelerationStructureHostCommands)
|
||||
{
|
||||
// Implementation supports building acceleration structure building on host
|
||||
vkBuildAccelerationStructuresKHR(
|
||||
device,
|
||||
VK_NULL_HANDLE,
|
||||
1,
|
||||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Acceleration structure needs to be build on the device
|
||||
// Build the acceleration structure on the device via a one-time command buffer submission
|
||||
// Some implementations may support acceleration structure building on the host (VkPhysicalDeviceAccelerationStructureFeaturesKHR->accelerationStructureHostCommands), but we prefer device builds
|
||||
VkCommandBuffer commandBuffer = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
|
||||
vkCmdBuildAccelerationStructuresKHR(
|
||||
commandBuffer,
|
||||
|
|
@ -245,7 +222,6 @@ public:
|
|||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
vulkanDevice->flushCommandBuffer(commandBuffer, queue);
|
||||
}
|
||||
|
||||
deleteScratchBuffer(scratchBuffer);
|
||||
instancesBuffer.destroy();
|
||||
|
|
|
|||
|
|
@ -373,19 +373,8 @@ public:
|
|||
accelerationStructureBuildRangeInfo.transformOffset = 0;
|
||||
std::vector<VkAccelerationStructureBuildRangeInfoKHR*> accelerationBuildStructureRangeInfos = { &accelerationStructureBuildRangeInfo };
|
||||
|
||||
if (accelerationStructureFeatures.accelerationStructureHostCommands)
|
||||
{
|
||||
// Implementation supports building acceleration structure building on host
|
||||
vkBuildAccelerationStructuresKHR(
|
||||
device,
|
||||
VK_NULL_HANDLE,
|
||||
1,
|
||||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Acceleration structure needs to be build on the device
|
||||
// Build the acceleration structure on the device via a one-time command buffer submission
|
||||
// Some implementations may support acceleration structure building on the host (VkPhysicalDeviceAccelerationStructureFeaturesKHR->accelerationStructureHostCommands), but we prefer device builds
|
||||
VkCommandBuffer commandBuffer = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
|
||||
vkCmdBuildAccelerationStructuresKHR(
|
||||
commandBuffer,
|
||||
|
|
@ -393,7 +382,6 @@ public:
|
|||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
vulkanDevice->flushCommandBuffer(commandBuffer, queue);
|
||||
}
|
||||
|
||||
VkAccelerationStructureDeviceAddressInfoKHR accelerationDeviceAddressInfo{};
|
||||
accelerationDeviceAddressInfo.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR;
|
||||
|
|
@ -492,19 +480,8 @@ public:
|
|||
accelerationStructureBuildRangeInfo.transformOffset = 0;
|
||||
std::vector<VkAccelerationStructureBuildRangeInfoKHR*> accelerationBuildStructureRangeInfos = { &accelerationStructureBuildRangeInfo };
|
||||
|
||||
if (accelerationStructureFeatures.accelerationStructureHostCommands)
|
||||
{
|
||||
// Implementation supports building acceleration structure building on host
|
||||
vkBuildAccelerationStructuresKHR(
|
||||
device,
|
||||
VK_NULL_HANDLE,
|
||||
1,
|
||||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Acceleration structure needs to be build on the device
|
||||
// Build the acceleration structure on the device via a one-time command buffer submission
|
||||
// Some implementations may support acceleration structure building on the host (VkPhysicalDeviceAccelerationStructureFeaturesKHR->accelerationStructureHostCommands), but we prefer device builds
|
||||
VkCommandBuffer commandBuffer = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
|
||||
vkCmdBuildAccelerationStructuresKHR(
|
||||
commandBuffer,
|
||||
|
|
@ -512,7 +489,6 @@ public:
|
|||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
vulkanDevice->flushCommandBuffer(commandBuffer, queue);
|
||||
}
|
||||
|
||||
VkAccelerationStructureDeviceAddressInfoKHR accelerationDeviceAddressInfo{};
|
||||
accelerationDeviceAddressInfo.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR;
|
||||
|
|
|
|||
|
|
@ -194,19 +194,8 @@ public:
|
|||
}
|
||||
std::vector<VkAccelerationStructureBuildRangeInfoKHR*> accelerationBuildStructureRangeInfos = { &accelerationStructureBuildRangeInfos[0], &accelerationStructureBuildRangeInfos[1], &accelerationStructureBuildRangeInfos[2] };
|
||||
|
||||
if (accelerationStructureFeatures.accelerationStructureHostCommands)
|
||||
{
|
||||
// Implementation supports building acceleration structure building on host
|
||||
vkBuildAccelerationStructuresKHR(
|
||||
device,
|
||||
VK_NULL_HANDLE,
|
||||
1,
|
||||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Acceleration structure needs to be build on the device
|
||||
// Build the acceleration structure on the device via a one-time command buffer submission
|
||||
// Some implementations may support acceleration structure building on the host (VkPhysicalDeviceAccelerationStructureFeaturesKHR->accelerationStructureHostCommands), but we prefer device builds
|
||||
VkCommandBuffer commandBuffer = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
|
||||
vkCmdBuildAccelerationStructuresKHR(
|
||||
commandBuffer,
|
||||
|
|
@ -214,7 +203,6 @@ public:
|
|||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
vulkanDevice->flushCommandBuffer(commandBuffer, queue);
|
||||
}
|
||||
|
||||
deleteScratchBuffer(scratchBuffer);
|
||||
}
|
||||
|
|
@ -294,19 +282,8 @@ public:
|
|||
accelerationStructureBuildRangeInfo.transformOffset = 0;
|
||||
std::vector<VkAccelerationStructureBuildRangeInfoKHR*> accelerationBuildStructureRangeInfos = { &accelerationStructureBuildRangeInfo };
|
||||
|
||||
if (accelerationStructureFeatures.accelerationStructureHostCommands)
|
||||
{
|
||||
// Implementation supports building acceleration structure building on host
|
||||
vkBuildAccelerationStructuresKHR(
|
||||
device,
|
||||
VK_NULL_HANDLE,
|
||||
1,
|
||||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Acceleration structure needs to be build on the device
|
||||
// Build the acceleration structure on the device via a one-time command buffer submission
|
||||
// Some implementations may support acceleration structure building on the host (VkPhysicalDeviceAccelerationStructureFeaturesKHR->accelerationStructureHostCommands), but we prefer device builds
|
||||
VkCommandBuffer commandBuffer = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
|
||||
vkCmdBuildAccelerationStructuresKHR(
|
||||
commandBuffer,
|
||||
|
|
@ -314,7 +291,6 @@ public:
|
|||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
vulkanDevice->flushCommandBuffer(commandBuffer, queue);
|
||||
}
|
||||
|
||||
deleteScratchBuffer(scratchBuffer);
|
||||
instancesBuffer.destroy();
|
||||
|
|
|
|||
|
|
@ -137,19 +137,8 @@ public:
|
|||
accelerationStructureBuildRangeInfo.transformOffset = 0;
|
||||
std::vector<VkAccelerationStructureBuildRangeInfoKHR*> accelerationBuildStructureRangeInfos = { &accelerationStructureBuildRangeInfo };
|
||||
|
||||
if (accelerationStructureFeatures.accelerationStructureHostCommands)
|
||||
{
|
||||
// Implementation supports building acceleration structure building on host
|
||||
vkBuildAccelerationStructuresKHR(
|
||||
device,
|
||||
VK_NULL_HANDLE,
|
||||
1,
|
||||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Acceleration structure needs to be build on the device
|
||||
// Build the acceleration structure on the device via a one-time command buffer submission
|
||||
// Some implementations may support acceleration structure building on the host (VkPhysicalDeviceAccelerationStructureFeaturesKHR->accelerationStructureHostCommands), but we prefer device builds
|
||||
VkCommandBuffer commandBuffer = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
|
||||
vkCmdBuildAccelerationStructuresKHR(
|
||||
commandBuffer,
|
||||
|
|
@ -157,7 +146,6 @@ public:
|
|||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
vulkanDevice->flushCommandBuffer(commandBuffer, queue);
|
||||
}
|
||||
|
||||
deleteScratchBuffer(scratchBuffer);
|
||||
}
|
||||
|
|
@ -237,19 +225,8 @@ public:
|
|||
accelerationStructureBuildRangeInfo.transformOffset = 0;
|
||||
std::vector<VkAccelerationStructureBuildRangeInfoKHR*> accelerationBuildStructureRangeInfos = { &accelerationStructureBuildRangeInfo };
|
||||
|
||||
if (accelerationStructureFeatures.accelerationStructureHostCommands)
|
||||
{
|
||||
// Implementation supports building acceleration structure building on host
|
||||
vkBuildAccelerationStructuresKHR(
|
||||
device,
|
||||
VK_NULL_HANDLE,
|
||||
1,
|
||||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Acceleration structure needs to be build on the device
|
||||
// Build the acceleration structure on the device via a one-time command buffer submission
|
||||
// Some implementations may support acceleration structure building on the host (VkPhysicalDeviceAccelerationStructureFeaturesKHR->accelerationStructureHostCommands), but we prefer device builds
|
||||
VkCommandBuffer commandBuffer = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
|
||||
vkCmdBuildAccelerationStructuresKHR(
|
||||
commandBuffer,
|
||||
|
|
@ -257,7 +234,6 @@ public:
|
|||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
vulkanDevice->flushCommandBuffer(commandBuffer, queue);
|
||||
}
|
||||
|
||||
deleteScratchBuffer(scratchBuffer);
|
||||
instancesBuffer.destroy();
|
||||
|
|
|
|||
|
|
@ -136,20 +136,8 @@ public:
|
|||
accelerationStructureBuildRangeInfo.transformOffset = 0;
|
||||
std::vector<VkAccelerationStructureBuildRangeInfoKHR*> accelerationBuildStructureRangeInfos = { &accelerationStructureBuildRangeInfo };
|
||||
|
||||
if (accelerationStructureFeatures.accelerationStructureHostCommands)
|
||||
{
|
||||
// Implementation supports building acceleration structure building on host
|
||||
// Implementation supports building acceleration structure building on host
|
||||
vkBuildAccelerationStructuresKHR(
|
||||
device,
|
||||
VK_NULL_HANDLE,
|
||||
1,
|
||||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Acceleration structure needs to be build on the device
|
||||
// Build the acceleration structure on the device via a one-time command buffer submission
|
||||
// Some implementations may support acceleration structure building on the host (VkPhysicalDeviceAccelerationStructureFeaturesKHR->accelerationStructureHostCommands), but we prefer device builds
|
||||
VkCommandBuffer commandBuffer = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
|
||||
vkCmdBuildAccelerationStructuresKHR(
|
||||
commandBuffer,
|
||||
|
|
@ -157,7 +145,6 @@ public:
|
|||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
vulkanDevice->flushCommandBuffer(commandBuffer, queue);
|
||||
}
|
||||
|
||||
deleteScratchBuffer(scratchBuffer);
|
||||
}
|
||||
|
|
@ -238,20 +225,8 @@ public:
|
|||
accelerationStructureBuildRangeInfo.transformOffset = 0;
|
||||
std::vector<VkAccelerationStructureBuildRangeInfoKHR*> accelerationBuildStructureRangeInfos = { &accelerationStructureBuildRangeInfo };
|
||||
|
||||
if (accelerationStructureFeatures.accelerationStructureHostCommands)
|
||||
{
|
||||
// Implementation supports building acceleration structure building on host
|
||||
// Implementation supports building acceleration structure building on host
|
||||
vkBuildAccelerationStructuresKHR(
|
||||
device,
|
||||
VK_NULL_HANDLE,
|
||||
1,
|
||||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Acceleration structure needs to be build on the device
|
||||
// Build the acceleration structure on the device via a one-time command buffer submission
|
||||
// Some implementations may support acceleration structure building on the host (VkPhysicalDeviceAccelerationStructureFeaturesKHR->accelerationStructureHostCommands), but we prefer device builds
|
||||
VkCommandBuffer commandBuffer = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
|
||||
vkCmdBuildAccelerationStructuresKHR(
|
||||
commandBuffer,
|
||||
|
|
@ -259,7 +234,6 @@ public:
|
|||
&accelerationBuildGeometryInfo,
|
||||
accelerationBuildStructureRangeInfos.data());
|
||||
vulkanDevice->flushCommandBuffer(commandBuffer, queue);
|
||||
}
|
||||
|
||||
deleteScratchBuffer(scratchBuffer);
|
||||
instancesBuffer.destroy();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue