mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
glsl: Fix handling of OPCODE_PRINT for no registers case.
A register file value is unsigned so could never be -1. A value of 0 also aliased to PROGRAM_TEMPORARY. If an OPCODE_PRINT has no registers to print, set the register file value to PROGRAM_UNDEFINED and check for that value when executing this instruction.
This commit is contained in:
parent
4485dd8a3e
commit
4e98116c23
2 changed files with 2 additions and 2 deletions
|
|
@ -1096,7 +1096,7 @@ Parse_PrintInstruction(struct parse_state *parseState, struct prog_instruction *
|
|||
}
|
||||
}
|
||||
else {
|
||||
srcReg->File = 0;
|
||||
srcReg->File = PROGRAM_UNDEFINED;
|
||||
}
|
||||
|
||||
/* semicolon */
|
||||
|
|
|
|||
|
|
@ -1767,7 +1767,7 @@ _mesa_execute_program(GLcontext * ctx,
|
|||
break;
|
||||
case OPCODE_PRINT:
|
||||
{
|
||||
if (inst->SrcReg[0].File != -1) {
|
||||
if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
|
||||
GLfloat a[4];
|
||||
fetch_vector4(&inst->SrcReg[0], machine, a);
|
||||
printf("%s%g, %g, %g, %g\n", (const char *) inst->Data,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue