<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Invalid sampling of second texture in fragment shader that have two samplers with different parameters."
   href="https://bugs.freedesktop.org/show_bug.cgi?id=95085">95085</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Invalid sampling of second texture in fragment shader that have two samplers with different parameters.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.2
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>major
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>glsl-compiler
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>idr@freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>leonmaxx@gmail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=123183" name="attach_123183" title="apitrace">attachment 123183</a> <a href="attachment.cgi?id=123183&action=edit" title="apitrace">[details]</a></span>
apitrace

This is long standing bug of Mesa's GLSL shader compiler (4-years ago I got it
for first time).

Fragment shader is like this:
--------------------------------------
#version 330 core

smooth in vec2 vTex2C;
smooth in vec4 vFiltColor;
flat in uint nModeOut;

out vec4 fragColor;

uniform sampler2D tNinepatch;
uniform sampler2D tFonttex;

void main() {
    if (nModeOut == 0U) {
        fragColor = texture(tNinepatch, vTex2C.xy) * vFiltColor;
    }
    else {
        float fAlpha = texture(tFonttex, vTex2C.xy).r;
        fragColor = vec4(1.0, 1.0, 1.0, fAlpha) * vFiltColor;
    }
}
--------------------------------------

First texture format is RGBA8 with linear filtering, second is R8 with nearest
filtering.
Sampling from first texture is correct, but from second it's invalid and it
looks like it uses sampling parameters for first texture to sample second
texture.

I have tested this shader on different OSes/drivers:
Ubuntu/Mesa/Intel         Works
Ubuntu/Mesa/Noveau        Invalid
Ubuntu/Mesa/R600g         Invalid
Ubuntu/Mesa/Radeonsi      Invalid
Ubuntu/AMD_Catalyst       Works
Ubuntu/Nvidia             Works
Windows/*                 Works
Mac Os X/*                Works

(* - means any driver/hardware)

Ubuntu versions 14.04.4 and 16.04 both tested - results is same.
Mesa versions tested are distribution default versions (10.1.3 in Ubuntu
14.04.4, and 11.2.0 in Ubuntu 16.04).

Later I'll test with Mesa-git (from Padoka PPA) and will post the results here
too.

Apitrace file attached to message shows the problem (black boxes should be a
text).</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>