1. 24 May, 2019 2 commits
    • ReinUsesLisp's avatar
      gl_shader_decompiler: Use an if based cbuf indexing for broken drivers · d8827b07
      ReinUsesLisp authored
      The following code is broken on AMD's proprietary GLSL compiler:
      ```glsl
      uint idx = ...;
      vec4 values = ...;
      float some_value = values[idx & 3];
      ```
      
      It index the wrong components, to fix this the following pessimized code
      is emitted when that bug is present:
      ```glsl
      uint idx = ...;
      vec4 values = ...;
      float some_value;
      if ((idx & 3) == 0) some_value = values.x;
      if ((idx & 3) == 1) some_value = values.y;
      if ((idx & 3) == 2) some_value = values.z;
      if ((idx & 3) == 3) some_value = values.w;
      ```
      d8827b07
    • ReinUsesLisp's avatar
      gl_device: Add test to detect broken component indexing · 46177901
      ReinUsesLisp authored
      Component indexing on AMD's proprietary driver is broken. This commit adds
      a test to detect when we are on a driver that can't successfully manage
      component indexing.
      
      It dispatches a dummy draw with just one vertex shader that writes to an
      indexed SSBO from the GPU with data sent through uniforms, it then reads
      that data from the CPU and compares the expected output.
      46177901
  2. 23 May, 2019 3 commits
    • Lioncash's avatar
      shader/shader_ir: Make Comment() take a std::string by value · b6dcb1ae
      Lioncash authored
      This allows for forming comment nodes without making unnecessary copies
      of the std::string instance.
      
      e.g. previously:
      
      Comment(fmt::format("Base address is c[0x{:x}][0x{:x}]",
              cbuf->GetIndex(), cbuf_offset));
      
      Would result in a copy of the string being created, as CommentNode()
      takes a std::string by value (a const ref passed to a value parameter
      results in a copy).
      
      Now, only one instance of the string is ever moved around. (fmt::format
      returns a std::string, and since it's returned from a function by value,
      this is a prvalue (which can be treated like an rvalue), so it's moved
      into Comment's string parameter), we then move it into the CommentNode
      constructor, which then moves the string into its member variable).
      b6dcb1ae
    • Lioncash's avatar
      shader/decode/*: Add missing newline to files lacking them · 228e58d0
      Lioncash authored
      Keeps the shader code file endings consistent.
      228e58d0
    • Lioncash's avatar
      shader/decode/*: Eliminate indirect inclusions · 87b4c1ac
      Lioncash authored
      Amends cases where we were using things that were indirectly being
      satisfied through other headers. This way, if those headers change and
      eliminate dependencies on other headers in the future, we don't have
      cascading compilation errors.
      87b4c1ac
  3. 22 May, 2019 1 commit
  4. 21 May, 2019 4 commits
  5. 20 May, 2019 11 commits
  6. 19 May, 2019 19 commits