[Mesa-dev] [Bug 96410] [Perf] Pre validate _mesa_sampler_uniforms_pipeline_are_valid like _mesa_sampler_uniforms_are_valid

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Jun 18 06:53:47 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=96410

--- Comment #3 from gregory.hainaut at gmail.com ---
I confirm that Nvidia doesn't check anything. And we don't even check it for
mono program. I don't know if it was intended or a bug.


Potentially we could do something like the code below (I guess I need to add
back the unit 0 case). Code is faster because it only check sampler rather than
all uniforms.

An alternative will be to check only SamplersValidated for all stages. It will
be equivalent to mono program.

I guess the ideal solution would be to support  GL_KHR_no_error to disable all
those crazy validations.

--------------------------8<--------------------------
   for (unsigned idx = 0; idx < ARRAY_SIZE(pipeline->CurrentProgram); idx++) {
      if (!shProg[idx])
         continue;

      shader = shProg[idx]->_LinkedShaders[idx];
      if (!shader || !shader->Program)
         continue;

      mask = shader->Program->SamplersUsed;
      while (mask) {
         const int s = u_bit_scan(&mask);
         GLuint unit = shader->SamplerUnits[s];
         GLuint tgt = shader->SamplerTargets[s];

         if (TexturesUsed[unit] & ~(1 << tgt)) {
            pipeline->InfoLog =
               ralloc_asprintf(pipeline,
                     "Program %d: "
                     "Texture unit %d is accessed with 2 different types",
                     shProg[idx]->Name, unit);
            return false;
         }

         TexturesUsed[unit] |= (1 << tgt);
      }

      active_samplers += shader->num_samplers;
   }
--------------------------->8-------------------------

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160618/304c1a90/attachment.html>


More information about the mesa-dev mailing list