[Mesa-dev] [PATCH 05/10] glsl: add ARB_texture_cube_map_array support
Dave Airlie
airlied at gmail.com
Thu Nov 8 15:13:00 PST 2012
>
> While you're correct that the extension spec (as well as GLSL 4.00, 4.10,
> and 4.20) only mention textureSize for these two types, I believe it was
> simply a typo that got overlooked. The GLSL 4.30 specification adds
> textureSize for isamplerCubeArray and usamplerCubeArray as well, and states
> "Clarify textureSize() for cube map arrays." So I think they should have
> been present all along.
Wierdly I read this, added tests to piglit, forgot I read it, removed
test case from piglit, so I think I'll add them back,
>
>
>> + vec4 texture( samplerCubeArray sampler, vec4 coord);
>> + vec4 texture( samplerCubeArray sampler, vec4 coord, float bias);
>> +float texture( samplerCubeArrayShadow sampler, vec4 P, float compare);
>> +
>> + vec4 textureGrad( samplerCubeArray sampler, vec4 P, vec3 dPdx, vec3
>> dPdy);
>> +
>> + vec4 textureLod( samplerCubeArray sampler, vec4 P, float lod);
>
>
> You're missing the isamplerCubeArray and usamplerCubeArray variants of these
> functions. (And unlike for textureSize, they're actually listed in the
> extension spec...)
Yup wierd I forgot them here, but I dealt with them properly in the
generation scripts.
>diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
>> index 2aa51f0..3940a12 100644
>> --- a/src/glsl/glsl_types.cpp
>> +++ b/src/glsl/glsl_types.cpp
>> @@ -142,7 +142,7 @@ glsl_type::sampler_index() const
>> case GLSL_SAMPLER_DIM_3D:
>> return TEXTURE_3D_INDEX;
>> case GLSL_SAMPLER_DIM_CUBE:
>> - return TEXTURE_CUBE_INDEX;
>> + return (t->sampler_array) ? TEXTURE_CUBE_ARRAY_INDEX :
>> TEXTURE_CUBE_INDEX;
>
>
> No need for the parenthesis (but whatever).
Its consistent with the two cases already in the code above it, you
just can't see them in the diff.
Thanks,
Dave.
More information about the mesa-dev
mailing list