Skip to content
Snippets Groups Projects

vkd3d-shader/hlsl: sin(), cos(), sqrt() and step() intrinsics.

Merged Francisco Casas requested to merge fcasas/vkd3d:intrinsics into master
1 unresolved thread

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
    • This fails when running under d3d9 under wine:

      leslie@terabithia:~/git/vkd3d64$ make -j8 tests/shader_runner.cross64.exe && WINEDLLOVERRIDES=d3dcompiler_47=n VKD3D_TEST_PLATFORM=windows wine tests/shader_runner.cross64.exe ../vkd3d/tests/trigonometry.shader_test 
      0150:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
      shader_runner:98: Driver string: aticfx32.dll.
      shader_runner:99: Device: Radeon(TM) RX 460 Graphics, 1002:67ef.
      0154:fixme:d3d:state_linepattern_w Setting line patterns is not supported in OpenGL core contexts.
      shader_runner:551:Section [test], line 42: Test failed: Got {6.55651093e-007, 4.99999940e-001, 5.00000417e-001, 8.94069672e-007}, expected {0.00000000e+000, 5.00000000e-001, 5.00000000e-001, -0.00000000e+000} at (0, 0).
      shader_runner:551:Section [test], line 56: Test failed: Got {1.00000000e+000, 7.07106709e-001, 8.94069672e-007, -7.07075000e-001}, expected {1.00000000e+000, 7.07107008e-001, -0.00000000e+000, -7.07107008e-001} at (0, 0).
      shader_runner:188: Adapter: Radeon(TM) RX 460 Graphics, 1002:67ef.
      shader_runner:342: Adapter: Radeon(TM) RX 460 Graphics, 1002:67ef.
      shader_runner: 492 tests executed (2 failures, 0 skipped, 0 todo, 0 bugs).

      From testing, it looks like native will use a polynomial approximation in some cases (specifically: if more than one component is needed and the sincos() intrinsic isn't used).

    • Author Developer

      I see, and the difference between 8.94069672e-007 and plain old 0.0 in terms of ulps seems to be impractically high.

      How about using the round() intrinsic, as in the update?

      Worth noting: The d3d11 functional specification says:

      The maximum absolute error is 0.0008 in the interval from -100*Pi to +100*Pi.

      Edited by Francisco Casas
    • Seems reasonable; also reasonable would be to just pick some different constants (since it seems to be the ones close to zero which are broken).

    • Please register or sign in to reply
  • Francisco Casas added 7 commits

    added 7 commits

    • bf2654e9 - vkd3d-shader/hlsl: Add additional tests for sin() and cos().
    • 1e401187 - vkd3d-shader/hlsl: Support sin() intrinsic.
    • a11ecb31 - vkd3d-shader/hlsl: Support cos() intrinsic.
    • 0e7c2815 - tests: Test sqrt() intrinsic.
    • 44ba026f - vkd3d-shader/hlsl: Parse sqrt() intrinsic.
    • b5123fb6 - tests: Test step() intrinsic.
    • e66a9982 - vkd3d-shader/hlsl: Parse step() intrinsic.

    Compare with previous version

  • Giovanni Mascellani approved this merge request

    approved this merge request

  • Elizabeth Figura approved this merge request

    approved this merge request

  • Henri Verbeet approved this merge request

    approved this merge request

  • added 18 commits

    • e66a9982...2b1ec0cf - 11 commits from branch wine:master
    • b65c4501 - vkd3d-shader/hlsl: Add additional tests for sin() and cos().
    • 3239ea5f - vkd3d-shader/hlsl: Support sin() intrinsic.
    • 8d5f16d8 - vkd3d-shader/hlsl: Support cos() intrinsic.
    • 7dbc879e - tests: Test sqrt() intrinsic.
    • 6fbf2b3e - vkd3d-shader/hlsl: Parse sqrt() intrinsic.
    • 4e1a4a76 - tests: Test step() intrinsic.
    • 13c8e8b8 - vkd3d-shader/hlsl: Parse step() intrinsic.

    Compare with previous version

  • Alexandre Julliard approved this merge request

    approved this merge request

Please register or sign in to reply
Loading