diff options
author | Paul Berry <[email protected]> | 2013-03-22 12:39:40 -0700 |
---|---|---|
committer | Paul Berry <[email protected]> | 2013-04-11 09:25:24 -0700 |
commit | deffbbed4e0f24e05fe5314ee7ccd47e4826f9ba (patch) | |
tree | 6be395cd405553158cee7244cf16eb19ba6807e6 | |
parent | b29613371c316e9273ebe29ba37fb2f04c2ed58d (diff) |
i965: Generalize computation of VUE map in preparation for GS.
This patch modifies the arguments to brw_compute_vue_map() so that
they no longer bake in the assumption that we are generating a VUE map
for vertex shader outputs. It also makes the function non-static so
that we can re-use it for geometry shader outputs.
Reviewed-by: Jordan Justen <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.h | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs.c | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index ab3ae1c1081..10e738d3090 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -400,6 +400,9 @@ static inline GLuint brw_varying_to_offset(struct brw_vue_map *vue_map, return brw_vue_slot_to_offset(vue_map->varying_to_slot[varying]); } +void brw_compute_vue_map(struct brw_context *brw, struct brw_vue_map *vue_map, + GLbitfield64 slots_valid, bool userclip_active); + struct brw_sf_prog_data { GLuint urb_read_length; diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index 6d2c0fd87e8..13971ab6043 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -57,12 +57,11 @@ static inline void assign_vue_slot(struct brw_vue_map *vue_map, * prog_data->userclip and prog_data->outputs_written in their key * (generated by CACHE_NEW_VS_PROG). */ -static void -brw_compute_vue_map(struct brw_context *brw, struct brw_vs_compile *c, - GLbitfield64 slots_valid) +void +brw_compute_vue_map(struct brw_context *brw, struct brw_vue_map *vue_map, + GLbitfield64 slots_valid, bool userclip_active) { const struct intel_context *intel = &brw->intel; - struct brw_vue_map *vue_map = &c->prog_data.vue_map; /* Prior to Gen6, don't assign a slot for VARYING_SLOT_CLIP_VERTEX, since * it is unsupported. @@ -133,7 +132,7 @@ brw_compute_vue_map(struct brw_context *brw, struct brw_vs_compile *c, */ assign_vue_slot(vue_map, VARYING_SLOT_PSIZ); assign_vue_slot(vue_map, VARYING_SLOT_POS); - if (c->key.userclip_active) { + if (userclip_active) { assign_vue_slot(vue_map, VARYING_SLOT_CLIP_DIST0); assign_vue_slot(vue_map, VARYING_SLOT_CLIP_DIST1); } @@ -284,7 +283,8 @@ do_vs_prog(struct brw_context *brw, } } - brw_compute_vue_map(brw, &c, outputs_written); + brw_compute_vue_map(brw, &c.prog_data.vue_map, outputs_written, + c.key.userclip_active); if (0) { _mesa_fprint_program_opt(stdout, &c.vp->program.Base, PROG_PRINT_DEBUG, |