On Fri, 6 Jan 2012 16:50:04 -0800, "Ian Romanick" <i...@freedesktop.org> wrote: > From: Ian Romanick <ian.d.roman...@intel.com> > > Instead, do the uniform setting and input / output mapping directly in > brw_link_shader. Hurray for not generating Mesa IR! > > Signed-off-by: Ian Romanick <ian.d.roman...@intel.com> > --- > src/mesa/drivers/dri/i965/brw_shader.cpp | 60 > +++++++++++++++++++++++++++--- > 1 files changed, 54 insertions(+), 6 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp > b/src/mesa/drivers/dri/i965/brw_shader.cpp > index fa325ba..f32f045 100644 > --- a/src/mesa/drivers/dri/i965/brw_shader.cpp > +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
> + /* Make a pass over the IR to add state references for any built-in > + * uniforms that are used. This has to be done now (during linking). > + * Code generation doesn't happen until the first time this shader is > + * used for rendering. Waiting until then to generate the parameters > is > + * too late. At that point, the values for the built-in informs won't > + * get sent to the shader. > + */ I actually can't find how that is too late -- compile happens before we decide on how to upload parameters (obviously), so it must be that the NEW_PROGRAM_CONSTANTS flag (set by mesa core) is not set. Mesa core appears to set it when any program uniform is changed and when programs are bound. I guess the exception I haven't found is that when programs are relinked, we don't flag it. That looks like a bug to me. On the other hand, this seems like a totally reasonable and appropriate place to be doing this work rather than per-recompile. I haven't actually reviewed that this is the set of work necessary for this code, but I'm fine with this in principle, at least.
pgp58p6rcfiuz.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev