<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><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#c2">Comment # 2</a>
on <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">bug 96408</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>Hum, when a new program is set, use_shader_program is called and the
_NEW_PROGRAM flag will be set.
use_shader_program(....)
{
....
if (*target != shProg) {
/* Program is current, flush it */
if (shTarget == ctx->_Shader) {
FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
}
....
}
During the draw, the program update will be checked if _NEW_PROGRAM is enabled.
And new program will be bound accordingly
#0 st_bind_program (ctx=0x8801f88, target=34820, prog=0x8acfbf0) at
state_tracker/st_cb_program.c:59
#1 0xf460bd3c in update_program (ctx=0x8801f88) at main/state.c:262
#2 _mesa_update_state_locked (ctx=0x8801f88) at main/state.c:468
#3 0xf460c0c4 in _mesa_update_state (ctx=0x8801f88) at main/state.c:499
#4 0xf4501739 in _mesa_valid_to_render (ctx=0x8801f88, where=0xf4a901be
"glDrawArrays") at main/context.c:1935
#5 0xf44db08f in check_valid_to_render (function=0xf4a901be "glDrawArrays",
ctx=0x8801f88) at main/api_validate.c:44
So I have the feeling that "ctx->Driver.UseProgram" is kind of useless. Indeed,
I didn't manage to find the code for dri (not-gallium) drivers. So it is
probably undefined.
Perf wise, the removal of Driver.UseProgram yields a 10-15% speed increase on
my use case.</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>