Skip to content
Snippets Groups Projects

tests: Prepare for 1.x, part 1/many.

Merged Elizabeth Figura requested to merge zfigura/vkd3d:mr2 into master
3 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
9 9
10 10 [test]
11 11 draw quad
12 probe (0, 0) rgba (20.0, -10.0, 75.0, 0.33333333)
12 probe (0, 0) rgba (0.20, -0.10, 0.0075, 0.33333333) 1
13 13
14 14 [pixel shader]
15 15 float4 main() : SV_TARGET
16 16 {
17 float x = 5.0;
18 float y = 15.0;
17 float x = 0.05;
18 float y = 0.15;
19 19
20 return float4(x % y, +x, -x, y / x);
20 return float4(x % y, +x, -x, y % x);
  • Comment on lines -20 to +20

    Rather than removing the division entirely, couldn't we test for different behaviors for SM1.x and all the others? BTW, what's the expected behavior here? I suppose that (leaving y / x) the constant propagator puts a 3 there, and that 3 is clamped to 1. Does that clamping happen before writing to SM1 or when executing it? I.e., if having a constant outside [-1, 1] outright illegal in SM1, or is it legal, but then the constant is clamped at execution time?

  • Rather than removing the division entirely, couldn't we test for different behaviors for SM1.x and all the others?

    There will be many, many cases of this. I would rather test that sm1 constant propagation works as expected, and then, elsewhere, have a dedicated test showing that sm1 clamps. Which isn't really a shader test, rather it's more in the purview of Wine, because...

    BTW, what's the expected behavior here? I suppose that (leaving y / x) the constant propagator puts a 3 there, and that 3 is clamped to 1. Does that clamping happen before writing to SM1 or when executing it? I.e., if having a constant outside [-1, 1] outright illegal in SM1, or is it legal, but then the constant is clamped at execution time?

    It's done at runtime. The shader has the real constant in it.

  • Which isn't really a shader test, rather it's more in the purview of Wine, because [...] it's done at runtime. The shader has the real constant in it.

    Eh, never mind that, it is going to be the responsibility of vkd3d-shader as well; I wasn't thinking that through.

  • Please register or sign in to reply
  • Giovanni Mascellani
  • 3 3
    4 4 float4 main() : SV_TARGET
    5 5 {
    6 float x = a.x;
    6 float x = +a.x;
  • Giovanni Mascellani
  • 13 13 draw quad
    14 probe (0, 0) rgba (20.0, -10.0, 75.0, 0.33333333) 1
    14 probe (0, 0) rgba (0.20, -0.10, 0.0075, -0.15) 1
    15 15
    16 [pixel shader]
    16
    17 % 1.x has no division or modulo.
    18 [pixel shader notimpl(sm<2)]
    17 19 uniform float2 a;
    18 20
    19 21 float4 main() : SV_TARGET
    20 22 {
    21 23 float x = a.x;
    22 24 float y = a.y;
    23 return float4(x % y, +x, -x, y / x);
    25 return float4(x / y, -x / y, x / -y, -x / -y);
    • Comment on lines -23 to +25

      In general, if there's something additional to check on SM1.x it's fine to add other tests for it, but I don't think you should remove the tests that may be useful for all the other SMs.

    • They're not removed. We test modulo elsewhere; I moved the unary + test to the previous shader, and unary - is tested here and elsewhere.

    • Please register or sign in to reply
  • added 4 commits

    • b1bb7a92 - tests: Adjust arithmetic-int.shader_test to pass with 1.x.
    • 01244c14 - tests: Adjust array-parameters.shader_test to pass with 1.x.
    • c9e506fd - tests: Adjust array-size-expr.shader_test to pass with 1.x.
    • 8c89359c - tests: Adjust abs.shader_test to pass with 1.x.

    Compare with previous version

  • The test failures are fixed now.

  • Giovanni Mascellani approved this merge request

    approved this merge request

  • Henri Verbeet approved this merge request

    approved this merge request

  • Henri Verbeet added 86 commits

    added 86 commits

    • 8c89359c...5b2d62e5 - 79 commits from branch wine:master
    • 5f55f5ad - tests: Adjust angle-unit.shader_test to pass with 1.x.
    • 8b4f0f34 - tests: Adjust arithmetic-float.shader_test to pass with 1.x.
    • fb75c053 - tests: Adjust arithmetic-float-uniform.shader_test to pass with 1.x.
    • e40b1919 - tests: Adjust arithmetic-int.shader_test to pass with 1.x.
    • e5ec52d6 - tests: Adjust array-parameters.shader_test to pass with 1.x.
    • e805fe3e - tests: Adjust array-size-expr.shader_test to pass with 1.x.
    • 004a381d - tests: Adjust abs.shader_test to pass with 1.x.

    Compare with previous version

  • Please register or sign in to reply
    Loading