From: Francisco Casas fcasas@codeweavers.com
This codepath path is currently triggered when transpiling d3dbc shaders that use vPos (or other of these special registers).
While vPos gets added to the input signature and gets assigned an INPUT register, the registers in the shader instructions are still of VKD3DSPR_MISCTYPE type and are not propperly mapped yet. This gives invalid results.
Some SM1 tests must be set back to "todo" but they only work because, by coincidence, we are assigning vPos the input register with index 0. Propper mapping of these registers is still required. --- libs/vkd3d-shader/spirv.c | 5 +++-- tests/hlsl/ddxddy.shader_test | 6 +++--- tests/hlsl/fwidth.shader_test | 12 ++++++------ 3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index e23ba5c41..3cee0685d 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -3396,7 +3396,7 @@ struct vkd3d_shader_register_info bool is_aggregate; };
-static bool spirv_compiler_get_register_info(const struct spirv_compiler *compiler, +static bool spirv_compiler_get_register_info(struct spirv_compiler *compiler, const struct vkd3d_shader_register *reg, struct vkd3d_shader_register_info *register_info) { struct vkd3d_symbol reg_symbol, *symbol; @@ -3422,7 +3422,8 @@ static bool spirv_compiler_get_register_info(const struct spirv_compiler *compil vkd3d_symbol_make_register(®_symbol, reg); if (!(entry = rb_get(&compiler->symbol_table, ®_symbol))) { - FIXME("Unrecognized register (%s).\n", debug_vkd3d_symbol(®_symbol)); + spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_INVALID_REGISTER_TYPE, + "Unrecognized register (%s).\n", debug_vkd3d_symbol(®_symbol)); memset(register_info, 0, sizeof(*register_info)); return false; } diff --git a/tests/hlsl/ddxddy.shader_test b/tests/hlsl/ddxddy.shader_test index 72925b975..f61b560c9 100644 --- a/tests/hlsl/ddxddy.shader_test +++ b/tests/hlsl/ddxddy.shader_test @@ -8,8 +8,8 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad -todo(sm<4) probe all rgba (1.0, 1.0, 0.0, 0.0) +todo(sm<4) draw quad +probe all rgba (1.0, 1.0, 0.0, 0.0)
[pixel shader] @@ -29,7 +29,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm<4) draw quad todo(sm<4) probe (10, 10) rgba (-16.0, -5.0, 3.0, 0.0) todo(sm<4) probe (11, 10) rgba (-21.0, -5.0, 3.0, 0.0) todo(sm<4) probe (10, 11) rgba (-13.0, -5.0, 3.0, 0.0) diff --git a/tests/hlsl/fwidth.shader_test b/tests/hlsl/fwidth.shader_test index 2a9f3f87d..99fb1421d 100644 --- a/tests/hlsl/fwidth.shader_test +++ b/tests/hlsl/fwidth.shader_test @@ -18,9 +18,9 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad -todo(sm<4) probe (10, 10) rgba (8.0, 8.0, 8.0, 8.0) -todo(sm<4) probe (11, 10) rgba (8.0, 8.0, 8.0, 8.0) -todo(sm<4) probe (12, 10) rgba (10.0, 10.0, 10.0, 10.0) -todo(sm<4) probe (16, 16) rgba (12.0, 12.0, 12.0, 12.0) -todo(sm<4) probe (150, 150) rgba (92.0, 92.0, 92.0, 92.0) +todo(sm<4) draw quad +probe (10, 10) rgba (8.0, 8.0, 8.0, 8.0) +probe (11, 10) rgba (8.0, 8.0, 8.0, 8.0) +probe (12, 10) rgba (10.0, 10.0, 10.0, 10.0) +probe (16, 16) rgba (12.0, 12.0, 12.0, 12.0) +probe (150, 150) rgba (92.0, 92.0, 92.0, 92.0)