Skip to content

Commit

Permalink
Fix usage flags for buffers whose device addresses are queried
Browse files Browse the repository at this point in the history
  • Loading branch information
httpdigest committed Jul 24, 2024
1 parent e5ddcb9 commit 8e265ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,8 @@ private static AccelerationStructure createBottomLevelAccelerationStructure(

// Create a buffer that will hold the final BLAS
AllocationAndBuffer accelerationStructureBuffer = createBuffer(
VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR, buildSizesInfo.accelerationStructureSize(),
VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR |
VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR, buildSizesInfo.accelerationStructureSize(),
null, 256, null);

// Create a BLAS object (not currently built)
Expand Down
2 changes: 1 addition & 1 deletion src/org/lwjgl/demo/vulkan/raytracing/VoxelChunks.java
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ private static void createBottomLevelAccelerationStructures(List<Chunk> chunks)
// Create a scratch buffer for the BLAS build
AllocationAndBuffer scratchBuffer = createBuffer(
VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR |
VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, totalScratchBufferSize, null,
VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, totalScratchBufferSize, null,
deviceAndQueueFamilies.minAccelerationStructureScratchOffsetAlignment, null);

// Create the BLAS and fill in device addresses for the above two buffers with their offsets
Expand Down

0 comments on commit 8e265ef

Please sign in to comment.