On Sun, 2010-01-24 at 18:36 -0800, Igor Oliveira wrote: > The patch fixes the bug 25863. > The bug happens when i use blend types like multiply, screen, dark in > vega state tracker. > > --- a/src/gallium/drivers/softpipe/sp_state_sampler.c > +++ b/src/gallium/drivers/softpipe/sp_state_sampler.c > @@ -244,7 +244,7 @@ softpipe_reset_sampler_varients(struct > softpipe_context *softpipe) > * fragment programs. > */ > for (i = 0; i <= softpipe->vs->max_sampler; i++) { > - if (softpipe->vertex_samplers[i]) { > + if (softpipe->vertex_samplers[i] && softpipe->vertex_textures[i]) { > softpipe->tgsi.vert_samplers_list[i] = > get_sampler_varient( i, > sp_sampler(softpipe->vertex_samplers[i]), > @@ -258,7 +258,7 @@ softpipe_reset_sampler_varients(struct > softpipe_context *softpipe) > } > > for (i = 0; i <= softpipe->fs->info.file_max[TGSI_FILE_SAMPLER]; i++) { > - if (softpipe->sampler[i]) { > + if (softpipe->sampler[i] && softpipe->texture[i]) { > softpipe->tgsi.frag_samplers_list[i] = > get_sampler_varient( i, > sp_sampler(softpipe->sampler[i]), > -- > 1.6.3.3
This doesn't seem the best way to fix this: the segfault may happen in softpipe code, but the state tracker has the responsibility to sanitize state. Shouldn't the vega state tracker bind a dummy black texture in this case? Also, the net effect of this patch is to use the previously bound texture/sampler -- which may be null -- so the bug is potentially still there, but perhaps less likely. I wonder why changing blend type causes a null texture to be bound in the first place? I recall from Zack's VG talk that certain kind of blending ops had to be implemented with texturing, but binding a null texture binding seems a symptom of some subtle bug. Jose ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev