[Mesa-dev] [PATCH 2/2] mesa: move non-generic multisample validation

Timothy Arceri t_arceri at yahoo.com.au
Thu Aug 13 01:53:51 PDT 2015


---
 src/mesa/main/fbobject.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

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;
-- 
2.4.3



More information about the mesa-dev mailing list