Skip to content

Commit a03701f

Browse files
author
kevyuu
committed
Improve checking for shader stage
1 parent 3f0962c commit a03701f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

include/nbl/asset/IRayTracingPipeline.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
#include "nbl/asset/IPipeline.h"
66

77
#include <span>
8-
8+
#include <bit>
9+
#include <type_traits>
910

1011
namespace nbl::asset
1112
{
@@ -73,9 +74,9 @@ class IRayTracingPipeline : public IPipeline<PipelineLayoutType>, public IRayTra
7374
if (!extra(info))
7475
return false;
7576
const auto stage = info.shader->getStage();
76-
if (stage > ICPUShader::E_SHADER_STAGE::ESS_CALLABLE || stage < ICPUShader::E_SHADER_STAGE::ESS_RAYGEN)
77+
if ((stage & ~ICPUShader::E_SHADER_STAGE::ESS_ALL_RAY_TRACING)!=0)
7778
return false;
78-
if (stage == ICPUShader::E_SHADER_STAGE::ESS_RAYGEN && stagePresence.hasFlags(hlsl::ESS_RAYGEN))
79+
if (!std::has_single_bit<std::underlying_type_t<ICPUShader::E_SHADER_STAGE>>(stage))
7980
return false;
8081
stagePresence |= stage;
8182
}

0 commit comments

Comments
 (0)