mesa: Add a default QueryInternalFormat() function for drivers
authorEduardo Lima Mitev <elima@igalia.com>
Tue, 27 Oct 2015 14:58:59 +0000 (15:58 +0100)
committerEduardo Lima Mitev <elima@igalia.com>
Thu, 3 Mar 2016 14:14:05 +0000 (15:14 +0100)
This is a fallback function for drivers not implementing
ARB_internalformat_query2.

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/mesa/drivers/common/driverfuncs.c
src/mesa/main/formatquery.c
src/mesa/main/formatquery.h

index 752aaf6c006d9fece48841f0776e3587fcf02f8b..e6334d8969b58f6840c32e0f73f4f61504fc607f 100644 (file)
@@ -91,6 +91,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
    /* Texture functions */
    driver->ChooseTextureFormat = _mesa_choose_tex_format;
    driver->QuerySamplesForFormat = _mesa_query_samples_for_format;
+   driver->QueryInternalFormat = _mesa_query_internal_format_default;
    driver->TexImage = _mesa_store_teximage;
    driver->TexSubImage = _mesa_store_texsubimage;
    driver->GetTexSubImage = _mesa_meta_GetTexSubImage;
index 816f12bf9e243a81c3fb9653c40450ad2405ab2f..c99dccbd40f0505de1e4bfef56e1fc231dfcbc58 100644 (file)
@@ -43,6 +43,22 @@ _mesa_query_samples_for_format(struct gl_context *ctx, GLenum target,
    return 1;
 }
 
+/* default implementation of QueryInternalFormat driverfunc, for
+ * drivers not implementing ARB_internalformat_query2.
+ */
+void
+_mesa_query_internal_format_default(struct gl_context *ctx, GLenum target,
+                                    GLenum internalFormat, GLenum pname,
+                                    GLint *params)
+{
+   (void) ctx;
+   (void) target;
+   (void) internalFormat;
+   (void) pname;
+   (void) params;
+
+   /* @TODO */
+}
 
 void GLAPIENTRY
 _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
index 603400059e5c54faa892cb4b3b18620ace879246..b42299e3128f880acb8891c4f8b703a26d5471e7 100644 (file)
@@ -32,6 +32,11 @@ size_t
 _mesa_query_samples_for_format(struct gl_context *ctx, GLenum target,
                                GLenum internalFormat, int samples[16]);
 
+void
+_mesa_query_internal_format_default(struct gl_context *ctx, GLenum target,
+                                    GLenum internalFormat, GLenum pname,
+                                    GLint *params);
+
 extern void GLAPIENTRY
 _mesa_GetInternalformativ(GLenum target, GLenum internalformat,
                           GLenum pname, GLsizei bufSize, GLint *params);