[Mesa-dev] [PATCH 1/7] glsl: Return correct number of coordinate components for cubemap array images.
currojerez at riseup.net
Sun Feb 1 04:20:01 PST 2015
Ian Romanick <idr at freedesktop.org> writes:
> On 01/31/2015 09:54 PM, Francisco Jerez wrote:
>> Cubemap array images are unlike cubemap array samplers in that they don't need
>> an additional coordinate to index individual cubemaps in the array, instead
>> they behave like a 2D array of 6n layers, with n the number of cubemaps in the
>> array. Take this exception into account.
>> src/glsl/glsl_types.cpp | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>> diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
>> index b4223f4..61d785a 100644
>> --- a/src/glsl/glsl_types.cpp
>> +++ b/src/glsl/glsl_types.cpp
>> @@ -1225,8 +1225,13 @@ glsl_type::coordinate_components() const
>> - /* Array textures need an additional component for the array index. */
>> - if (sampler_array)
>> + /* Array textures need an additional component for the array index, */
>> + if (sampler_array &&
>> + /* except for cubemap array images that behave like a 2D array of
>> + * interleaved cubemap faces.
>> + */
> Breaking up the if condition with a comment makes this read weird. Can
> you put this up with the other part of the comment?
Right, I've fixed it locally.
> I think src/glsl/tests/sampler_types_test.cpp may need to be updated
> too. Did you 'make check'? I guess that test might only check texture
> samplers and not image samplers, so it might be fine.
> Assuming 'make check' is fine, with the comment moved this patch is
Yes, 'make check' seems to be fine.
> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
>> + !(base_type == GLSL_TYPE_IMAGE &&
>> + sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE))
>> size += 1;
>> return size;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 212 bytes
Desc: not available
More information about the mesa-dev