diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index c6108641..8bb9ec24 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -2814,6 +2814,7 @@ bool sysval_semantic_from_hlsl(enum vkd3d_shader_sysval_semantic *semantic, {"sv_isfrontface", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_IS_FRONT_FACE}, {"sv_rendertargetarrayindex", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_RENDER_TARGET_ARRAY_INDEX}, {"sv_viewportarrayindex", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_VIEWPORT_ARRAY_INDEX}, + {"sv_sampleindex", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_SAMPLE_INDEX}, {"color", true, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_TARGET}, {"depth", true, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_DEPTH}, @@ -4461,6 +4462,7 @@ static void write_sm4_dcl_semantic(const struct tpf_writer *tpf, const struct hl case VKD3D_SHADER_SV_INSTANCE_ID: case VKD3D_SHADER_SV_PRIMITIVE_ID: case VKD3D_SHADER_SV_VERTEX_ID: + case VKD3D_SHADER_SV_SAMPLE_INDEX: instr.opcode = (profile->type == VKD3D_SHADER_TYPE_PIXEL) ? VKD3D_SM4_OP_DCL_INPUT_PS_SGV : VKD3D_SM4_OP_DCL_INPUT_SGV; break; diff --git a/tests/hlsl_d3d12.c b/tests/hlsl_d3d12.c index 43b1f0e9..a655e467 100644 --- a/tests/hlsl_d3d12.c +++ b/tests/hlsl_d3d12.c @@ -2062,7 +2062,8 @@ static void test_signature_reflection(void) " out uint c : sv_coverage,\n" " in float4 d : position,\n" " in float4 e : sv_position,\n" - " out float f : sv_depth)\n" + " out float f : sv_depth,\n" + " in uint g : sv_sampleindex)\n" "{\n" " b = d;\n" " c = 0;\n" @@ -2071,9 +2072,10 @@ static void test_signature_reflection(void) static const D3D12_SIGNATURE_PARAMETER_DESC ps1_inputs[] = { - {"apple", 0, 0, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x3}, - {"position", 0, 1, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0xf}, - {"sv_position", 0, 2, D3D_NAME_POSITION, D3D_REGISTER_COMPONENT_FLOAT32, 0xf}, + {"apple", 0, 0, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x3}, + {"position", 0, 1, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0xf}, + {"sv_position", 0, 2, D3D_NAME_POSITION, D3D_REGISTER_COMPONENT_FLOAT32, 0xf}, + {"sv_sampleindex", 0, 3, D3D_NAME_SAMPLE_INDEX, D3D_REGISTER_COMPONENT_UINT32, 0x1}, }; static const D3D12_SIGNATURE_PARAMETER_DESC ps1_outputs[] =