[Mesa-dev] [PATCH 02/23] glsl: Add image type to the GLSL IR.

Francisco Jerez currojerez at riseup.net
Thu Dec 12 08:29:38 PST 2013


Paul Berry <stereotype441 at gmail.com> writes:

> On 26 November 2013 00:02, Francisco Jerez <currojerez at riseup.net> wrote:
>
>>
>> +enum glsl_image_dim {
>> +   GLSL_IMAGE_DIM_1D,
>> +   GLSL_IMAGE_DIM_2D,
>> +   GLSL_IMAGE_DIM_3D,
>> +   GLSL_IMAGE_DIM_RECT,
>> +   GLSL_IMAGE_DIM_CUBE,
>> +   GLSL_IMAGE_DIM_BUFFER,
>> +   GLSL_IMAGE_DIM_MS
>> +};
>> +
>>
>
> glsl_image_dim seems redundant  with glsl_sampler_dim (they are identical
> except that the order is different, and glsl_sampler_dim includes the extra
> value GLSL_SAMPLER_DIM_EXTERNAL).  I'd prefer to just use one enum for both
> purposes, and don't create any image types using GLSL_SAMPLER_DIM_EXTERNAL.
>

This was a deliberate change.  My intention was to be able to refer to a
surface dimensionality and whether it's an image or sampler type with a
single identifier.  If we use the same type for both we will have to
find another way for overload selection and that will probably make the
notation in the builtin_type_macros.h code in PATCH 16 inconsistent with
the macros for sampler types, unless we change the sampler glsl_type
constructor too.

> With that changed, this patch is:
>
> Reviewed-by: Paul Berry <stereotype441 at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131212/d94868c4/attachment.pgp>


More information about the mesa-dev mailing list