From 05f0f5603561daed2c134e13bc64649362759968 Mon Sep 17 00:00:00 2001 From: davli-nv Date: Wed, 20 Aug 2025 17:30:44 -0700 Subject: Implement SV_VulkanSamplePosition (#8236) -Adds semantic SV_VulkanSamplePosition that emits corresponding gl_SamplePosition and SpvBuiltinSamplePosition -Adds gl_SamplePosition property to glsl.meta.slang -Adds SPIRV and GLSL tests for the semantic and property -Plan is to later implement SV_SamplePosition that follows HLSL range of -0.5 to +0.5, and emits GetRenderTargetSamplePosition(SV_SampleIndex) which needs more complicated IR manipulation for HLSL and Metal Fixes #7906 --------- Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> --- source/slang/slang-parameter-binding.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-parameter-binding.cpp') diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp index 89e633857..4b91056fc 100644 --- a/source/slang/slang-parameter-binding.cpp +++ b/source/slang/slang-parameter-binding.cpp @@ -1821,11 +1821,12 @@ static RefPtr processSimpleEntryPointParameter( // We need to compute whether an entry point consumes // any sample-rate inputs, and along with explicitly // `sample`-qualified parameters, we also need to - // detect use of `SV_SampleIndex` as an input. + // detect use of `SV_SampleIndex` and + // `SV_VulkanSamplePosition` as an input. // if (state.directionMask & kEntryPointParameterDirection_Input) { - if (sn == "sv_sampleindex") + if (sn == "sv_sampleindex" || sn == "sv_vulkansampleposition") { state.isSampleRate = true; } -- cgit v1.2.3