ir_to_mesa: set IndirectRegisterFiles
authorMarek Olšák <maraeo@gmail.com>
Sun, 22 Aug 2010 01:15:00 +0000 (03:15 +0200)
committerMarek Olšák <maraeo@gmail.com>
Wed, 25 Aug 2010 00:44:28 +0000 (02:44 +0200)
This fixes relative addressing of temporaries (and maybe others)
in all gallium drivers.

Acked on irc by Eric Anholt.

src/mesa/program/ir_to_mesa.cpp

index da69d26a94454d4f401bb0ad8f7afd7ca9f43b46..fc145b475ea051382b17eea43897086a64121fab 100644 (file)
@@ -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,