Skip to content

Commit cc34962

Browse files
author
kevyuu
committed
Check that shaders is not empty
1 parent 9286a71 commit cc34962

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/nbl/video/CVulkanLogicalDevice.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,7 @@ void CVulkanLogicalDevice::createRayTracingPipelines_impl(
14991499
}
15001500
}
15011501
outCreateInfo->stageCount = std::distance<decltype(outCreateInfo->pStages)>(outCreateInfo->pStages,outShaderStage);
1502+
assert(outCreateInfo->stageCount != 0);
15021503

15031504
const auto& shaderGroups = info.shaderGroups;
15041505
outCreateInfo->pGroups = outShaderGroup;

src/nbl/video/ILogicalDevice.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,8 +974,13 @@ bool ILogicalDevice::createRayTracingPipelines(IGPUPipelineCache* const pipeline
974974
{
975975
if (param.cached.maxRecursionDepth > limits.maxRayRecursionDepth)
976976
{
977-
NBL_LOG_ERROR("Invalid maxRecursionDepth. maxRecursionDepth(%u) exceed the limits(%u)", param.cached.maxRecursionDepth, limits.maxRayRecursionDepth);
978-
return false;
977+
NBL_LOG_ERROR("Invalid maxRecursionDepth. maxRecursionDepth(%u) exceed the limits(%u)", param.cached.maxRecursionDepth, limits.maxRayRecursionDepth);
978+
return false;
979+
}
980+
if (param.getShaders().empty())
981+
{
982+
NBL_LOG_ERROR("Pipeline must have at least one shader.");
983+
return false;
979984
}
980985
}
981986

0 commit comments

Comments
 (0)