[Mesa-dev] [RFC 53/63] mesa/formatquery: Added texture gather/shadow related queries
Eduardo Lima Mitev
elima at igalia.com
Tue Jan 19 08:42:33 PST 2016
From: Antia Puentes <apuentes at igalia.com>
>From the ARB_internalformat_query2 specification:
"- TEXTURE_SHADOW: The support for using the resource with shadow samplers
is written to <params>.
- TEXTURE_GATHER: The support for using the resource with texture gather
operations is written to <params>.
- TEXTURE_GATHER_SHADOW: The support for using resource with texture gather
operations with shadow samplers is written to <params>."
For all of them,
"Possible values returned are FULL_SUPPORT, CAVEAT_SUPPORT, or NONE.
If the resource or operation is not supported, NONE is returned."
---
src/mesa/main/formatquery.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index d3666d5..a412c3d 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -617,6 +617,9 @@ _mesa_query_internal_format_default(struct gl_context *ctx, GLenum target,
case GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE:
case GL_CLEAR_BUFFER:
case GL_TEXTURE_VIEW:
+ case GL_TEXTURE_SHADOW:
+ case GL_TEXTURE_GATHER:
+ case GL_TEXTURE_GATHER_SHADOW:
params[0] = GL_FULL_SUPPORT;
break;
@@ -1163,15 +1166,17 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
break;
case GL_TEXTURE_SHADOW:
- /* @TODO */
- break;
-
case GL_TEXTURE_GATHER:
- /* @TODO */
- break;
-
case GL_TEXTURE_GATHER_SHADOW:
- /* @TODO */
+ if (target == GL_RENDERBUFFER)
+ goto end;
+
+ if (pname == GL_TEXTURE_GATHER &&
+ !ctx->Extensions.ARB_texture_gather)
+ goto end;
+
+ ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname,
+ buffer);
break;
case GL_SHADER_IMAGE_LOAD:
--
2.5.3
More information about the mesa-dev
mailing list