[Mesa-dev] [PATCH 08/15] i965: Remove brw_new_shader

Kenneth Graunke kenneth at whitecape.org
Fri Oct 24 22:24:45 PDT 2014


On Friday, October 24, 2014 07:38:10 PM Ian Romanick wrote:
> On 10/23/2014 09:35 AM, Ian Romanick wrote:
> > From: Ian Romanick <ian.d.romanick at intel.com>
> > 
> > It was identical to the default implementation in _mesa_new_shader.
> > 
> > Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> > ---
> >  src/mesa/drivers/dri/i965/brw_program.c  |  1 -
> >  src/mesa/drivers/dri/i965/brw_shader.cpp | 16 ----------------
> >  src/mesa/drivers/dri/i965/brw_wm.h       |  1 -
> >  3 files changed, 18 deletions(-)
> > 
> > diff --git a/src/mesa/drivers/dri/i965/brw_program.c 
b/src/mesa/drivers/dri/i965/brw_program.c
> > index e56ece0..3de96ae 100644
> > --- a/src/mesa/drivers/dri/i965/brw_program.c
> > +++ b/src/mesa/drivers/dri/i965/brw_program.c
> > @@ -236,7 +236,6 @@ void brwInitFragProgFuncs( struct dd_function_table 
*functions )
> >     functions->IsProgramNative = brwIsProgramNative;
> >     functions->ProgramStringNotify = brwProgramStringNotify;
> >  
> > -   functions->NewShader = brw_new_shader;
> >     functions->LinkShader = brw_link_shader;
> >  }
> >  
> > diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp 
b/src/mesa/drivers/dri/i965/brw_shader.cpp
> > index 21dcf2d..56d7f3f 100644
> > --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
> > +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
> > @@ -33,22 +33,6 @@ extern "C" {
> >  #include "glsl/glsl_parser_extras.h"
> >  #include "main/shaderapi.h"
> >  
> > -struct gl_shader *
> > -brw_new_shader(struct gl_context *ctx, GLuint name, GLuint type)
> > -{
> > -   struct brw_shader *shader;
> > -
> > -   shader = rzalloc(NULL, struct brw_shader);
> 
> Certainly NOT identical to _mesa_new_shader.  Surprisingly, only ONE
> piglit test failed (khr_debug-push-pop-group_gl) as a result.

Youch.  Yeah, that allocates a different structure.  If you ran with 
INTEL_DEBUG=perf, it would probably crash a lot.

Moving compiled_once to struct gl_shader and hooking it up elsewhere might not 
be crazy.  Presumably other drivers want to detect state-based recompiles and 
issue performance warnings as well.

Then we could just use gl_shader again.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141024/09dcedd8/attachment.sig>


More information about the mesa-dev mailing list