Skip to content
Snippets Groups Projects

vkd3d-shader/hlsl: Improve SM1 support for non-float operations, part 2.

Merged Francisco Casas requested to merge fcasas/vkd3d:sm1_logic_part2 into master
2 unresolved threads

Patches with tests and other miscellaneous changes required before the remaining features in my sm1_logic branch. Includes some rebased spirv.c patches by Zeb.

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
  • Ghost User requested review from @fcasas

    requested review from @fcasas

    • 2/6 seems to have a stray FIXME in it.

      I think 5/6 and 6/6 are fine but per discussion we may want them to be earlier lowering passes anyway?

      Note also you'll need to manually accept this one since it has my commits in it.

      +% The main objective of this test is to see if operations for SM1 vertex shaders work. +% Because they have a different instruction set that pixel shaders.

      Dependent clauses should be separated by a comma, and "that" seems to be a typographical error.

    • Author Developer

      It makes sense to implement 5/6 and 6/6 in ir.c, in the same spirit as instruction_array_lower_texkills(). I will work on doing that but in the mean time I fixed the other details.

    • Author Developer

      After some checking, it seems that it is currently common in spirv.c to perform the casts inside the functions that handle each vsir instruction when the src and dst register types don't match, for instance in spirv_compiler_emit_alu_instruction().

      So my impression now is that CMP, SLT, and SGE, are not so deserving of a normalization pass that only changes the handler_idx and appends a cast from bool to float.

      But if we do, do we have a vsir handler_idx to represent such casts (which will have to end up as SpvOpSelect)?

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

    added 5 commits

    • 929a1361 - vkd3d-shader/hlsl: Cast slt before multiplying on ternary operator.
    • 9f3e1ef6 - tests: Test comparison and logic operators on SM1 vertex shaders.
    • 3db845df - tests: Check that -0.0f is not less than 0.0f.
    • 0ad9d2e3 - vkd3d-shader/spirv: Implement CMP.
    • fd718f81 - vkd3d-shader/spirv: Implement SLT and SGE.

    Compare with previous version

  • Elizabeth Figura approved this merge request

    approved this merge request

  • Francisco Casas approved this merge request

    approved this merge request

  • Giovanni Mascellani
    Giovanni Mascellani @giomasce started a thread on commit 3db845df
1 % Check that -0.0f is not less than 0.0f
2 [pixel shader todo(sm<4)]
3 float a;
4
5 float4 main() : sv_target
6 {
7 return -0.0f < a;
  • Any particular reason for passing one operand as immediate and the other as uniform?

  • Author Developer

    At least one has to be uniform to ensure that this is not being constant folded and the purpose of the test seemed more clear letting -0.0f in the shader. Also that way I could check at native's output to confirm that it is indeed emitting the constant as -0.0f.

  • Please register or sign in to reply
  • Giovanni Mascellani approved this merge request

    approved this merge request

  • Francisco Casas added 6 commits

    added 6 commits

    • ee7c0b5f - tests/shader-runner: Pass uniforms to vertex shaders in d3d9 and d3d11.
    • 30c362ec - vkd3d-shader/hlsl: Cast slt before multiplying on ternary operator.
    • 5a4d79a9 - tests: Test comparison and logic operators on SM1 vertex shaders.
    • 0b332de3 - tests: Check that -0.0f is not less than 0.0f.
    • 08563026 - vkd3d-shader/spirv: Implement CMP.
    • cd5bf58e - vkd3d-shader/spirv: Implement SLT and SGE.

    Compare with previous version

  • Francisco Casas added 48 commits

    added 48 commits

    • cd5bf58e...23259263 - 42 commits from branch wine:master
    • 5766554f - tests/shader-runner: Pass uniforms to vertex shaders in d3d9 and d3d11.
    • d49b89a7 - vkd3d-shader/hlsl: Cast slt before multiplying on ternary operator.
    • 113c3b2f - tests: Test comparison and logic operators on SM1 vertex shaders.
    • 52d7213e - tests: Check that -0.0f is not less than 0.0f.
    • 5b0a2e53 - vkd3d-shader/spirv: Implement CMP.
    • 373c06d3 - vkd3d-shader/spirv: Implement SLT and SGE.

    Compare with previous version

  • 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