[Mesa-dev] [PATCH] i965: enable ARB_shader_precision

Alejandro PiƱeiro apinheiro at igalia.com
Mon May 16 13:11:12 UTC 2016

At this moment the documentation says:
  GL_ARB_shader_precision DONE (all drivers that support GLSL 4.10)

On the intel drivers, GLSLVersion is being updated based on the
extensions being completed. So this patch just enables the
extension for GLSLVersion >= 410.

Some extra info:

This was detected when doing a last test with the patch that
expose 4.2 on the vertex_attrib_64bit thread. It assumed that
4.1 was already fulfilled, but ARB_shader_precision is still not
beint exposed.

>From the docs/GL3.txt:
  GL_ARB_shader_precision                               DONE (all drivers that support GLSL 4.10)

And from the commit that made that change:
    "This extension is about setting expectation on GL4.1 implementations
    rather than actually enforcing things. So once you support GLSL 410
    then you support this in theory."

On the intel driver, GLSLVersion is being updated as the extensions for
each version are being completed. So I think that it is reasonable to
just compare agains GLSLVersion >= 410, and enable the extension in that
case, even if it is somewhat a circular reasoning.

We plan to update to GLSLVersion=420 as soon as we land the va64 patches.

 src/mesa/drivers/dri/i965/intel_extensions.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c
index 362a7e5..4634cde 100644
--- a/src/mesa/drivers/dri/i965/intel_extensions.c
+++ b/src/mesa/drivers/dri/i965/intel_extensions.c
@@ -275,6 +275,9 @@ intelInitExtensions(struct gl_context *ctx)
       ctx->Const.GLSLVersion = 120;
+   if (ctx->Const.GLSLVersion >= 410)
+      ctx->Extensions.ARB_shader_precision = true;
    if (brw->gen >= 5) {
       ctx->Extensions.ARB_texture_query_levels = ctx->Const.GLSLVersion >= 130;
       ctx->Extensions.ARB_texture_query_lod = true;

More information about the mesa-dev mailing list