summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_sf_emit.c
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2011-08-23 15:49:32 -0700
committerPaul Berry <stereotype441@gmail.com>2011-09-06 11:04:34 -0700
commit4a1fb81902a7863d5dfe304e5e4ca2c631159be1 (patch)
tree1f7a5f48eab63cf2bfc7623bd7bf980eed77e0bd /src/mesa/drivers/dri/i965/brw_sf_emit.c
parent39fc725b0c81db8d76cb490488cd95de5c4d7a79 (diff)
downloadexternal_mesa3d-4a1fb81902a7863d5dfe304e5e4ca2c631159be1.zip
external_mesa3d-4a1fb81902a7863d5dfe304e5e4ca2c631159be1.tar.gz
external_mesa3d-4a1fb81902a7863d5dfe304e5e4ca2c631159be1.tar.bz2
i965: SF: Modify calculate_point_sprite_mask to use the VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_sf_emit.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf_emit.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c
index 52a3fb3..f1fe567 100644
--- a/src/mesa/drivers/dri/i965/brw_sf_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c
@@ -43,6 +43,18 @@
#include "brw_sf.h"
+/**
+ * Determine the vert_result corresponding to the given half of the given
+ * register. half=0 means the first half of a register, half=1 means the
+ * second half.
+ */
+static inline int vert_reg_to_vert_result(struct brw_sf_compile *c, GLuint reg,
+ int half)
+{
+ int vue_slot = (reg + c->urb_entry_read_offset) * 2 + half;
+ return c->vue_map.slot_to_vert_result[vue_slot];
+}
+
static struct brw_reg get_vert_attr(struct brw_sf_compile *c,
struct brw_reg vert,
GLuint attr)
@@ -359,22 +371,20 @@ static GLboolean calculate_masks( struct brw_sf_compile *c,
static uint16_t
calculate_point_sprite_mask(struct brw_sf_compile *c, GLuint reg)
{
- int attr1, attr2;
+ int vert_result1, vert_result2;
uint16_t pc = 0;
- attr1 = c->idx_to_attr[reg * 2];
- if (attr1 >= VERT_RESULT_TEX0 && attr1 <= VERT_RESULT_TEX7) {
- if (c->key.point_sprite_coord_replace & (1 << (attr1 - VERT_RESULT_TEX0)))
+ vert_result1 = vert_reg_to_vert_result(c, reg, 0);
+ if (vert_result1 >= VERT_RESULT_TEX0 && vert_result1 <= VERT_RESULT_TEX7) {
+ if (c->key.point_sprite_coord_replace & (1 << (vert_result1 - VERT_RESULT_TEX0)))
pc |= 0x0f;
}
- if (reg * 2 + 1 < c->nr_setup_attrs) {
- attr2 = c->idx_to_attr[reg * 2 + 1];
- if (attr2 >= VERT_RESULT_TEX0 && attr2 <= VERT_RESULT_TEX7) {
- if (c->key.point_sprite_coord_replace & (1 << (attr2 -
- VERT_RESULT_TEX0)))
- pc |= 0xf0;
- }
+ vert_result2 = vert_reg_to_vert_result(c, reg, 1);
+ if (vert_result2 >= VERT_RESULT_TEX0 && vert_result2 <= VERT_RESULT_TEX7) {
+ if (c->key.point_sprite_coord_replace & (1 << (vert_result2 -
+ VERT_RESULT_TEX0)))
+ pc |= 0xf0;
}
return pc;