Skip to content

Commit ee1af5d

Browse files
author
kevyuu
committed
Improve some flags naming
1 parent 93405e9 commit ee1af5d

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

include/nbl/asset/IPipeline.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ class IPipeline
7171
//CREATE_LIBRARY = 1<<11,
7272

7373
// Ray Tracing Pipelines only
74-
SKIP_TRIANGLES_BIT = 1<<12,
75-
SKIP_AABBS_BIT = 1<<13,
74+
SKIP_TRIANGLES = 1<<12,
75+
SKIP_AABBS = 1<<13,
7676
//RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR = 1<<14,
7777
//RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR = 1<<15,
7878
//RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR = 1<<16,

include/nbl/video/IGPURayTracingPipeline.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ class IGPURayTracingPipeline : public IBackendObject, public asset::IRayTracingP
3737
EARLY_RETURN_ON_FAILURE = base_flag(EARLY_RETURN_ON_FAILURE),
3838
LINK_TIME_OPTIMIZATION = base_flag(LINK_TIME_OPTIMIZATION),
3939
RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT = base_flag(RETAIN_LINK_TIME_OPTIMIZATION_INFO),
40-
SKIP_TRIANGLES_BIT_KHR = base_flag(SKIP_TRIANGLES_BIT),
41-
SKIP_AABBS_BIT_KHR = base_flag(SKIP_AABBS_BIT),
42-
NO_NULL_ANY_HIT_SHADERS_BIT_KHR = 1<<14,
43-
NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR = 1<<15,
44-
NO_NULL_MISS_SHADERS_BIT_KHR = 1<<16,
45-
NO_NULL_INTERSECTION_SHADERS_BIT_KHR = 1<<17,
40+
SKIP_TRIANGLES = base_flag(SKIP_TRIANGLES),
41+
SKIP_AABBS = base_flag(SKIP_AABBS),
42+
NO_NULL_ANY_HIT_SHADERS = 1<<14,
43+
NO_NULL_CLOSEST_HIT_SHADERS = 1<<15,
44+
NO_NULL_MISS_SHADERS = 1<<16,
45+
NO_NULL_INTERSECTION_SHADERS = 1<<17,
4646
ALLOW_MOTION_BIT_NV = 1<<20,
4747
};
4848
#undef base_flag

src/nbl/video/IGPUCommandBuffer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -699,17 +699,17 @@ bool IGPUCommandBuffer::invalidShaderGroups(
699699
// https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysKHR.html#VUID-vkCmdTraceRaysKHR-flags-03697
700700
// https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysKHR.html#VUID-vkCmdTraceRaysKHR-flags-03512
701701
const auto shouldHaveHitGroup = flags &
702-
(PipelineFlags(PipelineFlag::RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR) |
703-
PipelineFlag::RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR |
704-
PipelineFlag::RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR);
702+
(PipelineFlags(PipelineFlag::NO_NULL_ANY_HIT_SHADERS) |
703+
PipelineFlag::NO_NULL_CLOSEST_HIT_SHADERS |
704+
PipelineFlag::NO_NULL_INTERSECTION_SHADERS);
705705
if (shouldHaveHitGroup && !hitGroupsRange.buffer)
706706
{
707707
NBL_LOG_ERROR("bound pipeline indicates that traceRays command should have hit group, but hitGroupsRange.buffer is null!");
708708
return true;
709709
}
710710

711711
// https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdTraceRaysKHR.html#VUID-vkCmdTraceRaysKHR-flags-03511
712-
const auto shouldHaveMissGroup = flags & PipelineFlag::RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR;
712+
const auto shouldHaveMissGroup = flags & PipelineFlag::NO_NULL_MISS_SHADERS;
713713
if (shouldHaveMissGroup && !missGroupsRange.buffer)
714714
{
715715
NBL_LOG_ERROR("bound pipeline indicates that traceRays command should have hit group, but hitGroupsRange.buffer is null!");
@@ -1899,7 +1899,7 @@ bool IGPUCommandBuffer::setRayTracingPipelineStackSize(uint32_t pipelineStackSiz
18991899
{
19001900
if (!checkStateBeforeRecording(queue_flags_t::COMPUTE_BIT,RENDERPASS_SCOPE::OUTSIDE))
19011901
return false;
1902-
if (m_boundRayTracingPipeline->getCachedCreationParams().dynamicStackSize)
1902+
if (m_boundRayTracingPipeline != nullptr && m_boundRayTracingPipeline->getCachedCreationParams().dynamicStackSize)
19031903
{
19041904
NBL_LOG_ERROR("Cannot set dynamic state when state is not mark as dynamic on bound pipeline!");
19051905
}

0 commit comments

Comments
 (0)