From 27fd6919684ac613bf884ecb294470f097e7a9c7 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Mon, 27 Jan 2020 09:26:35 -0500 Subject: [PATCH] Add FIXME for preshader output registers --- mojoshader_effects.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mojoshader_effects.c b/mojoshader_effects.c index f3d714d8..474ae7eb 100644 --- a/mojoshader_effects.c +++ b/mojoshader_effects.c @@ -39,6 +39,17 @@ void MOJOSHADER_runPreshader(const MOJOSHADER_preshader *preshader, MOJOSHADER_preshaderInstruction *inst = preshader->instructions; int instit; +#if 0 // FIXME: Do we need to do this or is the compiler smart enough? + // Clear preshader output registers first! + for (instit = 0; instit < preshader->instruction_count; instit++, inst++) + { + const MOJOSHADER_preshaderOperand *operand = &inst->operands[inst->operand_count - 1]; + if (operand->type == MOJOSHADER_PRESHADEROPERAND_OUTPUT) + memset(&outregs[operand->index], '\0', sizeof(float) * 4); + } // for + inst = preshader->instructions; +#endif + for (instit = 0; instit < preshader->instruction_count; instit++, inst++) { const MOJOSHADER_preshaderOperand *operand = inst->operands;