Mesa (master): i915: Texture instructions use r/t/oC/ oD register as texture coordinate.
Haihao Xiang
haihao at kemper.freedesktop.org
Mon Oct 13 05:12:29 UTC 2008
Module: Mesa
Branch: master
Commit: c238098bbcfb644ea01b33d3274b949d84822512
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c238098bbcfb644ea01b33d3274b949d84822512
Author: Xiang, Haihao <haihao.xiang at intel.com>
Date: Mon Oct 13 13:04:04 2008 +0800
i915: Texture instructions use r/t/oC/oD register as texture coordinate.
Fix http://bugs.freedesktop.org/show_bug.cgi?id=16287.
---
src/mesa/drivers/dri/i915/i915_program.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c
index 350da5e..e87700f 100644
--- a/src/mesa/drivers/dri/i915/i915_program.c
+++ b/src/mesa/drivers/dri/i915/i915_program.c
@@ -245,6 +245,19 @@ GLuint i915_emit_texld( struct i915_fragment_program *p,
*/
assert(GET_UREG_TYPE(coord) != REG_TYPE_U);
+ if ((GET_UREG_TYPE(coord) != REG_TYPE_R) &&
+ (GET_UREG_TYPE(coord) != REG_TYPE_OC) &&
+ (GET_UREG_TYPE(coord) != REG_TYPE_OD) &&
+ (GET_UREG_TYPE(coord) != REG_TYPE_T)) {
+ GLuint tmpCoord = get_free_rreg(p, live_regs);
+
+ if (tmpCoord == UREG_BAD)
+ return 0;
+
+ i915_emit_arith(p, A0_MOV, tmpCoord, A0_DEST_CHANNEL_ALL, 0, coord, 0, 0);
+ coord = tmpCoord;
+ }
+
/* Output register being oC or oD defines a phase boundary */
if (GET_UREG_TYPE(dest) == REG_TYPE_OC ||
GET_UREG_TYPE(dest) == REG_TYPE_OD)
More information about the mesa-commit
mailing list