From 6bf1c93fe07603b3bcc9de88ce92cec61954bb4a Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 22 Jan 2018 14:41:25 +1100 Subject: [PATCH] radeonsi/nir: fix fs output index MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes the following piglit tests: arb_blend_func_extended-fbo-extended-blend arb_blend_func_extended-fbo-extended-blend-explicit arb_blend_func_extended-fbo-extended-blend-explicit_gles3 arb_blend_func_extended-fbo-extended-blend-pattern arb_blend_func_extended-fbo-extended-blend-pattern_gles2 arb_blend_func_extended-fbo-extended-blend-pattern_gles3 arb_blend_func_extended-fbo-extended-blend_gles3 ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend ext_framebuffer_multisample/alpha-to-one-dual-src-blend Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_shader_nir.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 97b647434b6..8784117833e 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -317,6 +317,11 @@ void si_nir_scan_shader(const struct nir_shader *nir, if (nir->info.stage == MESA_SHADER_FRAGMENT) { tgsi_get_gl_frag_result_semantic(variable->data.location, &semantic_name, &semantic_index); + + /* Adjust for dual source blending */ + if (variable->data.index > 0) { + semantic_index++; + } } else { tgsi_get_gl_varying_semantic(variable->data.location, true, &semantic_name, &semantic_index); -- 2.30.2