<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi,</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Another info about the 0.5 offset is
      the following comments in the r600 gallium driver:</div>
    <div class="moz-cite-prefix">                /* Gather4 should
      follow the same rules as bilinear filtering, but the hardware<br>
                       * incorrectly forces nearest filtering if the
      texture format is integer.<br>
                       * The only effect it has on Gather4, which always
      returns 4 texels for<br>
                       * bilinear filtering, is that the final
      coordinates are off by 0.5 of<br>
                       * the texel size.<br>
                       *<br>
                       * The workaround is to subtract 0.5 from the
      unnormalized coordinates,<br>
                       * or (0.5 / size) from the normalized
      coordinates.<br>
                       */</div>
    <div class="moz-cite-prefix">The driver implements the workaround.<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">r600's GATHER4 is likely to be the
      original instruction meant for FETCH4, as except for Cayman, the
      driver reorders the result to match the gl's version.<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">On 27/01/2019 00:55, Axel Davy wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:89e6b02b-9a8b-6b13-0a03-1ceb728a6669@gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div class="moz-cite-prefix">Hi,</div>
      <div class="moz-cite-prefix"><br>
      </div>
      <div class="moz-cite-prefix">I'm trying to implement FETCH4 as
        well for nine. Unfortunately, my windows test system died, thus
        I rely on your experiments.<br>
      </div>
      <div class="moz-cite-prefix"><br>
      </div>
      <div class="moz-cite-prefix">I experimented with 3DMark06,
        disabling support for D24X8 texturing to force FETCH4.</div>
      <div class="moz-cite-prefix">I noticed a few things:</div>
      <div class="moz-cite-prefix">. FETCH4 is used for DF24 sampling. A
        small -0.0002 offset is added to the coordinates.<br>
      </div>
      <div class="moz-cite-prefix">. For some calls it sets FETCH4 on
        DXT1 cube textures.</div>
      <div class="moz-cite-prefix">. The texturing support for D24X8 is
        fetched with usage=0x20002, ie with D3DUSAGE_QUERY_FILTER. I
        guess this checks PCF support.</div>
      <div class="moz-cite-prefix"><br>
      </div>
      <div class="moz-cite-prefix">My initial patch just let FETCH4
        trigger gather4 for the red channel for any texture.</div>
      <div class="moz-cite-prefix">This seems to be wrong though as the
        game renders black and white as a result.</div>
      <div class="moz-cite-prefix"><br>
      </div>
      <div class="moz-cite-prefix">Clearly looking at how the shader is
        using the tex output, it was expecting the FETCH4 on the DXT1
        cube texture to be a normal tex instruction. There may also be
        other weird usages I missed.<br>
      </div>
      <div class="moz-cite-prefix"><br>
      </div>
      <div class="moz-cite-prefix">My understanding of the wine proposed
        patchset is that you shouldn't hit the same problem as you
        restrict FETCH4 support for only a small subset of textures.</div>
      <div class="moz-cite-prefix">That raises some other questions,
        though: Do FETCH4 on some non-FETCH4 texture do really nothing ?
        I mean, maybe just like for the FETCH4 formats, it's possible
        projection, lod, etc get ignored.</div>
      <div class="moz-cite-prefix"><br>
      </div>
      <div class="moz-cite-prefix">Axel<br>
      </div>
      <div class="moz-cite-prefix"><br>
      </div>
      <div class="moz-cite-prefix">On 25/01/2019 19:24, Stefan Dösinger
        wrote:<br>
      </div>
      <blockquote type="cite"
        cite="mid:41e0206e-d8fd-e317-9291-720428701b4e@gmail.com">
        <pre class="moz-quote-pre" wrap="">Am 25.01.19 um 17:57 schrieb Stefan Dösinger:
</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">Maybe I'll get around to installing Windows 10 on my new Mac with an AMD
Polaris GPU. That should give some clues how the behavior developed
since then.
</pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">I totally forgot that I had a desktop box with a Radeon RX 580 card
(Polaris I think) and Windows 10 under my desk. Attached are results
with your filtering settings and point filtering everywhere.

On a quick look it seems that it also has the 0.5 texel offset, but has
some precision issues with the colors it writes. You may have to
increase the allowed slop in the color comparisons. Maybe you can also
add or subtract one from the expected results and keep everything happy
with the current slop.
</pre>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
      </blockquote>
      <p><br>
      </p>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>