mesa: only check sample count if we actually wanted multisampling
authorChris Forbes <chrisf@ijw.co.nz>
Mon, 25 Mar 2013 10:19:07 +0000 (23:19 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Tue, 26 Mar 2013 18:49:12 +0000 (07:49 +1300)
Fixes various test fallout from 90b5a2425a on Pineview, which claims to
support ARB_internalformat_query but doesn't actually provide the
driverfunc.

That driver is still broken [GetInternalformativ will still segfault!]
but it was silly to be going through the sample count logic in the
nonmultisampling case at all.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/fbobject.c

index 3fdf62667b9b1464631154bda5f0f2ad7f1d93e7..c1f52990c606036ae7a8bd1393adde43f10b9348 100644 (file)
@@ -1537,15 +1537,16 @@ renderbuffer_storage(GLenum target, GLenum internalFormat,
       /* NumSamples == 0 indicates non-multisampling */
       samples = 0;
    }
-
-   /* check the sample count;
-    * note: driver may choose to use more samples than what's requested
-    */
-   sample_count_error = _mesa_check_sample_count(ctx, target,
-         internalFormat, samples);
-   if (sample_count_error != GL_NO_ERROR) {
-      _mesa_error(ctx, sample_count_error, "%s(samples)", func);
-      return;
+   else {
+      /* check the sample count;
+       * note: driver may choose to use more samples than what's requested
+       */
+      sample_count_error = _mesa_check_sample_count(ctx, target,
+            internalFormat, samples);
+      if (sample_count_error != GL_NO_ERROR) {
+         _mesa_error(ctx, sample_count_error, "%s(samples)", func);
+         return;
+      }
    }
 
    rb = ctx->CurrentRenderbuffer;