On Fri, Jul 27, 2012 at 10:49:20AM -0700, Kenneth Graunke wrote: > +/** > + * Convert sampler type attributes into an index in the sampler_types array > + */ > +#define SAMPLER_TYPE_INDEX(dim, sample_type, array, shadow) \ > + ((unsigned(dim) * 12) + (sample_type * 4) + (unsigned(array) * 2) \ > + + unsigned(shadow)) > + > +/** > + * \note > + * Arrays like this are \b the argument for C99-style designated > initializers. > + * Too bad C++ and VisualStudio are too cool for that sort of useful > + * functionality. > + */ > +const glsl_type *const glsl_type::sampler_types[] = {
Did you think about using a 4-dimensions array and let the compiler take care of the multiplies? It may not be that much more readable though. > + /* GLSL_SAMPLER_DIM_1D */ > + &builtin_130_types[10], /* uint */ > + NULL, /* uint, shadow */ What does NULL mean? OG. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev