[Mesa-dev] tgsi tex instruction + cube map arrays.

Jose Fonseca jfonseca at vmware.com
Sat Sep 8 02:10:24 PDT 2012


----- Original Message -----
> On Sat, Sep 8, 2012 at 8:39 AM, Dave Airlie <airlied at gmail.com>
> wrote:
> > Hi,
> >
> > so I've been working on ARB_texture_cube_map_array, and it requires
> > that sometimes TEX takes an extra src, since for sampler compare
> > values there isn't enough space in one src, so we need to add
> > another.
> >
> > Now I've done a special case in the GLSL->TGSI emitter
> > else if (sampler_type->sampler_dimensionality ==
> > GLSL_SAMPLER_DIM_CUBE &&
> >               sampler_type->sampler_array) {
> >       inst = emit(ir, opcode, result_dst, coord, cube_sc);
> >    }
> >
> > However this run into an assert in the later tgsi_ureg.c:validate
> > where the nr_src != info->num_src.
> >
> > So are people okay with always making the TEX opcode take 3 src? or
> > should I fix validate to work around the special case?
> 
> Just to check the impact, it would also move the sampler to the final
> src,
> the way things currently work, which would mean changing all the
> drivers.

Instead of overloading TEX opcode, what about making a special opcode for the compare case, where the reference value is also separate? This seems to be what how D3D10 tokenized form represents it: http://msdn.microsoft.com/en-us/library/windows/desktop/hh447227(v=vs.85).aspx

I think it will be less invasive change, and less hassle, as there is a lot of TGSI parse/analyze/transfor TEX opcodes that would need to be changed.

Jose


More information about the mesa-dev mailing list