Mesa (master): i965/blorp: Fix the register types on blorp's push constants .

Eric Anholt anholt at kemper.freedesktop.org
Wed Oct 9 18:58:29 UTC 2013


Module: Mesa
Branch: master
Commit: 58bab95c958ee016e82f9fae3c84167de6727048
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=58bab95c958ee016e82f9fae3c84167de6727048

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Aug 29 15:08:41 2013 -0700

i965/blorp: Fix the register types on blorp's push constants.

The UD values were getting set up as floats.  This happened to work out
because they were used as the second argument where the first was a dword,
and gen6+ doesn't do source conversions.  But it did trigger fulsim
warnings, and it meant if you used the push constant as the first operand
you would have been disappointed.

Reviewed-by: Paul Berry <stereotype441 at gmail.com>

---

 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp |   32 +++++++++++++-------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 027c72e..12e7698 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -899,22 +899,22 @@ void
 brw_blorp_blit_program::alloc_push_const_regs(int base_reg)
 {
 #define CONST_LOC(name) offsetof(brw_blorp_wm_push_constants, name)
-#define ALLOC_REG(name) \
-   this->name = \
-      brw_vec1_reg(BRW_GENERAL_REGISTER_FILE, \
-                   base_reg + CONST_LOC(name) / 32, \
-                   (CONST_LOC(name) % 32) / 4)
-
-   ALLOC_REG(dst_x0);
-   ALLOC_REG(dst_x1);
-   ALLOC_REG(dst_y0);
-   ALLOC_REG(dst_y1);
-   ALLOC_REG(rect_grid_x1);
-   ALLOC_REG(rect_grid_y1);
-   ALLOC_REG(x_transform.multiplier);
-   ALLOC_REG(x_transform.offset);
-   ALLOC_REG(y_transform.multiplier);
-   ALLOC_REG(y_transform.offset);
+#define ALLOC_REG(name, type)                                   \
+   this->name =                                                 \
+      retype(brw_vec1_reg(BRW_GENERAL_REGISTER_FILE,            \
+                          base_reg + CONST_LOC(name) / 32,      \
+                          (CONST_LOC(name) % 32) / 4), type)
+
+   ALLOC_REG(dst_x0, BRW_REGISTER_TYPE_UD);
+   ALLOC_REG(dst_x1, BRW_REGISTER_TYPE_UD);
+   ALLOC_REG(dst_y0, BRW_REGISTER_TYPE_UD);
+   ALLOC_REG(dst_y1, BRW_REGISTER_TYPE_UD);
+   ALLOC_REG(rect_grid_x1, BRW_REGISTER_TYPE_F);
+   ALLOC_REG(rect_grid_y1, BRW_REGISTER_TYPE_F);
+   ALLOC_REG(x_transform.multiplier, BRW_REGISTER_TYPE_F);
+   ALLOC_REG(x_transform.offset, BRW_REGISTER_TYPE_F);
+   ALLOC_REG(y_transform.multiplier, BRW_REGISTER_TYPE_F);
+   ALLOC_REG(y_transform.offset, BRW_REGISTER_TYPE_F);
 #undef CONST_LOC
 #undef ALLOC_REG
 }




More information about the mesa-commit mailing list