summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2011-09-01 15:30:21 -0700
committerPaul Berry <[email protected]>2011-09-06 11:03:53 -0700
commit7bb2dbfc9765c97d9c53ad954342419338018474 (patch)
tree24b575289d0ed284b13b1647ab745311e4dcbee2 /src/mesa
parent45f1d7a66666d849031ffc2b8647149e17cc13bc (diff)
i965: Add functions to compute offsets within the VUE map.
Some parts of the i965 driver keep track of locations within the VUE (vertex URB entry) using byte offsets. This patch adds inline functions to compute these byte offsets using the VUE map. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index bf15fd6cfcf..8cb42adc450 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -334,6 +334,24 @@ struct brw_vue_map {
int num_slots;
};
+/**
+ * Convert a VUE slot number into a byte offset within the VUE.
+ */
+static inline GLuint brw_vue_slot_to_offset(GLuint slot)
+{
+ return 16*slot;
+}
+
+/**
+ * Convert a vert_result into a byte offset within the VUE.
+ */
+static inline GLuint brw_vert_result_to_offset(struct brw_vue_map *vue_map,
+ GLuint vert_result)
+{
+ return brw_vue_slot_to_offset(vue_map->vert_result_to_slot[vert_result]);
+}
+
+
struct brw_sf_prog_data {
GLuint urb_read_length;
GLuint total_grf;