[Mesa-dev] [PATCH] i965: Only turn on ARB_compute_shader if we can write registers.

Francisco Jerez currojerez at riseup.net
Tue Jan 5 07:47:44 PST 2016


Kenneth Graunke <kenneth at whitecape.org> writes:

> Compute shaders require reconfiguring the L3 for shared local memory
> support.  We have to be able to write the L3 registers to do that.
>
> This effectively turns off compute shaders prior to Kernel 4.2.
>
> (Previously, the extension enable was in an API_OPENGL_CORE conditional.
> However, that isn't necessary - core Mesa extension handling already
> restricts it properly.  I've moved it out in this patch.)
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>

LGTM,

Reviewed-by: Francisco Jerez <currojerez at riseup.net>

> ---
>  src/mesa/drivers/dri/i965/intel_extensions.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> Tested with Kernel 3.18 (no longer enabled) and 4.3 (still enabled)
> on a Haswell laptop.
>
> diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c
> index e1338e9..889f7cb 100644
> --- a/src/mesa/drivers/dri/i965/intel_extensions.c
> +++ b/src/mesa/drivers/dri/i965/intel_extensions.c
> @@ -346,6 +346,9 @@ intelInitExtensions(struct gl_context *ctx)
>           ctx->Extensions.ARB_transform_feedback3 = true;
>           ctx->Extensions.ARB_transform_feedback_instanced = true;
>  
> +         if (ctx->Const.MaxComputeWorkGroupSize[0] >= 1024)
> +            ctx->Extensions.ARB_compute_shader = true;
> +
>           if (brw->intelScreen->cmd_parser_version >= 2)
>              brw->predicate.supported = true;
>        }
> @@ -357,8 +360,6 @@ intelInitExtensions(struct gl_context *ctx)
>           ctx->Extensions.ARB_viewport_array = true;
>           ctx->Extensions.AMD_vertex_shader_viewport_index = true;
>           ctx->Extensions.ARB_shader_subroutine = true;
> -         if (ctx->Const.MaxComputeWorkGroupSize[0] >= 1024)
> -            ctx->Extensions.ARB_compute_shader = true;
>        }
>     }
>  
> -- 
> 2.2.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20160105/3ec90622/attachment.sig>


More information about the mesa-dev mailing list