Mesa (master): i965: Tidy preprocessor macros for SO_PRIM_STORAGE_NEEDED registers.

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Aug 6 21:47:56 UTC 2013


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Aug  1 15:11:38 2013 -0700

i965: Tidy preprocessor macros for SO_PRIM_STORAGE_NEEDED registers.

Gen7+ supports four transform feedback streams.  Using a function-like
macro makes it easy to access them by stream number or loop over them.
"GEN7_" prefixes are more common than "_IVB" suffixes, so use that.

Gen6 only supports a single stream, so the single #define should be
fine.  However, SO_NUM_PRIM_STORAGE_NEEDED was a poor name.  For one,
the word "NUM" doesn't appear in the actual name of the register.
It's also confusingly generic, as it doesn't exist on Gen7+.  Add a
"GEN6_" prefix for clarity.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Paul Berry <stereotype441 at gmail.com>

---

 src/mesa/drivers/dri/i965/intel_reg.h |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_reg.h b/src/mesa/drivers/dri/i965/intel_reg.h
index 470f61c..4e211de 100644
--- a/src/mesa/drivers/dri/i965/intel_reg.h
+++ b/src/mesa/drivers/dri/i965/intel_reg.h
@@ -109,11 +109,8 @@
 #define PS_INVOCATION_COUNT             0x2348
 #define PS_DEPTH_COUNT                  0x2350
 
-#define SO_NUM_PRIM_STORAGE_NEEDED	0x2280
-#define SO_PRIM_STORAGE_NEEDED0_IVB	0x5240
-#define SO_PRIM_STORAGE_NEEDED1_IVB	0x5248
-#define SO_PRIM_STORAGE_NEEDED2_IVB	0x5250
-#define SO_PRIM_STORAGE_NEEDED3_IVB	0x5258
+#define GEN6_SO_PRIM_STORAGE_NEEDED     0x2280
+#define GEN7_SO_PRIM_STORAGE_NEEDED(n)  (0x5240 + (n) * 8)
 
 #define GEN6_SO_NUM_PRIMS_WRITTEN       0x2288
 #define GEN7_SO_NUM_PRIMS_WRITTEN(n)    (0x5200 + (n) * 8)




More information about the mesa-commit mailing list