Skip to content
Snippets Groups Projects

vkd3d-shader/hlsl: Add ceil() function.

Merged Nikolay Sivov requested to merge nsivov/vkd3d:ceil into master
1 unresolved thread

Signed-off-by: Nikolay Sivov nsivov@codeweavers.com

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
37 todo draw quad
38 todo probe all rgba (7.0, 8.0, 0.0, 4.0) 4
39
40 [require]
41 shader model >= 4.0
42
43 [pixel shader todo]
44 uniform int4 u;
45
46 float4 main() : sv_target
47 {
48 float a = ceil(u.r);
49 int2 b = ceil(u.gb);
50 float4 res = float4(b, a, u.a);
51 return ceil(res);
52 }
  • Comment on lines +40 to +52

    This test actually compiles in ps_2_0 and ps_3_0.

  • Author Developer

    It does compile, but results are broken. That's what I get on Windows:

    shader_runner:683: Section [test], line 51: Test failed: Got {8.40779079e-045, 9.80908925e-045, -1.#QNAN000e+000, 4.20389539e-045}, expected {6.00000000e+000, 7.00000000e+000, -1.00000000e+000, 3.00000000e+000} at (0, 0).

    That happens because of the lack of itof conversion on SM3. So ints we set are returned as is, after ceil() is optimized away for integers.

  • I see. So the probe part may be deserving of a todo(sm<4). I made patches for that on the second part of !418 (closed), but I think that for now it is okay to leave the requirement.

  • Oh no, you are right, compiling with the native compiler and running on Windows we get those broken results, so it is not a problem of the compiler itself.

  • Repeating what we concluded via chat. The reason this test is giving broken results is that, even if u is int4, the SM1 backend expects to receive it formatted as an IEEE Standard 754 float, so the shader runner should pass it formatted that way.

  • Please register or sign in to reply
  • I am ready to approve after my sole comment is addressed.

  • Nikolay Sivov added 21 commits

    added 21 commits

    • 3e4ef525...a4ed06bc - 13 commits from branch wine:master
    • 78d2d8a3 - tests: Add some tests for ceil().
    • b7c0b711 - vkd3d-shader/hlsl: Parse ceil() function.
    • fc55f176 - vkd3d-shader/tpf: Add support for ceil().
    • 523b4aa0 - vkd3d-shader: Add support for ceil() on SM1-3.
    • e3b23590 - vkd3d-shader: Add support for floor() on SM1-3.
    • f6364901 - vkd3d-shader: Add constant folding for 'ceil'.
    • bfb0c206 - vkd3d-shader: Add a missing entry to instruction debug print helper.
    • a998297e - vkd3d-shader: Add constant folding for 'floor'.

    Compare with previous version

  • Francisco Casas approved this merge request

    approved this merge request

  • Nikolay Sivov added 19 commits

    added 19 commits

    • a998297e...f75bdd6e - 11 commits from branch wine:master
    • 01a6591b - tests: Add some tests for ceil().
    • f7caf69a - vkd3d-shader/hlsl: Parse ceil() function.
    • 8603a857 - vkd3d-shader/tpf: Add support for ceil().
    • 948e62be - vkd3d-shader: Add support for ceil() on SM1-3.
    • a791d7fd - vkd3d-shader: Add support for floor() on SM1-3.
    • f08f0417 - vkd3d-shader: Add constant folding for 'ceil'.
    • 424d36bb - vkd3d-shader: Add a missing entry to instruction debug print helper.
    • a3d1bc14 - vkd3d-shader: Add constant folding for 'floor'.

    Compare with previous version

  • Giovanni Mascellani approved this merge request

    approved this merge request

  • Nikolay Sivov added 83 commits

    added 83 commits

    • a3d1bc14...a03e78bf - 75 commits from branch wine:master
    • 62fb5230 - tests: Add some tests for ceil().
    • ddb15f88 - vkd3d-shader/hlsl: Parse ceil() function.
    • 33c6a778 - vkd3d-shader/tpf: Add support for ceil().
    • 30041250 - vkd3d-shader: Add support for ceil() on SM1-3.
    • db5e91c1 - vkd3d-shader: Add support for floor() on SM1-3.
    • cefd6aee - vkd3d-shader: Add constant folding for 'ceil'.
    • b2ce351e - vkd3d-shader: Add a missing entry to instruction debug print helper.
    • fcc3914c - vkd3d-shader: Add constant folding for 'floor'.

    Compare with previous version

  • Elizabeth Figura approved this merge request

    approved this merge request

  • Henri Verbeet approved this merge request

    approved this merge request

  • Alexandre Julliard approved this merge request

    approved this merge request

  • Please register or sign in to reply
    Loading