Skip to content

Commit

Permalink
Disable clustered RT by default
Browse files Browse the repository at this point in the history
Since clustered RT currently runs slower due to suboptimal cluster
splits, require a specific env var to enable it manually.

Also fix #ifdef from prior commit.
  • Loading branch information
zeux committed Feb 15, 2025
1 parent 974f0b0 commit 0e74030
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/niagara.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ int main(int argc, const char** argv)
Buffer tlasInstanceBuffer = {};
if (raytracingSupported)
{
if (clusterrtSupported)
if (clusterrtSupported && getenv("CLRT") && atoi(getenv("CLRT")))
{
Buffer vxb = {};
createBuffer(vxb, device, memoryProperties, geometry.meshletvtx0.size() * sizeof(uint16_t), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | raytracingBufferFlags, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
Expand Down
2 changes: 1 addition & 1 deletion src/scenert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void compactBLAS(VkDevice device, std::vector<VkAccelerationStructureKHR>& blas,

void buildCBLAS(VkDevice device, const std::vector<Mesh>& meshes, const std::vector<Meshlet>& meshlets, const Buffer& vxb, const Buffer& mdb, std::vector<VkAccelerationStructureKHR>& blas, Buffer& blasBuffer, VkCommandPool commandPool, VkCommandBuffer commandBuffer, VkQueue queue, const VkPhysicalDeviceMemoryProperties& memoryProperties)
{
#ifdef VK_NV_acceleration_structure
#ifdef VK_NV_cluster_acceleration_structure
const size_t kAlignment = 256; // required by spec for acceleration structures
const size_t kClusterAlignment = 128; // required by spec for cluster acceleration structures

Expand Down

0 comments on commit 0e74030

Please sign in to comment.