From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- libs/vkd3d-shader/spirv.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 98d7a9313f0e..63a1a0e0b7c2 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2958,6 +2958,14 @@ static uint32_t sv_front_face_fixup(struct vkd3d_dxbc_compiler *compiler, return vkd3d_dxbc_compiler_emit_bool_to_int(compiler, 1, front_facing_id); }
+static uint32_t sv_sample_index(struct vkd3d_dxbc_compiler *compiler, uint32_t id) +{ + struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; + + vkd3d_spirv_enable_capability(builder, SpvCapabilitySampleRateShading); + return id; +} + struct vkd3d_spirv_builtin { enum vkd3d_component_type component_type; @@ -2986,6 +2994,8 @@ vkd3d_system_value_builtins[] =
{VKD3D_SIV_IS_FRONT_FACE, {VKD3D_TYPE_BOOL, 1, SpvBuiltInFrontFacing, sv_front_face_fixup}},
+ {VKD3D_SIV_SAMPLE_INDEX, {VKD3D_TYPE_UINT, 1, SpvBuiltInSampleId, sv_sample_index}}, + {VKD3D_SIV_CLIP_DISTANCE, {VKD3D_TYPE_FLOAT, 1, SpvBuiltInClipDistance, NULL, true}}, {VKD3D_SIV_CULL_DISTANCE, {VKD3D_TYPE_FLOAT, 1, SpvBuiltInCullDistance, NULL, true}}, };