Mesa (master): main: Use _mesa_geometric_samples to calculate GL_SAMPLE_BUFFERS

Neil Roberts nroberts at kemper.freedesktop.org
Fri Feb 5 11:14:00 UTC 2016


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

Author: Neil Roberts <neil at linux.intel.com>
Date:   Thu Feb  4 16:12:05 2016 +0000

main: Use _mesa_geometric_samples to calculate GL_SAMPLE_BUFFERS

Otherwise it won't take into account the default samples for
framebuffers with no attachments.

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/mesa/main/get.c              | 3 +++
 src/mesa/main/get_hash_params.py | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 73aa8c5..73ff0b9 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -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;
    }
 }
 
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 346c2ec..1c034b5 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -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




More information about the mesa-commit mailing list