[Mesa-dev] [Bug 96408] [PERF] SSO: dirty all stages when only one is updated. Trigger extra validations.

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jun 8 08:20:37 UTC 2016


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

--- Comment #2 from gregory.hainaut at gmail.com ---
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.

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


More information about the mesa-dev mailing list