[Mesa-dev] [PATCH] st/mesa: don't disallow indirect addressing of temporaries

Jose Fonseca jfonseca at vmware.com
Wed May 14 02:52:36 PDT 2014



----- Original Message -----
> Am 14.05.2014 09:55, schrieb Michel Dänzer:
> > On 14.05.2014 06:45, Marek Olšák wrote:
> >> From: Marek Olšák <marek.olsak at amd.com>
> >>
> >> It works just fine.
> >>
> >> This fixes a crash in:
> >>    piglit/spec/glsl-1.20/execution/fs-const-array-of-struct-of-array
> >>
> >> Bugzilla:
> >> https://urldefense.proofpoint.com/v1/url?u=https://bugs.freedesktop.org/show_bug.cgi?id%3D78666&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=NMr9uy2iTjWVixC0wOcYCWEIYhfo80qKwRgdodpoDzA%3D%0A&m=4oDh7QTPDxy265tHcQUwK2z%2Fl5MNY%2B573J1wEwPXNEw%3D%0A&s=3ecf79244b41160aca663def16f3b0a49b3584c46ff1270da47e33b5d5551219
> >>
> >> Cc: 10.2 10.1 mesa-stable at lists.freedesktop.org
> >> ---
> >>   src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 -
> >>   1 file changed, 1 deletion(-)
> >>
> >> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> >> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> >> index bdee1f4..eab7d8a 100644
> >> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> >> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> >> @@ -4475,7 +4475,6 @@ translate_src(struct st_translate *t, const
> >> st_src_reg *src_reg)
> >>         src = ureg_negate(src);
> >>   
> >>      if (src_reg->reladdr != NULL) {
> >> -      assert(src_reg->file != PROGRAM_TEMPORARY);
> >>         src = ureg_src_indirect(src, ureg_src(t->address[0]));
> >>      }
> >>   
> >>
> > Tested-by: Michel Dänzer <michel.daenzer at amd.com>
> >
> > Christian added this assertion in commit
> > 3f67251e3d0ce61a0e7fc16de91de6fb49cad768, he should probably take a look.
> That indeed should work fine. I've added this assert because temporaries
> shouldn't be indirect addressed any more after adding PROGRAM_ARRAY.
> 
> So what's the reason you are hitting it again?
> 
> Regards,
> Christian.

I actually spent sometime to look into this failure a couple weeks ago.

IIRC, the problem is that the test uses arrays of one element, and in glsl_to_tgsi_visitor::get_temp(), the condition "(type->is_array() || type->is_matrix()" ends up being false somehow, so the temporary is marked with PROGRAM_TEMPORARY instead PROGRAM_ARRAY 

I couldn't figure out what way the fix should go -- fix glsl or the remove the assertion. The failure look harmless, so I ended up working on something else and forgot about it...

Jose


More information about the mesa-dev mailing list