[Mesa-dev] [PATCH] [RFC] uniforms: accept all int/unsigned int sampler types in uniform checks.
Kenneth Graunke
kenneth at whitecape.org
Wed Sep 14 09:37:23 PDT 2011
On 09/14/2011 06:09 AM, Dave Airlie wrote:
> From: Dave Airlie<airlied at redhat.com>
>
> I'm not 100% sure about this, it may need a version check or it might
> be completely wrong.
>
> Signed-off-by: Dave Airlie<airlied at redhat.com>
> ---
> src/mesa/main/uniforms.c | 16 ++++++++++++++++
> 1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
> index b0f9c33..d574655 100644
> --- a/src/mesa/main/uniforms.c
> +++ b/src/mesa/main/uniforms.c
> @@ -111,21 +111,37 @@ is_sampler_type(GLenum type)
> {
> switch (type) {
> case GL_SAMPLER_1D:
> + case GL_INT_SAMPLER_1D:
> + case GL_UNSIGNED_INT_SAMPLER_1D:
> case GL_SAMPLER_2D:
> + case GL_INT_SAMPLER_2D:
> + case GL_UNSIGNED_INT_SAMPLER_2D:
> case GL_SAMPLER_3D:
> + case GL_INT_SAMPLER_3D:
> + case GL_UNSIGNED_INT_SAMPLER_3D:
> case GL_SAMPLER_CUBE:
> + case GL_INT_SAMPLER_CUBE:
> + case GL_UNSIGNED_INT_SAMPLER_CUBE:
> case GL_SAMPLER_1D_SHADOW:
> case GL_SAMPLER_2D_SHADOW:
> case GL_SAMPLER_CUBE_SHADOW:
> case GL_SAMPLER_2D_RECT_ARB:
> + case GL_INT_SAMPLER_2D_RECT:
> + case GL_UNSIGNED_INT_SAMPLER_2D_RECT:
> case GL_SAMPLER_2D_RECT_SHADOW_ARB:
> case GL_SAMPLER_1D_ARRAY_EXT:
> + case GL_INT_SAMPLER_1D_ARRAY:
> + case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY:
> case GL_SAMPLER_2D_ARRAY_EXT:
> + case GL_INT_SAMPLER_2D_ARRAY:
> + case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
> case GL_SAMPLER_1D_ARRAY_SHADOW_EXT:
> case GL_SAMPLER_2D_ARRAY_SHADOW_EXT:
> case GL_SAMPLER_CUBE_MAP_ARRAY:
> case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW:
> case GL_SAMPLER_BUFFER:
> + case GL_INT_SAMPLER_BUFFER:
> + case GL_UNSIGNED_INT_SAMPLER_BUFFER:
> return GL_TRUE;
> default:
> return GL_FALSE;
While you're here, you might also want to add the ones from
GL_ARB_texture_multisample:
GL_SAMPLER_2D_MULTISAMPLE
GL_INT_SAMPLER_2D_MULTISAMPLE
GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE
GL_SAMPLER_2D_MULTISAMPLE_ARRAY
GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
but that can always be done separately, if you prefer.
Looks good to me. Thanks Dave!
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org.
More information about the mesa-dev
mailing list