Skip to content

Commit c09154b

Browse files
author
kevyuu
committed
Fix ray tracing pipeline creation, by not skipping null shader instead disallow it.
1 parent d79fe20 commit c09154b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

include/nbl/asset/IRayTracingPipeline.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,17 @@ class IRayTracingPipeline : public IPipeline<PipelineLayoutType>, public IRayTra
9595
if (!extra(info))
9696
return false;
9797
const auto stage = info.shader->getStage();
98-
if ((stage & ~ICPUShader::E_SHADER_STAGE::ESS_ALL_RAY_TRACING)!=0)
98+
if ((stage & ~ICPUShader::E_SHADER_STAGE::ESS_ALL_RAY_TRACING) != 0)
9999
return false;
100100
if (!std::has_single_bit<std::underlying_type_t<ICPUShader::E_SHADER_STAGE>>(stage))
101101
return false;
102102
}
103+
else
104+
{
105+
// every shader must not be null. use SIndex::Unused to represent unused shader.
106+
return false;
107+
}
108+
}
103109

104110
auto getShaderStage = [this](size_t index) -> ICPUShader::E_SHADER_STAGE
105111
{

src/nbl/video/CVulkanLogicalDevice.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,10 +1502,7 @@ void CVulkanLogicalDevice::createRayTracingPipelines_impl(
15021502
outCreateInfo->pStages = outShaderStage;
15031503
for (const auto& specInfo : info.shaders)
15041504
{
1505-
if (specInfo.shader)
1506-
{
1507-
*(outShaderStage++) = getVkShaderStageCreateInfoFrom(specInfo,outRequiredSubgroupSize,outSpecInfo,outSpecMapEntry,outSpecData);
1508-
}
1505+
*(outShaderStage++) = getVkShaderStageCreateInfoFrom(specInfo,outRequiredSubgroupSize,outSpecInfo,outSpecMapEntry,outSpecData);
15091506
}
15101507
outCreateInfo->stageCount = std::distance<decltype(outCreateInfo->pStages)>(outCreateInfo->pStages,outShaderStage);
15111508
assert(outCreateInfo->stageCount != 0);

0 commit comments

Comments
 (0)