From c53b846aec02ae5a430fcdb13d3a32701507cc99 Mon Sep 17 00:00:00 2001 From: Italo Nicola Date: Thu, 10 Feb 2022 17:14:18 -0300 Subject: [PATCH] shader: avoid trying to pre-link a TCS when a TES is not present MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is not valid to link a program that has a TCS but no TES, therefore we shouldn't attempt to pre-link this combination of shaders. Signed-off-by: Italo Nicola Reviewed-by: Corentin Noël Reviewed-by: Gert Wollny --- src/vrend_renderer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index b964b95..11cfdd2 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -4826,6 +4826,10 @@ void vrend_link_program(struct vrend_context *ctx, uint32_t *handles) if (!handles[PIPE_SHADER_VERTEX] || !handles[PIPE_SHADER_FRAGMENT]) return; + /* We can't link a pre-link a TCS without a TES, exit early */ + if (handles[PIPE_SHADER_TESS_CTRL] && !handles[PIPE_SHADER_TESS_EVAL]) + return; + struct vrend_shader_selector *prev_handles[PIPE_SHADER_TYPES]; memset(prev_handles, 0, sizeof(prev_handles)); uint32_t prev_shader_ids[PIPE_SHADER_TYPES];