[Mesa-dev] [PATCH 4/5] mesa: Only expose GLES's EXT_texture_type_2_10_10_10_REV if supported in HW.
Eric Anholt
eric at anholt.net
Tue May 2 19:33:06 UTC 2017
Previously, we were downconverting to 8888 automatically if the hardware
didn't suport it. However, with the advent of
GL_OES_required_internalformat, we have to actually store the
internalformats we advertise support for. And, it seems rather
disingenuous to advertise the extension if we don't actually support it.
---
src/mesa/drivers/dri/i965/intel_extensions.c | 1 +
src/mesa/main/extensions_table.h | 2 +-
src/mesa/main/mtypes.h | 1 +
src/mesa/state_tracker/st_extensions.c | 5 +++++
4 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c
index 0133fa10068e..20709952ebaf 100644
--- a/src/mesa/drivers/dri/i965/intel_extensions.c
+++ b/src/mesa/drivers/dri/i965/intel_extensions.c
@@ -111,6 +111,7 @@ intelInitExtensions(struct gl_context *ctx)
ctx->Extensions.EXT_texture_sRGB = true;
ctx->Extensions.EXT_texture_sRGB_decode = true;
ctx->Extensions.EXT_texture_swizzle = true;
+ ctx->Extensions.EXT_texture_type_2_10_10_10_REV = true;
ctx->Extensions.EXT_vertex_array_bgra = true;
ctx->Extensions.KHR_robustness = true;
ctx->Extensions.AMD_seamless_cubemap_per_texture = true;
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 528f7308b0e4..fdc163aadb3a 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -279,7 +279,7 @@ EXT(EXT_texture_sRGB_decode , EXT_texture_sRGB_decode
EXT(EXT_texture_shared_exponent , EXT_texture_shared_exponent , GLL, GLC, x , x , 2004)
EXT(EXT_texture_snorm , EXT_texture_snorm , GLL, GLC, x , x , 2009)
EXT(EXT_texture_swizzle , EXT_texture_swizzle , GLL, GLC, x , x , 2008)
-EXT(EXT_texture_type_2_10_10_10_REV , dummy_true , x , x , x , ES2, 2008)
+EXT(EXT_texture_type_2_10_10_10_REV , EXT_texture_type_2_10_10_10_REV , x , x , x , ES2, 2008)
EXT(EXT_timer_query , EXT_timer_query , GLL, GLC, x , x , 2006)
EXT(EXT_transform_feedback , EXT_transform_feedback , GLL, GLC, x , x , 2011)
EXT(EXT_unpack_subimage , dummy_true , x , x , x , ES2, 2011)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 002e692b6994..278fa4367b87 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4055,6 +4055,7 @@ struct gl_extensions
GLboolean EXT_texture_sRGB;
GLboolean EXT_texture_sRGB_decode;
GLboolean EXT_texture_swizzle;
+ GLboolean EXT_texture_type_2_10_10_10_REV;
GLboolean EXT_transform_feedback;
GLboolean EXT_timer_query;
GLboolean EXT_vertex_array_bgra;
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 1df2ba761682..b5d874415eae 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -765,6 +765,11 @@ void st_init_extensions(struct pipe_screen *screen,
PIPE_FORMAT_B8G8R8A8_SRGB },
GL_TRUE }, /* at least one format must be supported */
+ { { o(EXT_texture_type_2_10_10_10_REV) },
+ { PIPE_FORMAT_R10G10B10A2_UNORM,
+ PIPE_FORMAT_B10G10R10A2_UNORM },
+ GL_TRUE }, /* at least one format must be supported */
+
{ { o(ATI_texture_compression_3dc) },
{ PIPE_FORMAT_LATC2_UNORM } },
--
2.11.0
More information about the mesa-dev
mailing list