[Mesa-dev] [PATCH 28/30] glsl/cs: Prohibit mixing of compute and non-compute shaders.
Jordan Justen
jljusten at gmail.com
Sat Feb 1 22:36:32 PST 2014
27-28 Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
On Thu, Jan 9, 2014 at 6:19 PM, Paul Berry <stereotype441 at gmail.com> wrote:
> Fixes piglit test:
> spec/ARB_compute_shader/linker/mix_compute_and_non_compute
> ---
> src/glsl/linker.cpp | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index 11e0651..f1344ea 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -2107,6 +2107,13 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
> goto done;
> }
>
> + /* Compute shaders have additional restrictions. */
> + if (num_shaders[MESA_SHADER_COMPUTE] > 0 &&
> + num_shaders[MESA_SHADER_COMPUTE] != prog->NumShaders) {
> + linker_error(prog, "Compute shaders may not be linked with any other "
> + "type of shader\n");
> + }
> +
> for (unsigned int i = 0; i < MESA_SHADER_STAGES; i++) {
> if (prog->_LinkedShaders[i] != NULL)
> ctx->Driver.DeleteShader(ctx, prog->_LinkedShaders[i]);
> --
> 1.8.5.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list