<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [Perf] Pre validate _mesa_sampler_uniforms_pipeline_are_valid like _mesa_sampler_uniforms_are_valid"
href="https://bugs.freedesktop.org/show_bug.cgi?id=96410#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [Perf] Pre validate _mesa_sampler_uniforms_pipeline_are_valid like _mesa_sampler_uniforms_are_valid"
href="https://bugs.freedesktop.org/show_bug.cgi?id=96410">bug 96410</a>
from <span class="vcard"><a class="email" href="mailto:gregory.hainaut@gmail.com" title="gregory.hainaut@gmail.com">gregory.hainaut@gmail.com</a>
</span></b>
<pre>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-------------------------</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>