[Mesa-dev] [PATCH] glsl: Enable split of lower UBOs and SSBO also for compute shaders

Francisco Jerez currojerez at riseup.net
Wed Oct 14 05:59:14 PDT 2015


Hi Marta,

Marta Lofstedt <marta.lofstedt at linux.intel.com> writes:

> From: Marta Lofstedt <marta.lofstedt at intel.com>
>
> The split of Uniform blocks and shader storage block only loops
> up to MESA_SHADER_FRAGMENT and igonres compute shaders.
> This cause segfault when running the OpenGL ES 3.1 CTS tests
> with GL_ARB_compute_shader enabled.
>
> Signed-off-by: Marta Lofstedt <marta.lofstedt at linux.intel.com>
> ---
>  src/glsl/linker.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index c61c76e..5b5d6e6 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -4392,7 +4392,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
>      * for gl_shader_program and gl_shader, so that drivers that need separate
>      * index spaces for each set can have that.
>      */
> -   for (unsigned i = MESA_SHADER_VERTEX; i <= MESA_SHADER_FRAGMENT; i++) {
> +   for (unsigned i = MESA_SHADER_VERTEX; i <= MESA_SHADER_COMPUTE; i++) {

Any reason not to use MESA_SHADER_STAGES as upper bound here so this
doesn't break again if new shader stages are added?

>        if (prog->_LinkedShaders[i] != NULL) {
>           gl_shader *sh = prog->_LinkedShaders[i];
>           split_ubos_and_ssbos(sh,
> -- 
> 2.1.4
>
> _______________________________________________
> 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/20151014/589f73af/attachment.sig>


More information about the mesa-dev mailing list