Skip to content

Commit

Permalink
Fixed a Vulkan validation warning when using a Raytracing Acceleratio…
Browse files Browse the repository at this point in the history
…n structure in an unbounded array (o3de#15475)

Signed-off-by: Martin Sattlecker <[email protected]>
  • Loading branch information
msat-huawei authored Mar 30, 2023
1 parent 508cef4 commit b3ef3a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ namespace AZ
// acceleration structure descriptor is added as the pNext in the VkWriteDescriptorSet
VkWriteDescriptorSetAccelerationStructureKHR writeAccelerationStructure = {};
writeAccelerationStructure.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR;
writeAccelerationStructure.accelerationStructureCount = 1;
writeAccelerationStructure.accelerationStructureCount = interval.m_max - interval.m_min;
writeAccelerationStructure.pAccelerationStructures = updateData.m_accelerationStructures.data() + interval.m_min;
writeAccelerationStructureDescs.push_back(AZStd::move(writeAccelerationStructure));

Expand Down Expand Up @@ -416,6 +416,7 @@ namespace AZ
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR:
unboundedArraySize = aznumeric_cast<uint32_t>(updateData.m_bufferViewsInfo.size());
break;
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
Expand Down
3 changes: 3 additions & 0 deletions Gems/Atom/RHI/Vulkan/Code/Source/RHI/DescriptorSetLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ namespace AZ
case RHI::ShaderInputBufferType::Typed:
vbinding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER;
break;
case RHI::ShaderInputBufferType::AccelerationStructure:
vbinding.descriptorType = VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR;
break;
default:
vbinding.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
break;
Expand Down

0 comments on commit b3ef3a9

Please sign in to comment.