[Mesa-dev] Mesa (master): r600g: texture instructions also work fine with TGSI_FILE_INPUT

Christian König deathsimple at vodafone.de
Wed Jan 12 11:46:20 PST 2011


I found the bug, fixed it and pushed the fix to master.

With this optimisation a simple shader which just samples a texture
won't have any alu instructions any more. Since we look only at alu
instructions to determine the maximum gpu count used whe end up with a
gpu count of 0.

Thanks for the help,
Christian.

Am Mittwoch, den 12.01.2011, 19:34 +0100 schrieb Michel Dänzer:
> On Die, 2011-01-11 at 15:47 -0800, Christian KXXnig wrote: 
> > Module: Mesa
> > Branch: master
> > Commit: 93a95ad8ff1d543f886f123029d1329513729c4b
> > URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=93a95ad8ff1d543f886f123029d1329513729c4b
> > 
> > Author: Christian König <deathsimple at vodafone.de>
> > Date:   Sun Dec 12 15:37:54 2010 +0100
> > 
> > r600g: texture instructions also work fine with TGSI_FILE_INPUT
> > 
> > ---
> > 
> >  src/gallium/drivers/r600/r600_shader.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> > 
> > diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
> > index 59c080f..2bf116c 100644
> > --- a/src/gallium/drivers/r600/r600_shader.c
> > +++ b/src/gallium/drivers/r600/r600_shader.c
> > @@ -1717,7 +1717,9 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
> >  	unsigned src_gpr;
> >  	int r, i;
> >  	int opcode;
> > -	boolean src_not_temp = inst->Src[0].Register.File != TGSI_FILE_TEMPORARY;
> > +	boolean src_not_temp =
> > +		inst->Src[0].Register.File != TGSI_FILE_TEMPORARY &&
> > +		inst->Src[0].Register.File != TGSI_FILE_INPUT;
> >  	uint32_t lit_vals[4];
> >  
> >  	src_gpr = ctx->file_offset[inst->Src[0].Register.File] + inst->Src[0]..Register.Index;
> 
> This breaks on my RV635, e.g. the edges of the cube in fgl_glxgears
> become randomly coloured rather than white, but the same kind of
> corruption also appears elsewhere, e.g. with a Windows 7 VM in VMware
> Workstation.
> 
> 




More information about the mesa-dev mailing list