summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/texparam.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 29eed078650..4db406fa9f6 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -934,6 +934,10 @@ _mesa_texture_parameteriv(struct gl_context *ctx,
switch (pname) {
case GL_TEXTURE_BORDER_COLOR:
{
+ if (!_mesa_target_allows_setting_sampler_parameters(texObj->Target)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTextureParameteriv(texture)");
+ return;
+ }
/* convert int params to float */
GLfloat fparams[4];
fparams[0] = INT_TO_FLOAT(params[0]);
@@ -974,6 +978,10 @@ _mesa_texture_parameterIiv(struct gl_context *ctx,
{
switch (pname) {
case GL_TEXTURE_BORDER_COLOR:
+ if (!_mesa_target_allows_setting_sampler_parameters(texObj->Target)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTextureParameterIiv(texture)");
+ return;
+ }
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
/* set the integer-valued border color */
COPY_4V(texObj->Sampler.BorderColor.i, params);
@@ -992,6 +1000,10 @@ _mesa_texture_parameterIuiv(struct gl_context *ctx,
{
switch (pname) {
case GL_TEXTURE_BORDER_COLOR:
+ if (!_mesa_target_allows_setting_sampler_parameters(texObj->Target)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glTextureParameterIuiv(texture)");
+ return;
+ }
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
/* set the unsigned integer-valued border color */
COPY_4V(texObj->Sampler.BorderColor.ui, params);