[PATCH v14 0/1] MR189: tests: Add a test for arrays with an expression as the index.
See https://bugs.winehq.org/show_bug.cgi?id=54832 I'm starting to see this particular FIXME in quite a few games (Escape Goat 2, Murder Miners, and Little Racers STREET to name a few), and since I'm not sure how to fix this I figured I could at least provide a test for someone that knows more SM4 than me :P -- v14: tests: Add a test for arrays with an expression as the index. https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/189
From: Ethan Lee <flibitijibibo(a)gmail.com> Currently, the compiler requires that dereferences be HLSL_IR_CONSTANT, so that it can compute the offset at compile time. However, scenarios such as this test will produce a dereference with HLSL_IR_EXPR, which will generate an error. Passing this test in particular will require adding support for SM4 relative addressing, as well as support for non-constant indexing in general. Signed-off-by: Ethan Lee <flibitijibibo(a)gmail.com> --- Makefile.am | 1 + tests/array-index-expr.shader_test | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tests/array-index-expr.shader_test diff --git a/Makefile.am b/Makefile.am index 954b0ffd..92c6d079 100644 --- a/Makefile.am +++ b/Makefile.am @@ -50,6 +50,7 @@ vkd3d_shader_tests = \ tests/arithmetic-int.shader_test \ tests/arithmetic-int-uniform.shader_test \ tests/arithmetic-uint.shader_test \ + tests/array-index-expr.shader_test \ tests/array-parameters.shader_test \ tests/asfloat.shader_test \ tests/asuint.shader_test \ diff --git a/tests/array-index-expr.shader_test b/tests/array-index-expr.shader_test new file mode 100644 index 00000000..8dda0c99 --- /dev/null +++ b/tests/array-index-expr.shader_test @@ -0,0 +1,25 @@ +[pixel shader todo] +uniform float4 f[3]; +uniform float2 i; + +float4 main() : sv_target +{ + return f[i.x + i.y]; +} + +[test] +uniform 0 float4 1.0 2.0 3.0 4.0 +uniform 4 float4 5.0 6.0 7.0 8.0 +uniform 8 float4 9.0 10.0 11.0 12.0 +uniform 12 float4 0 0 0 0 +todo draw quad +todo probe all rgba (1.0, 2.0, 3.0, 4.0) +uniform 12 float4 1 0 0 0 +todo draw quad +todo probe all rgba (5.0, 6.0, 7.0, 8.0) +uniform 12 float4 0 1 0 0 +todo draw quad +todo probe all rgba (5.0, 6.0, 7.0, 8.0) +uniform 12 float4 1 1 0 0 +todo draw quad +todo probe all rgba (9.0, 10.0, 11.0, 12.0) -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/189
On Fri May 26 15:44:29 2023 +0000, Henri Verbeet wrote:
```diff +% https://bugs.winehq.org/show_bug.cgi?id=54832 ```
For what it's worth, I don't love putting URLs or bug tracker references in the source. They have an unfortunate tendency to be outlived by the source; it would be preferable to briefly summarise the actual issue in the comment. Did both of these, sort of: I removed the comment entirely, and then explained the purpose of the test in the commit message.
-- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/189#note_33955
This merge request was approved by Zebediah Figura. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/189
participants (3)
-
Ethan Lee -
Ethan Lee (@flibitijibibo) -
Zebediah Figura (@zfigura)