main: Use _mesa_geometric_samples to calculate GL_SAMPLE_BUFFERS
authorNeil Roberts <neil@linux.intel.com>
Thu, 4 Feb 2016 16:12:05 +0000 (16:12 +0000)
committerNeil Roberts <neil@linux.intel.com>
Fri, 5 Feb 2016 11:05:01 +0000 (11:05 +0000)
Otherwise it won't take into account the default samples for
framebuffers with no attachments.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/main/get.c
src/mesa/main/get_hash_params.py

index 73aa8c5f82c5ca0d368c0eaa83df8f467e397d4f..73ff0b9687a2307461acc9032e07cd615d139543 100644 (file)
@@ -1089,6 +1089,9 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
    case GL_SAMPLES:
       v->value_int = _mesa_geometric_samples(ctx->DrawBuffer);
       break;
+   case GL_SAMPLE_BUFFERS:
+      v->value_int = _mesa_geometric_samples(ctx->DrawBuffer) > 0;
+      break;
    }
 }
 
index 346c2eca80bcc8e4ad4d8f1207878c1fd5ec80c7..1c034b5bcf19a0d33fa54c3b422e1f8b43e50f25 100644 (file)
@@ -80,7 +80,7 @@ descriptor=[
   [ "SAMPLE_COVERAGE_ARB", "CONTEXT_BOOL(Multisample.SampleCoverage), NO_EXTRA" ],
   [ "SAMPLE_COVERAGE_VALUE_ARB", "CONTEXT_FLOAT(Multisample.SampleCoverageValue), NO_EXTRA" ],
   [ "SAMPLE_COVERAGE_INVERT_ARB", "CONTEXT_BOOL(Multisample.SampleCoverageInvert), NO_EXTRA" ],
-  [ "SAMPLE_BUFFERS_ARB", "BUFFER_INT(Visual.sampleBuffers), extra_new_buffers" ],
+  [ "SAMPLE_BUFFERS_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_new_buffers" ],
   [ "SAMPLES_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_new_buffers" ],
 
 # GL_ARB_sample_shading