Skip to content
Snippets Groups Projects

vkd3d-shader/dxil: Support minimum precision.

Merged Conor McCarthy requested to merge cmccarthy/vkd3d:min_precis into master

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
  • Author Developer

    Once the backend supports minimum precision, hardware with 16-bit support will theoretically produce results matching SM 5. Checking for native 16-bit support should tell us when to expect different results. Ideally shader runner could check for either SM < 6 or native 16-bit, but that sounds a bit too complicated.

  • Conor McCarthy added 5 commits

    added 5 commits

    • 22c53b79 - tests/shader-runner: Run Shader Model 6 tests in the crossbuild.
    • 1b3d5a08 - tests/shader-runner: Add tests for minimum-precision constants.
    • f13d0336 - vkd3d-shader/spirv: Introduce a data_type_is_floating_point() helper function.
    • 5df6075c - vkd3d-shader/spirv: Introduce HALF and UINT16 types for minimum precision.
    • a1acb8a9 - vkd3d-shader/dxil: Support 16-bit types.

    Compare with previous version

  • Conor McCarthy added 4 commits

    added 4 commits

    • 933f1e50 - tests/shader-runner: Add tests for minimum-precision constants.
    • 21c6f92e - vkd3d-shader/spirv: Introduce a data_type_is_floating_point() helper function.
    • 9f91e75b - vkd3d-shader/spirv: Introduce HALF and UINT16 types for minimum precision.
    • fd9578ba - vkd3d-shader/dxil: Support 16-bit types.

    Compare with previous version

  • Conor McCarthy added 1 commit

    added 1 commit

    • abb9b03b - vkd3d-shader/dxil: Support 16-bit types.

    Compare with previous version

  • Conor McCarthy added 3 commits

    added 3 commits

    • 3c4d3c37 - vkd3d-shader/spirv: Introduce a data_type_is_floating_point() helper function.
    • 5007b77e - vkd3d-shader/spirv: Introduce HALF and UINT16 types for minimum precision.
    • faeb54e1 - vkd3d-shader/dxil: Support 16-bit types.

    Compare with previous version

    • -#if defined(SONAME_LIBDXCOMPILER) && !defined(VKD3D_CROSSTEST)
      +#if defined(SONAME_LIBDXCOMPILER) || defined(VKD3D_CROSSTEST)

      Should that just be "#if defined(SONAME_LIBDXCOMPILER)"? We could perhaps consider defining SONAME_LIBDXCOMPILER to "dxcompiler.dll" if it isn't already defined and we have VKD3D_CROSSTEST, but in principle I don't think VKD3D_CROSSTEST needs special handling here.

    • Defining SONAME_LIBDXCOMPILER when the dxcompiler library is not indeed available means that tests start failing. If no soname was specified or detected at configuration time, I don't think we should even try to use that library.

    • Author Developer

      I made this change so runner crosstests can be run in a Visual Studio command prompt, where dxcompiler.dll is in the path. SONAME_LIBDXCOMPILER is already defined even for crosstests, and there's no way to tell at compile time what its value should actually be for crosstest builds.

      It's convenient to have this work if dxcompiler.dll is available. It has no effect otherwise.

    • The part I don't like is that this means that in the CI the tests can silently pass if for some reason dxcompiler.dll is not available (which is currently the case for our CI, yes, but that can be improved in the future, and now that you remind me I could make so that the future is next week). How hard would it be to explicitly specify the DXC DLL at configuration time and have the shader runner emit a failure if the DLL is specified at configuration time but not found at runtime? It's ok for me to still look for the DLL if it wasn't explicitly requested at configuration time and do not fail it it's not found.

      Well, thinking again I can probably make this change myself when I add the DXC DLL to the CI. So as long as you don't object to the change above when I do it there is no need for you to do it now.

    • Please register or sign in to reply
  • Conor McCarthy added 28 commits

    added 28 commits

    • faeb54e1...f96a7918 - 23 commits from branch wine:master
    • 34f36b14 - tests/shader-runner: Run Shader Model 6 tests in the crossbuild.
    • aed1e6ed - tests/shader-runner: Add tests for minimum-precision constants.
    • 6d3a648d - vkd3d-shader/spirv: Introduce a data_type_is_floating_point() helper function.
    • c67fe062 - vkd3d-shader/spirv: Introduce HALF and UINT16 types for minimum precision.
    • 9d4c5680 - vkd3d-shader/dxil: Support 16-bit types.

    Compare with previous version

  • Giovanni Mascellani
  • Giovanni Mascellani
    Giovanni Mascellani @giomasce started a thread on an outdated change in commit c67fe062
  • 3719 else
    3720 {
    3721 /* Nan -- preserve sign and significand bits */
    3722 return s | 0x7f800000u | (m << 13);
    3723 }
    3724 }
    3725
    3726 /* Normalized number */
    3727 e += 127u - 15u;
    3728 m <<= 13;
    3729
    3730 /* Assemble s, e and m. */
    3731 return s | (e << 23) | m;
    3732 }
    3733
    3734 static uint32_t convert_raw_constant32(struct spirv_compiler *compiler,
  • Giovanni Mascellani
    Giovanni Mascellani @giomasce started a thread on an outdated change in commit c67fe062
  • 3708 ++e;
    3709 m &= ~0x400u;
    3710 }
    3711 }
    3712 else if (e == 31u)
    3713 {
    3714 if (!m)
    3715 {
    3716 /* Positive or negative infinity */
    3717 return s | 0x7f800000u;
    3718 }
    3719 else
    3720 {
    3721 /* Nan -- preserve sign and significand bits */
    3722 return s | 0x7f800000u | (m << 13);
    3723 }
  • Giovanni Mascellani
    Giovanni Mascellani @giomasce started a thread on an outdated change in commit c67fe062
  • 3679 3681 type_id, vector1_id, vector2_id, components, component_count);
    3680 3682 }
    3681 3683
    3684 /* Based on the implementation in the OpenGL Mathematics library. */
    3685 static uint32_t half_to_float(uint16_t value)
    3686 {
    3687 uint32_t s = (value & 0x8000) << 16;
  • Conor McCarthy added 4 commits

    added 4 commits

    • a1304cf4 - tests/shader-runner: Add tests for minimum-precision constants.
    • 4a2b597f - vkd3d-shader/spirv: Introduce a data_type_is_floating_point() helper function.
    • ac29fa23 - vkd3d-shader/spirv: Introduce HALF and UINT16 types for minimum precision.
    • c383969e - vkd3d-shader/dxil: Support 16-bit types.

    Compare with previous version

  • Conor McCarthy added 2 commits

    added 2 commits

    • 55c6789b - vkd3d-shader/spirv: Introduce HALF and UINT16 types for minimum precision.
    • a3ca3204 - vkd3d-shader/dxil: Support 16-bit types.

    Compare with previous version

  • I made this change so runner crosstests can be run in a Visual Studio command prompt, where dxcompiler.dll is in the path. SONAME_LIBDXCOMPILER is already defined even for crosstests, and there's no way to tell at compile time what its value should actually be for crosstest builds.

    Right, I overlooked that the issue here is that we may want to use e.g. "libdxcompiler.so" for the regular build and "dxcompiler.dll" for the cross build. It turns out that in principle e.g. the Vulkan runner would have that issue as well, but conveniently the Vulkan runner can't work for cross builds.

    In any case, something along the lines of Giovanni's proposal seems reasonable to me.

  • Giovanni Mascellani mentioned in merge request !514 (merged)

    mentioned in merge request !514 (merged)

  • Conor McCarthy added 38 commits

    added 38 commits

    • a3ca3204...50cebc72 - 34 commits from branch wine:master
    • 78acb843 - tests/shader-runner: Add tests for minimum-precision constants.
    • a24dec88 - vkd3d-shader/spirv: Introduce a data_type_is_floating_point() helper function.
    • 30651b67 - vkd3d-shader/spirv: Introduce HALF and UINT16 types for minimum precision.
    • 03828744 - vkd3d-shader/dxil: Support 16-bit types.

    Compare with previous version

  • Conor McCarthy added 114 commits

    added 114 commits

    • 03828744...14da4df9 - 110 commits from branch wine:master
    • 124bd8ee - tests/shader-runner: Add tests for minimum-precision constants.
    • b5237e96 - vkd3d-shader/spirv: Introduce a data_type_is_floating_point() helper function.
    • f548b06b - vkd3d-shader/spirv: Introduce HALF and UINT16 types for minimum precision.
    • 1a2a1db2 - vkd3d-shader/dxil: Support 16-bit types.

    Compare with previous version

  • Conor McCarthy added 2 commits

    added 2 commits

    • 94791953 - vkd3d-shader/spirv: Introduce HALF and UINT16 types for minimum precision.
    • d4067a74 - vkd3d-shader/dxil: Support 16-bit types.

    Compare with previous version

  • Conor McCarthy added 188 commits

    added 188 commits

    • d4067a74...06ddb10c - 184 commits from branch wine:master
    • 399b125a - tests/shader-runner: Add tests for minimum-precision constants.
    • f75953ab - vkd3d-shader/spirv: Introduce a data_type_is_floating_point() helper function.
    • fcf93b15 - vkd3d-shader/spirv: Introduce HALF and UINT16 types for minimum precision.
    • d17561fc - vkd3d-shader/dxil: Support 16-bit types.

    Compare with previous version

  • Author Developer

    This no longer has the shader runner changes, and is ready to go.

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading