r600g: Handle texture fetch instructions with neg or abs on source register
authorFabian Bieler <der.fabe@gmx.net>
Wed, 23 Mar 2011 22:26:41 +0000 (23:26 +0100)
committerHenri Verbeet <hverbeet@gmail.com>
Sun, 27 Mar 2011 13:00:07 +0000 (15:00 +0200)
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
src/gallium/drivers/r600/r600_shader.c

index 0fe689e2716156b5c7e0a5d8bb43d83ef0b803bd..a835e1c0a382d99aa0e326c512ec53c273e4aa0d 100644 (file)
@@ -1526,10 +1526,12 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
        unsigned src_gpr;
        int r, i;
        int opcode;
-       /* Texture fetch instructions can only use gprs as source. */
+       /* Texture fetch instructions can only use gprs as source.
+        * Also they cannot negate the source or take the absolute value */
        const boolean src_requires_loading =
-               inst->Src[0].Register.File != TGSI_FILE_TEMPORARY &&
-               inst->Src[0].Register.File != TGSI_FILE_INPUT;
+               (inst->Src[0].Register.File != TGSI_FILE_TEMPORARY &&
+               inst->Src[0].Register.File != TGSI_FILE_INPUT) ||
+               ctx->src[0].neg || ctx->src[0].abs;
        boolean src_loaded = FALSE;
 
        src_gpr = ctx->file_offset[inst->Src[0].Register.File] + inst->Src[0].Register.Index;