summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorTimothy Arceri <t_arceri@yahoo.com.au>2015-08-17 21:33:49 +1000
committerTimothy Arceri <t_arceri@yahoo.com.au>2015-08-18 07:07:57 +1000
commitd3ace603a97bdd031bdff7517728eff4d0fd6458 (patch)
treef6ddd2c9eadbfebc90f8339db18ce8acfad10a50 /src/mesa/main/teximage.c
parent2450cbfcbc3671056afad9e858acadbb6edea068 (diff)
downloadexternal_mesa3d-d3ace603a97bdd031bdff7517728eff4d0fd6458.zip
external_mesa3d-d3ace603a97bdd031bdff7517728eff4d0fd6458.tar.gz
external_mesa3d-d3ace603a97bdd031bdff7517728eff4d0fd6458.tar.bz2
mesa: check samples > 0 for glTex*Multisample
The GL 4.5 spec says its an GL_INVALID_VALUE error if samples equals 0 for glTexImage*Multisample and an GL_INVALID_VALUE error if samples < 1 for glTexStorage*Multisample. The spec says its undefined what happens if glTexImage*Multisample is passed a samples value < 0 but we currently already produced a GL_INVALID_VALUE error in this case, this is also consistent with the Nvidia binary. Cc: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 81e9e37..8b2f32a 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -5616,6 +5616,11 @@ texture_image_multisample(struct gl_context *ctx, GLuint dims,
return;
}
+ if (samples < 1) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(samples < 1)", func);
+ return;
+ }
+
if (!check_multisample_target(dims, target, dsa)) {
if (dsa) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(target)", func);