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

Ilia Mirkin imirkin at alum.mit.edu
Mon May 16 14:14:24 UTC 2016


On Mon, May 16, 2016 at 9:11 AM, Alejandro PiƱeiro <apinheiro at igalia.com> wrote:
> 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;
>     _mesa_override_glsl_version(&ctx->Const);
>
> +   if (ctx->Const.GLSLVersion >= 410)
> +      ctx->Extensions.ARB_shader_precision = true;

FWIW this is the way it was done on st/mesa because I was too lazy to
add a cap, and just used PIPE_CAP_GLSL as a way to know whether it
should be exposed or not. It'd be perfectly fine to expose this even
on drivers that don't otherwise do GL 4.10. [BTW, I'm not for or
against your patch... just providing info.]

> +
>     if (brw->gen >= 5) {
>        ctx->Extensions.ARB_texture_query_levels = ctx->Const.GLSLVersion >= 130;
>        ctx->Extensions.ARB_texture_query_lod = true;
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list