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

Author: Neil Roberts <n...@linux.intel.com>
Date:   Thu Feb  4 16:12:04 2016 +0000

main: Use _mesa_geometric_samples to calculate the value of GL_SAMPLES

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

Reviewed-by: Ilia Mirkin <imir...@alum.mit.edu>

---

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

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index f78a98b..73aa8c5 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1085,6 +1085,10 @@ find_custom_value(struct gl_context *ctx, const struct 
value_desc *d, union valu
    case GL_DISPATCH_INDIRECT_BUFFER_BINDING:
       v->value_int = ctx->DispatchIndirectBuffer->Name;
       break;
+   /* GL_ARB_multisample */
+   case GL_SAMPLES:
+      v->value_int = _mesa_geometric_samples(ctx->DrawBuffer);
+      break;
    }
 }
 
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index fa07ee3..346c2ec 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -81,7 +81,7 @@ descriptor=[
   [ "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" ],
-  [ "SAMPLES_ARB", "BUFFER_INT(Visual.samples), extra_new_buffers" ],
+  [ "SAMPLES_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_new_buffers" ],
 
 # GL_ARB_sample_shading
   [ "SAMPLE_SHADING_ARB", "CONTEXT_BOOL(Multisample.SampleShading), 
extra_gl40_ARB_sample_shading" ],

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to