Skip to content

Commit f22c4c0

Browse files
author
kevyuu
committed
Make the indirect buffer size check clearer.
1 parent 240cfa1 commit f22c4c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/nbl/video/IGPUCommandBuffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,7 @@ bool IGPUCommandBuffer::traceRaysIndirect(const asset::SBufferBinding<const IGPU
19951995
return false;
19961996

19971997
https://docs.vulkan.org/spec/latest/chapters/raytracing.html#VUID-vkCmdTraceRaysIndirect2KHR-indirectDeviceAddress-03633
1998-
if (sizeof(hlsl::TraceRaysIndirectCommand_t) + indirectBinding.offset > indirectBinding.buffer->getSize())
1998+
if (indirectBinding.offset + sizeof(hlsl::TraceRaysIndirectCommand_t) > indirectBinding.buffer->getSize())
19991999
{
20002000
NBL_LOG_ERROR("buffer size - offset must be at least the size of TraceRaysIndirectCommand_t!");
20012001
return false;

0 commit comments

Comments
 (0)