[Mesa-dev] [PATCH 1/2] i965: in brw_link_shader() react to low memory

Samuel Iglesias Gonsálvez siglesias at igalia.com
Fri Feb 5 14:25:30 UTC 2016


Oh, I found that Iago replied to this series before [0] and he is
right. Please ignore my two R-b for the patches of this series.

Sam

[0] http://lists.freedesktop.org/archives/mesa-dev/2016-February/106396
.html

On Thu, 2016-02-04 at 16:16 +0100, Samuel Iglesias Gonsálvez wrote:
> On Wed, 2016-02-03 at 10:56 +0200, Juha-Pekka Heikkila wrote:
> > Check _mesa_new_parameter_list() returned other than null.
> > 
> > Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> > ---
> >  src/mesa/drivers/dri/i965/brw_link.cpp | 4 ++++
> >  src/mesa/main/ff_fragment_shader.cpp   | 6 ++++--
> >  2 files changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp
> > b/src/mesa/drivers/dri/i965/brw_link.cpp
> > index db4ba88..5411fb8 100644
> > --- a/src/mesa/drivers/dri/i965/brw_link.cpp
> > +++ b/src/mesa/drivers/dri/i965/brw_link.cpp
> > @@ -221,6 +221,10 @@ brw_link_shader(struct gl_context *ctx, struct
> > gl_shader_program *shProg)
> >        if (!prog)
> >  	return false;
> >        prog->Parameters = _mesa_new_parameter_list();
> > +      if (!prog->Parameters) {
> > +         _mesa_error(ctx, GL_OUT_OF_MEMORY, "brw_link_shader");
> > +         return false;
> > +      }
> >  
> >        _mesa_copy_linked_program_data((gl_shader_stage) stage,
> > shProg, prog);
> >  
> > diff --git a/src/mesa/main/ff_fragment_shader.cpp
> > b/src/mesa/main/ff_fragment_shader.cpp
> > index b0ce8c4..611deff 100644
> > --- a/src/mesa/main/ff_fragment_shader.cpp
> > +++ b/src/mesa/main/ff_fragment_shader.cpp
> > @@ -1264,9 +1264,11 @@ create_new_program(struct gl_context *ctx,
> > struct state_key *key)
> >  
> >     _mesa_glsl_link_shader(ctx, p.shader_program);
> >  
> > -   if (!p.shader_program->LinkStatus)
> > +   if (!p.shader_program->LinkStatus) {
> >        _mesa_problem(ctx, "Failed to link fixed function fragment
> > shader: %s\n",
> > -		    p.shader_program->InfoLog);
> > +                    (p.shader_program->InfoLog)?p.shader_program-
> > > InfoLog:
> > +                                                "Out of Memory");
> > +   }
> >  
> 
> Please add whitespace after '?' and also before ':'. There is no need
> of enclosing p.shader_program->InfoLog with parenthesis.
> 
> Other than that,
> 
> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> 
> Sam
> 
> >     ralloc_free(p.mem_ctx);
> >     return p.shader_program;
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list