Skip to content
Snippets Groups Projects
  1. Dec 07, 2023
  2. Dec 06, 2023
  3. Dec 04, 2023
  4. Nov 29, 2023
    • Francisco Casas's avatar
      vkd3d-shader/hlsl: Use values at the time of the swizzle's load in copy-propagation. · 736f3ae2
      Francisco Casas authored and Alexandre Julliard's avatar Alexandre Julliard committed
      This preempts us from replacing a swizzle incorrectly, as in the
      following example:
      
          1: A.x = 1.0
          2: A
          3: A.x = 2.0
          4: @2.x
      
      were @4 ends up being 2.0 instead of 1.0, because that's the value stored in
      A.x at time 4, and we should be querying it at time 2.
      
      This also helps us to avoid replacing a swizzle with itself in copy-prop
      which can result in infinite loops, as with the included tests this commit.
      
      Consider the following sequence of instructions:
      
          1 : A
          2 : B = @1
          3 : B
          4 : A = @3
          5 : @1.x
      
      Current copy-prop would replace 5 so it points to @3 now:
      
          1 : A
          2 : B = @1
          3 : B
          4 : A = @3
          5 : @3.x
      
      But in the next iteration it would make it point back to @1, keeping it
      spinning infinitively.
      
      The solution is to index the instructions and don't replace the swizzle
      if the new load happens after the current load.
      736f3ae2
    • Francisco Casas's avatar
      vkd3d-shader/hlsl: Record trace of stored values in copy-propagation. · d877b877
      Francisco Casas authored and Alexandre Julliard's avatar Alexandre Julliard committed
      Instead of only storing the value that each variable's component has at
      the moment of the instruction currently handled by copy-prop, we store
      the trace of all the historic values with their timestamps, i.e. the
      instruction index on which the value was stored.
      
      This would allow us to query the value that the variable had at the time
      of execution of previous instructions.
      d877b877
    • Francisco Casas's avatar
      vkd3d-shader/hlsl: Move index_instructions() up. · 539294da
      Francisco Casas authored and Alexandre Julliard's avatar Alexandre Julliard committed
      539294da
    • Francisco Casas's avatar
      tests: Test current failure when propagating swizzles. · e6b7b38a
      Francisco Casas authored and Alexandre Julliard's avatar Alexandre Julliard committed
      The included test fails because copy_propagation_transform_swizzle()
      is using the value recorded for the variable when the swizzle is being
      read, and not the swizzle's load.
      e6b7b38a
  5. Nov 28, 2023
  6. Nov 27, 2023
Loading