From 4412f3bc13886751f91f265babd78bac28c7ba41 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 29 Mar 2013 16:22:09 +1300 Subject: mesa: provide default implementation of QuerySamplesForFormat Previously at least i915 failed to provide an implementation, but exposed ARB_internalformat_query anyway, leading to crashes when QueryInternalformativ was called. Default implementation just returns 1 for everything, so is suitable for any driver which does not support multisampling. V2: - Move from intel to core mesa. Signed-off-by: Chris Forbes Reviewed-by: Kenneth Graunke --- src/mesa/main/formatquery.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mesa/main/formatquery.c') diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index 78c5fbe5e2b..e45dc868060 100644 --- a/src/mesa/main/formatquery.c +++ b/src/mesa/main/formatquery.c @@ -30,6 +30,21 @@ #include "fbobject.h" #include "formatquery.h" +/* default implementation of QuerySamplesForFormat driverfunc, for + * non-multisample-capable drivers. */ +size_t +_mesa_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 GLAPIENTRY _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params) -- cgit v1.2.3