From: Ian Romanick Date: Wed, 22 Jul 2009 19:29:48 +0000 (-0700) Subject: parser: Initialize unused instruction source registers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aec429170681567414de70814f69244758323e75;p=mesa.git parser: Initialize unused instruction source registers The 965 driver expects unused source registers (e.g., SrcReg[2] of a DP3 instruction) to have a register file of PROGRAM_UNDEFINED. Initializing these source registers ensures that this happens. --- diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index bf48b9752fd..cb5fa7cd71c 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -4558,11 +4558,15 @@ asm_instruction_ctor(gl_inst_opcode op, if (src1 != NULL) { inst->Base.SrcReg[1] = src1->Base; inst->SrcReg[1] = *src1; + } else { + init_src_reg(& inst->SrcReg[1]); } if (src2 != NULL) { inst->Base.SrcReg[2] = src2->Base; inst->SrcReg[2] = *src2; + } else { + init_src_reg(& inst->SrcReg[2]); } } diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 0260196210a..fe9022b1218 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1774,11 +1774,15 @@ asm_instruction_ctor(gl_inst_opcode op, if (src1 != NULL) { inst->Base.SrcReg[1] = src1->Base; inst->SrcReg[1] = *src1; + } else { + init_src_reg(& inst->SrcReg[1]); } if (src2 != NULL) { inst->Base.SrcReg[2] = src2->Base; inst->SrcReg[2] = *src2; + } else { + init_src_reg(& inst->SrcReg[2]); } }