summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2012-02-14 12:43:21 -0800
committerKenneth Graunke <kenneth@whitecape.org>2012-02-15 17:17:16 -0800
commit740123fff754fac9da3e9807e2fcd05d66690866 (patch)
tree519e66f1b88644a3505937953a466c2e7f26336d
parentff1d9450321d5fe164611f819ee299706d9cbe02 (diff)
i965/fs: Add a new fs_inst::regs_written function.
Certain instructions write more than one register. Texturing, for example, returns 4 registers. (We set rlen to 4 even for TXS and float shadow sampling.) Some math functions return 2. Most return 1. The next commit introduces a use of this function. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 8ab02b511882857a09fceed0e93bf4a0b25c17b2)
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index 5fdc055770a..9a2cc08b631 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -286,6 +286,18 @@ public:
offset == inst->offset);
}
+ int regs_written()
+ {
+ if (is_tex())
+ return 4;
+
+ /* The SINCOS and INT_DIV_QUOTIENT_AND_REMAINDER math functions return 2,
+ * but we don't currently use them...nor do we have an opcode for them.
+ */
+
+ return 1;
+ }
+
bool is_tex()
{
return (opcode == SHADER_OPCODE_TEX ||