[Mesa-dev] [PATCH 1/2] meta: Add a GLSL-based _mesa_meta_Clear() variant.
Eric Anholt
eric at anholt.net
Tue Jul 19 08:58:32 PDT 2011
On Mon, 18 Jul 2011 12:47:26 -0600, Brian Paul <brianp at vmware.com> wrote:
> On 07/18/2011 10:33 AM, Eric Anholt wrote:
> > This cuts out a large portion of the overhead of glClear() from
> > resetting the texenv state and recomputing the fixed function
> > programs. It also means less use of fixed function internally in our
> > GLES2 drivers, which is rather bogus.
>
> Looks good. Only minor comments below.
>
> Reviewed-by: Brian Paul <brianp at vmware.com>
> > + _mesa_EnableVertexAttribArrayARB(0);
> > +
> > + vs = _mesa_CreateShaderObjectARB(GL_VERTEX_SHADER);
> > + _mesa_ShaderSourceARB(vs, 1,&vs_source, NULL);
> > + _mesa_CompileShaderARB(vs);
> > +
> > + fs = _mesa_CreateShaderObjectARB(GL_FRAGMENT_SHADER);
> > + _mesa_ShaderSourceARB(fs, 1,&fs_source, NULL);
> > + _mesa_CompileShaderARB(fs);
> > +
> > + clear->ShaderProg = _mesa_CreateProgramObjectARB();
> > + _mesa_AttachShader(clear->ShaderProg, fs);
> > + _mesa_AttachShader(clear->ShaderProg, vs);
> > + _mesa_BindAttribLocationARB(clear->ShaderProg, 0, "position");
> > + _mesa_LinkProgramARB(clear->ShaderProg);
> > +
> > + _mesa_DeleteShader(fs);
> > + _mesa_DeleteShader(vs);
>
> I think these deletes could be omitted. It might be confusing to the
> casual reader.
Oh, we're just relying on the hash table to free them. Sounds good (all
of the review).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110719/9e1783f7/attachment.pgp>
More information about the mesa-dev
mailing list