Mesa (master): mesa: move non-generic samples validation

Timothy Arceri tarceri at kemper.freedesktop.org
Mon Aug 17 21:08:18 UTC 2015


Module: Mesa
Branch: master
Commit: 46684d3ae3a4084b00355df3feeeb25159656a8e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=46684d3ae3a4084b00355df3feeeb25159656a8e

Author: Timothy Arceri <t_arceri at yahoo.com.au>
Date:   Thu Aug 13 18:44:51 2015 +1000

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 at intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>

---

 src/mesa/main/fbobject.c    |   10 ++++++++++
 src/mesa/main/multisample.c |    9 ---------
 2 files changed, 10 insertions(+), 9 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;
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index 09e6154..e7783ea 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -150,15 +150,6 @@ GLenum
 _mesa_check_sample_count(struct gl_context *ctx, GLenum target,
                          GLenum internalFormat, GLsizei 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) {
-      return GL_INVALID_VALUE;
-   }
-
    /* Section 4.4 (Framebuffer objects), page 198 of the OpenGL ES 3.0.0
     * specification says:
     *




More information about the mesa-commit mailing list