Skip to content
Snippets Groups Projects

vkd3d-shader/hlsl: Normalize bools when loading from uniforms or vertex input.

Merged Elizabeth Figura requested to merge zfigura/vkd3d:pr6 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
623 union hlsl_constant_value
623 struct hlsl_constant_value
624 624 {
625 uint32_t u;
626 int32_t i;
627 float f;
628 double d;
629 } value[4];
625 union hlsl_constant_value_component
626 {
627 uint32_t u;
628 int32_t i;
629 float f;
630 double d;
631 } u[4];
632 } value;
  • Comment on lines -623 to +632

    What's the advantage of that? I can't say I really like all the .u that you have to sprinkle throughout the code.

  • Author Developer

    Being able to pass around hlsl_constant_value directly, mainly, without having to implicitly worry about array size mismatches. There are two places that I want to do this: firstly (what this patch was originally written for) I'd like to pass it to hlsl_new_constant(), to make the function able to return hlsl_ir_node and generally more consistent with other functions; secondly, the sm4_src_from_constant_value() helper introduced in patch 4/5.

  • Ah, right, you cannot copy around arrays easily in C. Unfortunate, but ok.

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

    approved this merge request

  • Francisco Casas approved this merge request

    approved this merge request

  • I see that the native compiler does

    ine ·, ·, l(0, 0, 0, 0)

    movc also works, but is there a particular reason to choose movc over ine ?

  • Author Developer

    movc also works, but is there a particular reason to choose movc over ine ?

    It was the first thing I thought of :-)

  • Henri Verbeet approved this merge request

    approved this merge request

  • Alexandre Julliard added 37 commits

    added 37 commits

    • 628a2e69...dcd991de - 32 commits from branch wine:master
    • 8b4e70df - tests: Test casting from a bool uniform.
    • 3cce4e70 - tests: Test bool semantics.
    • 0a44e604 - vkd3d-shader/hlsl: Put the hlsl_ir_constant value in a structure.
    • 834497d5 - vkd3d-shader/hlsl: Introduce an sm4_src_from_constant_value() helper.
    • 6e677def - vkd3d-shader/hlsl: Normalize bools when loading from uniforms or vertex input.

    Compare with previous version

  • Alexandre Julliard approved this merge request

    approved this merge request

  • Please register or sign in to reply
    Loading