vkd3d-shader/hlsl: Support SM1 relative addressing of uniforms, version 2.
1 unresolved thread
Basically !1389 (closed) but rebased, removing all the overlapping things with !1388 (merged), and relying on non-constant deref copy-prop.
Merge request reports
Activity
mentioned in merge request !1389 (closed)
added 5 commits
- fbb7a369 - tests: Test SM1 vertex shader uniform allocation on relative addressing.
- c5d61a41 - vkd3d-shader/d3dbc: Respect idx_count when writing registers.
- 58f9eaba - vkd3d-shader/hlsl: Support SM1 relative addressing.
- 0cf4b869 - vkd3d-shader/ir: Normalise MOVA and SM1 relative addressing.
- 2fc82696 - vkd3d-shader/hlsl: Allow non-constant deref propagation on SM1.
Toggle commit listadded 6 commits
- d439acd6 - tests/hlsl: Test vertex shader uniform indirect addressing.
- a1a34693 - tests/hlsl: Test SM1 vertex shader uniform allocation on indirect addressing.
- 3bab01c5 - vkd3d-shader/d3dbc: Respect "idx_count" when writing registers.
- 628c00bd - vkd3d-shader/hlsl: Implement indirect addressing for d3dbc target profiles.
- 456b8e79 - vkd3d-shader/ir: Normalise MOVA and d3dbc indirect addressing.
- 65a98f93 - vkd3d-shader/hlsl: Allow non-constant deref propagation on SM1.
Toggle commit list+static enum vkd3d_result vsir_program_normalize_addr(struct vsir_program *program, + struct vsir_transformation_context *ctx) +{ + struct vkd3d_shader_instruction *ins; + unsigned int tmp_idx = ~0u; + unsigned int i, k, r; + + for (i = 0; i < program->instructions.count; ++i) + { + ins = &program->instructions.elements[i]; + + if (ins->opcode == VKD3DSIH_MOVA) + { + if (tmp_idx == ~0u) + tmp_idx = program->temp_count++; + + ins->opcode = VKD3DSIH_FTOU; + vsir_register_init(&ins->dst[0].reg, VKD3DSPR_TEMP, VKD3D_DATA_UINT, 1); + ins->dst[0].reg.idx[0].offset = tmp_idx; + ins->dst[0].reg.dimension = VSIR_DIMENSION_VEC4; + }
That's not right; MOVA is supposed to round. (See also test_mova() in Wine's d3d9 tests.) We'll likely either want ROUND_NE here, or something similar to lower_round(). Note also that MOVA doesn't exist before vs_2_0, and MOV should be used instead. (And it doesn't round like MOVA.)
I had started to apply this before noticing that issue, and made some minor fixups; I've pushed those to this MR.
added 6 commits
- 50c19c17 - tests/hlsl: Test vertex shader uniform indirect addressing.
- c1717e2b - tests/hlsl: Test SM1 vertex shader uniform allocation on indirect addressing.
- d70b3289 - vkd3d-shader/d3dbc: Respect "idx_count" when writing registers.
- 1b74e7f2 - vkd3d-shader/hlsl: Implement relative addressing for d3dbc target profiles.
- 2b0eda94 - vkd3d-shader/ir: Normalise MOVA and d3dbc indirect addressing.
- e4fbb629 - vkd3d-shader/hlsl: Allow non-constant deref propagation on SM1.
Toggle commit listadded 6 commits
- 8be0ea50 - tests/hlsl: Test vertex shader uniform relative addressing.
- 4f93ca8e - tests/hlsl: Test SM1 vertex shader uniform allocation on relative addressing.
- 1927f62a - vkd3d-shader/d3dbc: Respect "idx_count" when writing registers.
- 45ee1950 - vkd3d-shader/hlsl: Implement relative addressing for d3dbc target profiles.
- e6851491 - vkd3d-shader/ir: Normalise MOVA and d3dbc relative addressing.
- 3d3dfa0d - vkd3d-shader/hlsl: Allow non-constant deref propagation on SM1.
Toggle commit listadded 31 commits
-
3d3dfa0d...20b76f87 - 25 commits from branch
wine:master
- b6ce1479 - tests/hlsl: Test vertex shader uniform indirect addressing.
- 2327f87e - tests/hlsl: Test SM1 vertex shader uniform allocation on indirect addressing.
- 0e0ed726 - vkd3d-shader/d3dbc: Respect "idx_count" when writing registers.
- fd02d69d - vkd3d-shader/hlsl: Implement indirect addressing for d3dbc target profiles.
- f65e6265 - vkd3d-shader/ir: Normalise MOVA and d3dbc indirect addressing.
- 3ead8d53 - vkd3d-shader/hlsl: Allow non-constant deref propagation on SM1.
Toggle commit list-
3d3dfa0d...20b76f87 - 25 commits from branch
Please register or sign in to reply