[Mesa-dev] [PATCH] intel: provide a default QuerySamplesForFormat func

Chris Forbes chrisf at ijw.co.nz
Thu Mar 28 00:26:41 PDT 2013


We claim to support ARB_internalformat_query on everything, but only
i965+ bothered to provide the hook -- so QueryInternalformativ() would
just explode (fail the assert in debug; segfault otherwise) on earlier
platforms.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 src/mesa/drivers/dri/intel/intel_context.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index bf4045e..c0574c0 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -557,6 +557,18 @@ intelFinish(struct gl_context * ctx)
       drm_intel_bo_wait_rendering(intel->batch.last_bo);
 }
 
+static size_t
+intel_query_samples_for_format(struct gl_context *ctx, GLenum target,
+                               GLenum internalFormat, int samples[16])
+{
+   (void) target;
+   (void) internalFormat;
+   (void) ctx;
+
+   samples[0] = 1;
+   return 1;
+}
+
 void
 intelInitDriverFunctions(struct dd_function_table *functions)
 {
@@ -576,6 +588,8 @@ intelInitDriverFunctions(struct dd_function_table *functions)
    intelInitPixelFuncs(functions);
    intelInitBufferObjectFuncs(functions);
    intel_init_syncobj_functions(functions);
+
+   functions->QuerySamplesForFormat = intel_query_samples_for_format;
 }
 
 static bool
-- 
1.8.2



More information about the mesa-dev mailing list