summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authorTimothy Arceri <t_arceri@yahoo.com.au>2015-08-13 18:44:51 +1000
committerTimothy Arceri <t_arceri@yahoo.com.au>2015-08-18 07:07:57 +1000
commit46684d3ae3a4084b00355df3feeeb25159656a8e (patch)
treeb75fe0472aecbdd6ce0935f73db52999716e19ab /src/mesa/main/fbobject.c
parentd3ace603a97bdd031bdff7517728eff4d0fd6458 (diff)
downloadexternal_mesa3d-46684d3ae3a4084b00355df3feeeb25159656a8e.zip
external_mesa3d-46684d3ae3a4084b00355df3feeeb25159656a8e.tar.gz
external_mesa3d-46684d3ae3a4084b00355df3feeeb25159656a8e.tar.bz2
mesa: move non-generic samples validation
The previous patch replaces the other use case. V2: remove the validation from it old location. Cc: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r--src/mesa/main/fbobject.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 8418340..07db195 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2033,6 +2033,16 @@ renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
*/
sample_count_error = _mesa_check_sample_count(ctx, GL_RENDERBUFFER,
internalFormat, samples);
+
+ /* Section 2.5 (GL Errors) of OpenGL 3.0 specification, page 16:
+ *
+ * "If a negative number is provided where an argument of type sizei or
+ * sizeiptr is specified, the error INVALID VALUE is generated."
+ */
+ if (samples < 0) {
+ sample_count_error = GL_INVALID_VALUE;
+ }
+
if (sample_count_error != GL_NO_ERROR) {
_mesa_error(ctx, sample_count_error, "%s(samples)", func);
return;