return GL_TRUE;
}
+static GLuint
+set_sampler_srgb_decode(struct gl_context *ctx,
+ struct gl_sampler_object *samp, GLenum param)
+{
+ if (!ctx->Extensions.EXT_texture_sRGB_decode)
+ return INVALID_PNAME;
+
+ if (samp->sRGBDecode == param)
+ return GL_FALSE;
+
+ if (param != GL_DECODE_EXT && param != GL_SKIP_DECODE_EXT)
+ return INVALID_VALUE;
+
+ flush(ctx);
+ samp->sRGBDecode = param;
+ return GL_TRUE;
+}
static void GLAPIENTRY
_mesa_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
res = set_sampler_cube_map_seamless(ctx, sampObj, param);
break;
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ res = set_sampler_srgb_decode(ctx, sampObj, param);
+ break;
case GL_TEXTURE_BORDER_COLOR:
/* fall-through */
default:
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) param);
break;
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ res = set_sampler_srgb_decode(ctx, sampObj, (GLenum) param);
+ break;
case GL_TEXTURE_BORDER_COLOR:
/* fall-through */
default:
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]);
break;
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ res = set_sampler_srgb_decode(ctx, sampObj, params[0]);
+ break;
case GL_TEXTURE_BORDER_COLOR:
{
GLfloat c[4];
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) params[0]);
break;
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ res = set_sampler_srgb_decode(ctx, sampObj, (GLenum) params[0]);
+ break;
case GL_TEXTURE_BORDER_COLOR:
res = set_sampler_border_colorf(ctx, sampObj, params);
break;
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]);
break;
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ res = set_sampler_srgb_decode(ctx, sampObj, (GLenum) params[0]);
+ break;
case GL_TEXTURE_BORDER_COLOR:
res = set_sampler_border_colori(ctx, sampObj, params);
break;
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]);
break;
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ res = set_sampler_srgb_decode(ctx, sampObj, (GLenum) params[0]);
+ break;
case GL_TEXTURE_BORDER_COLOR:
res = set_sampler_border_colorui(ctx, sampObj, params);
break;
goto invalid_pname;
*params = sampObj->CubeMapSeamless;
break;
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ if (!ctx->Extensions.EXT_texture_sRGB_decode)
+ goto invalid_pname;
+ *params = (GLenum) sampObj->sRGBDecode;
+ break;
default:
goto invalid_pname;
}
goto invalid_pname;
*params = (GLfloat) sampObj->CubeMapSeamless;
break;
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ if (!ctx->Extensions.EXT_texture_sRGB_decode)
+ goto invalid_pname;
+ *params = (GLfloat) sampObj->sRGBDecode;
+ break;
default:
goto invalid_pname;
}
goto invalid_pname;
*params = sampObj->CubeMapSeamless;
break;
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ if (!ctx->Extensions.EXT_texture_sRGB_decode)
+ goto invalid_pname;
+ *params = (GLenum) sampObj->sRGBDecode;
+ break;
default:
goto invalid_pname;
}
goto invalid_pname;
*params = sampObj->CubeMapSeamless;
break;
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ if (!ctx->Extensions.EXT_texture_sRGB_decode)
+ goto invalid_pname;
+ *params = (GLenum) sampObj->sRGBDecode;
+ break;
default:
goto invalid_pname;
}