mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
st/glsl_to_tgsi: fix conditional assignments to packed shader outputs
Overriding the default (no-op) swizzle is clearly counter-productive,
since the whole point is putting the destination register as one of
the source operands so that it remains unmodified when the assignment
condition is false.
Fragment depth and stencil outputs are a special case due to how their
source swizzles are manipulated in translate_src when compiling to
TGSI.
Fixes dEQP-GLES2.functional.shaders.conditionals.if.*_vertex
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
(cherry picked from commit 8ea7d3a5c8)
This commit is contained in:
parent
f6d64c7dc1
commit
f5cbe1f9b8
1 changed files with 9 additions and 1 deletions
|
|
@ -3143,7 +3143,15 @@ glsl_to_tgsi_visitor::emit_block_mov(ir_assignment *ir, const struct glsl_type *
|
|||
r->type = type->base_type;
|
||||
if (cond) {
|
||||
st_src_reg l_src = st_src_reg(*l);
|
||||
l_src.swizzle = swizzle_for_size(type->vector_elements);
|
||||
|
||||
if (l_src.file == PROGRAM_OUTPUT &&
|
||||
this->prog->Target == GL_FRAGMENT_PROGRAM_ARB &&
|
||||
(l_src.index == FRAG_RESULT_DEPTH || l_src.index == FRAG_RESULT_STENCIL)) {
|
||||
/* This is a special case because the source swizzles will be shifted
|
||||
* later to account for the difference between GLSL (where they're
|
||||
* plain floats) and TGSI (where they're Z and Y components). */
|
||||
l_src.swizzle = SWIZZLE_XXXX;
|
||||
}
|
||||
|
||||
if (native_integers) {
|
||||
emit_asm(ir, TGSI_OPCODE_UCMP, *l, *cond,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue