Skip to content

Commit 1ed9fd7

Browse files
author
kevyuu
committed
Add Motion Blur validation.
1 parent f22c4c0 commit 1ed9fd7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

include/nbl/video/IGPURayTracingPipeline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class IGPURayTracingPipeline : public IBackendObject, public asset::IRayTracingP
4343
NO_NULL_CLOSEST_HIT_SHADERS = 1<<15,
4444
NO_NULL_MISS_SHADERS = 1<<16,
4545
NO_NULL_INTERSECTION_SHADERS = 1<<17,
46-
ALLOW_MOTION_BIT_NV = 1<<20,
46+
ALLOW_MOTION = 1<<20,
4747
};
4848
#undef base_flag
4949

src/nbl/video/IGPUCommandBuffer.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1989,12 +1989,21 @@ bool IGPUCommandBuffer::traceRaysIndirect(const asset::SBufferBinding<const IGPU
19891989
return false;
19901990
}
19911991

1992+
const auto& features = getOriginDevice()->getEnabledFeatures();
1993+
1994+
// https://docs.vulkan.org/spec/latest/chapters/raytracing.html#VUID-vkCmdTraceRaysIndirect2KHR-rayTracingMotionBlurPipelineTraceRaysIndirect-04951
1995+
if (m_boundRayTracingPipeline->getCreationFlags() & IGPURayTracingPipeline::SCreationParams::FLAGS::ALLOW_MOTION && !features.rayTracingMotionBlurPipelineTraceRaysIndirect)
1996+
{
1997+
NBL_LOG_ERROR("If the bound ray tracing pipeline is created with ALLOW_MOTION, rayTracingMotionBlurPipelineTraceRaysIndirect feature must be enabled!");
1998+
return false;
1999+
}
2000+
19922001
// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysIndirectKHR.html#VUID-vkCmdTraceRaysIndirectKHR-indirectDeviceAddress-03634
19932002
// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysIndirectKHR.html#VUID-vkCmdTraceRaysIndirectKHR-indirectDeviceAddress-03633
19942003
if (invalidBufferBinding(indirectBinding, 4u,IGPUBuffer::EUF_INDIRECT_BUFFER_BIT | IGPUBuffer::EUF_SHADER_DEVICE_ADDRESS_BIT))
19952004
return false;
19962005

1997-
https://docs.vulkan.org/spec/latest/chapters/raytracing.html#VUID-vkCmdTraceRaysIndirect2KHR-indirectDeviceAddress-03633
2006+
// https://docs.vulkan.org/spec/latest/chapters/raytracing.html#VUID-vkCmdTraceRaysIndirect2KHR-indirectDeviceAddress-03633
19982007
if (indirectBinding.offset + sizeof(hlsl::TraceRaysIndirectCommand_t) > indirectBinding.buffer->getSize())
19992008
{
20002009
NBL_LOG_ERROR("buffer size - offset must be at least the size of TraceRaysIndirectCommand_t!");

0 commit comments

Comments
 (0)