[Mesa-dev] [PATCH] ir_to_mesa: set IndirectRegisterFiles

Marek Olšák maraeo at gmail.com
Sat Aug 21 19:05:58 PDT 2010


This fixes relative addressing of temporaries (and maybe others)
in all gallium drivers.
---
 src/mesa/program/ir_to_mesa.cpp |    8 ++++++++
 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 9fdeaa9..d5d72c9 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2510,6 +2510,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,
-- 
1.7.0.4



More information about the mesa-dev mailing list