summaryrefslogtreecommitdiff
path: root/src/mesa/program/ir_to_mesa.cpp
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-08-22 03:15:00 +0200
committerMarek Olšák <maraeo@gmail.com>2010-08-25 02:44:28 +0200
commit5755d1d6a7ff68c7d690d67c4cd64ef8e01ec2ed (patch)
treef0163e2d6497422f35413d12cfac8c5bcf770b86 /src/mesa/program/ir_to_mesa.cpp
parent57e66ed9b1f6128dc8225477dcb2faa54a4960ac (diff)
ir_to_mesa: set IndirectRegisterFiles
This fixes relative addressing of temporaries (and maybe others) in all gallium drivers. Acked on irc by Eric Anholt.
Diffstat (limited to 'src/mesa/program/ir_to_mesa.cpp')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index da69d26a94..fc145b475e 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2569,6 +2569,14 @@ get_mesa_program(GLcontext *ctx, struct gl_shader_program *shader_program,
mesa_inst->TexShadow = inst->tex_shadow;
mesa_instruction_annotation[i] = inst->ir;
+ /* Set IndirectRegisterFiles. */
+ if (mesa_inst->DstReg.RelAddr)
+ prog->IndirectRegisterFiles |= 1 << mesa_inst->DstReg.File;
+
+ for (unsigned src = 0; src < 3; src++)
+ if (mesa_inst->SrcReg[src].RelAddr)
+ prog->IndirectRegisterFiles |= 1 << mesa_inst->SrcReg[src].File;
+
if (ctx->Shader.EmitNoIfs && mesa_inst->Opcode == OPCODE_IF) {
shader_program->InfoLog =
talloc_asprintf_append(shader_program->InfoLog,