<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 - [PERF] SSO: dirty all stages when only one is updated. Trigger extra validations."
href="https://bugs.freedesktop.org/show_bug.cgi?id=96408">96408</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[PERF] SSO: dirty all stages when only one is updated. Trigger extra validations.
</td>
</tr>
<tr>
<th>Product</th>
<td>Mesa
</td>
</tr>
<tr>
<th>Version</th>
<td>git
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>Mesa core
</td>
</tr>
<tr>
<th>Assignee</th>
<td>mesa-dev@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>gregory.hainaut@gmail.com
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>mesa-dev@lists.freedesktop.org
</td>
</tr></table>
<p>
<div>
<pre>Hello,
Profile my app (PCSX2), I found that NEW_VERTEX_PROGRAM validation is often
called whereas my program barely switch the vertex shader.
It was detected on Gallium Nouveau but it could impact others (gallium) drivers
Potential issue 1:
_mesa_UseProgramStages (aka glUseProgramStages) will always call
_mesa_use_shader_program which call in turn ctx->Driver.UseProgram
If I'm correct it is allowed to attach a stage to any pipeline (i.e. not bound
pipeline). In this case, it doesn't make sense to call UseProgram.
Potential issue 2:
ctx->Driver.UseProgram (aka st_use_program in gallium word) will dirty all
stages (see code below). I'm not sure it is mandatory. It feels like the API
need to be extended with an st_use_program_stage.
static void
st_use_program(struct gl_context *ctx, struct gl_shader_program *shProg)
{
struct st_context *st = st_context(ctx);
st->dirty.st |= ST_NEW_FRAGMENT_PROGRAM;
st->dirty.st |= ST_NEW_VERTEX_PROGRAM;
st->dirty.st |= ST_NEW_GEOMETRY_PROGRAM;
st->dirty.st |= ST_NEW_TESSCTRL_PROGRAM;
st->dirty.st |= ST_NEW_TESSEVAL_PROGRAM;
st->dirty_cp.st |= ST_NEW_COMPUTE_PROGRAM;
}
Potential issue 3:
I don't know if we need to revalidate everything when the pipeline is switched.
In order to reduce pipeline validate one could create severals pipeline that
contains same programs.
Example:
pipe0 contains VS and FS0
pipe1 contains VS and FS1
Do we need to revalidate all the VS resources, if pipe1 is bound after pipe0?
Any opinions ?
Gregory</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>