Mesa (master): st/mesa: advertise ARB_ES3_compatibility if GLSL 3.30 and ETC2 are supported
Marek Olšák
mareko at kemper.freedesktop.org
Mon Aug 11 19:59:27 UTC 2014
Module: Mesa
Branch: master
Commit: 3d56732c1fa1e021341fff33404e1c6bc41ec991
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3d56732c1fa1e021341fff33404e1c6bc41ec991
Author: Marek Olšák <marek.olsak at amd.com>
Date: Sat Aug 2 22:32:25 2014 +0200
st/mesa: advertise ARB_ES3_compatibility if GLSL 3.30 and ETC2 are supported
---
docs/GL3.txt | 2 +-
docs/relnotes/10.3.html | 1 +
src/mesa/state_tracker/st_extensions.c | 28 ++++++++++++++++++++++++++++
3 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/docs/GL3.txt b/docs/GL3.txt
index 3d610f6..2143c6f 100644
--- a/docs/GL3.txt
+++ b/docs/GL3.txt
@@ -147,7 +147,7 @@ GL 4.2, GLSL 4.20:
GL 4.3, GLSL 4.30:
GL_ARB_arrays_of_arrays started (Timothy)
- GL_ARB_ES3_compatibility DONE (i965)
+ GL_ARB_ES3_compatibility DONE (all drivers that support GLSL 3.30)
GL_ARB_clear_buffer_object DONE (all drivers)
GL_ARB_compute_shader started (currently stalled)
GL_ARB_copy_image DONE (i965)
diff --git a/docs/relnotes/10.3.html b/docs/relnotes/10.3.html
index f023ca6..c0828da 100644
--- a/docs/relnotes/10.3.html
+++ b/docs/relnotes/10.3.html
@@ -44,6 +44,7 @@ Note: some of the new features are only available with certain drivers.
</p>
<ul>
+<li>GL_ARB_ES3_compatibility on nv50, nvc0, r600, radeonsi, softpipe, llvmpipe</li>
<li>GL_ARB_compressed_texture_pixel_storage on all drivers</li>
<li>GL_ARB_draw_indirect on nvc0, radeonsi</li>
<li>GL_ARB_explicit_uniform_location (all drivers that support GLSL)</li>
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 7ac4840..3974adb 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -826,4 +826,32 @@ void st_init_extensions(struct st_context *st)
}
if (ctx->Const.MaxProgramTextureGatherComponents > 0)
ctx->Extensions.ARB_texture_gather = GL_TRUE;
+
+ /* GL_ARB_ES3_compatibility.
+ *
+ * Assume that ES3 is supported if GLSL 3.30 is supported.
+ * (OpenGL 3.3 is a requirement for that extension.)
+ */
+ if (ctx->Const.GLSLVersion >= 330 &&
+ /* Requirements for ETC2 emulation. */
+ screen->is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_R16_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_R16G16_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_R16_SNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW) &&
+ screen->is_format_supported(screen, PIPE_FORMAT_R16G16_SNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.ARB_ES3_compatibility = GL_TRUE;
+ }
}
More information about the mesa-commit
mailing list