File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ class IRayTracingPipelineBase : public virtual core::IReferenceCounted
45
45
46
46
struct SCachedCreationParams final
47
47
{
48
- uint32_t maxRecursionDepth;
48
+ uint32_t maxRecursionDepth : 6 = 0 ;
49
+ uint32_t dynamicStackSize : 1 = false ;
49
50
};
50
51
};
51
52
Original file line number Diff line number Diff line change @@ -1436,6 +1436,15 @@ void CVulkanLogicalDevice::createRayTracingPipelines_impl(
1436
1436
using SGeneralShaderGroup = asset::IRayTracingPipelineBase::SGeneralShaderGroup;
1437
1437
using SHitShaderGroup = asset::IRayTracingPipelineBase::SHitShaderGroup;
1438
1438
1439
+ const auto dynamicStates = std::array{ VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR };
1440
+ const VkPipelineDynamicStateCreateInfo vk_dynamicStateCreateInfo = {
1441
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
1442
+ .pNext = nullptr ,
1443
+ .flags = 0u ,
1444
+ .dynamicStateCount = dynamicStates.size (),
1445
+ .pDynamicStates = dynamicStates.data (),
1446
+ };
1447
+
1439
1448
const VkPipelineCache vk_pipelineCache = pipelineCache ? static_cast <const CVulkanPipelineCache*>(pipelineCache)->getInternalObject ():VK_NULL_HANDLE;
1440
1449
1441
1450
size_t maxShaderStages = 0 ;
@@ -1512,6 +1521,10 @@ void CVulkanLogicalDevice::createRayTracingPipelines_impl(
1512
1521
*(outShaderGroup++) = getGeneralVkRayTracingShaderGroupCreateInfo (shaderGroup);
1513
1522
outCreateInfo->groupCount = 1 + shaderGroups.hits .size () + shaderGroups.misses .size () + shaderGroups.callables .size ();
1514
1523
outCreateInfo->maxPipelineRayRecursionDepth = info.cached .maxRecursionDepth ;
1524
+ if (info.cached .dynamicStackSize )
1525
+ {
1526
+ outCreateInfo->pDynamicState = &vk_dynamicStateCreateInfo;
1527
+ }
1515
1528
}
1516
1529
1517
1530
auto vk_pipelines = reinterpret_cast <VkPipeline*>(output);
You can’t perform that action at this time.
0 commit comments