From 86232f95f181ed1dd206eb2d6911f143f98f9fac Mon Sep 17 00:00:00 2001 From: httpdigest Date: Wed, 24 Jul 2024 15:37:24 +0200 Subject: [PATCH] Fix usage flags for buffers whose device addresses are queried --- src/org/lwjgl/demo/vulkan/raytracing/SdfBricks.java | 3 ++- src/org/lwjgl/demo/vulkan/raytracing/SimpleSphere.java | 3 ++- src/org/lwjgl/demo/vulkan/raytracing/SimpleTriangle.java | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/org/lwjgl/demo/vulkan/raytracing/SdfBricks.java b/src/org/lwjgl/demo/vulkan/raytracing/SdfBricks.java index c8773ff6..f90e8c92 100644 --- a/src/org/lwjgl/demo/vulkan/raytracing/SdfBricks.java +++ b/src/org/lwjgl/demo/vulkan/raytracing/SdfBricks.java @@ -1106,7 +1106,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) diff --git a/src/org/lwjgl/demo/vulkan/raytracing/SimpleSphere.java b/src/org/lwjgl/demo/vulkan/raytracing/SimpleSphere.java index f2bd4a82..413837ea 100644 --- a/src/org/lwjgl/demo/vulkan/raytracing/SimpleSphere.java +++ b/src/org/lwjgl/demo/vulkan/raytracing/SimpleSphere.java @@ -1018,7 +1018,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) diff --git a/src/org/lwjgl/demo/vulkan/raytracing/SimpleTriangle.java b/src/org/lwjgl/demo/vulkan/raytracing/SimpleTriangle.java index fef09b14..03cca47d 100644 --- a/src/org/lwjgl/demo/vulkan/raytracing/SimpleTriangle.java +++ b/src/org/lwjgl/demo/vulkan/raytracing/SimpleTriangle.java @@ -1033,7 +1033,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)