Re: [Mesa-dev] [PATCH v2 1/5] i965: Move brw_vs_prog_data::outputs_written into VUE map.

2013-03-23 Thread Kenneth Graunke

On 03/21/2013 05:40 PM, Paul Berry wrote:

Future patches will allow for there to be separate VUE maps when both
a geometry shader and a vertex shader are in use.  When this happens,
we will want to have correspondingly separate outputs_written
bitfields.  Moving outputs_written into the VUE map will make this
easy.

For consistency with the terminology used in the VUE map, the bitfield
is renamed to slots_valid in the process.

Reviewed-by: Eric Anholt e...@anholt.net


Other than my comments on patch 3, this series is:
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

I'll try and get you a tested-by soon.

Nice work, Paul.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2 1/5] i965: Move brw_vs_prog_data::outputs_written into VUE map.

2013-03-21 Thread Paul Berry
Future patches will allow for there to be separate VUE maps when both
a geometry shader and a vertex shader are in use.  When this happens,
we will want to have correspondingly separate outputs_written
bitfields.  Moving outputs_written into the VUE map will make this
easy.

For consistency with the terminology used in the VUE map, the bitfield
is renamed to slots_valid in the process.

Reviewed-by: Eric Anholt e...@anholt.net
---
 src/mesa/drivers/dri/i965/brw_clip.c   |  2 +-
 src/mesa/drivers/dri/i965/brw_context.h|  8 +++-
 src/mesa/drivers/dri/i965/brw_gs.c |  2 +-
 src/mesa/drivers/dri/i965/brw_sf.c |  2 +-
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp |  9 -
 src/mesa/drivers/dri/i965/brw_vs.c | 23 ---
 src/mesa/drivers/dri/i965/brw_wm.c |  2 +-
 7 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_clip.c 
b/src/mesa/drivers/dri/i965/brw_clip.c
index d411208..e20f7c2 100644
--- a/src/mesa/drivers/dri/i965/brw_clip.c
+++ b/src/mesa/drivers/dri/i965/brw_clip.c
@@ -146,7 +146,7 @@ brw_upload_clip_prog(struct brw_context *brw)
/* BRW_NEW_REDUCED_PRIMITIVE */
key.primitive = brw-intel.reduced_primitive;
/* CACHE_NEW_VS_PROG (also part of VUE map) */
-   key.attrs = brw-vs.prog_data-outputs_written;
+   key.attrs = brw-vs.prog_data-vue_map.slots_valid;
/* _NEW_LIGHT */
key.do_flat_shading = (ctx-Light.ShadeModel == GL_FLAT);
key.pv_first = (ctx-Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION);
diff --git a/src/mesa/drivers/dri/i965/brw_context.h 
b/src/mesa/drivers/dri/i965/brw_context.h
index 9f1aaf5..fe6e639 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -354,6 +354,13 @@ typedef enum
  */
 struct brw_vue_map {
/**
+* Bitfield representing all varying slots that are (a) stored in this VUE
+* map, and (b) actually written by the shader.  Does not include any of
+* the additional varying slots defined in brw_varying_slot.
+*/
+   GLbitfield64 slots_valid;
+
+   /**
 * Map from gl_varying_slot value to VUE slot.  For gl_varying_slots that 
are
 * not stored in a slot (because they are not written, or because
 * additional processing is applied before storing them in the VUE), the
@@ -437,7 +444,6 @@ struct brw_vs_prog_data {
GLuint curb_read_length;
GLuint urb_read_length;
GLuint total_grf;
-   GLbitfield64 outputs_written;
GLuint nr_params;   /** number of float params/constants */
GLuint nr_pull_params; /** number of dwords referenced by pull_param[] */
GLuint total_scratch;
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c 
b/src/mesa/drivers/dri/i965/brw_gs.c
index 1328984..e755a10 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -167,7 +167,7 @@ static void populate_key( struct brw_context *brw,
memset(key, 0, sizeof(*key));
 
/* CACHE_NEW_VS_PROG (part of VUE map) */
-   key-attrs = brw-vs.prog_data-outputs_written;
+   key-attrs = brw-vs.prog_data-vue_map.slots_valid;
 
/* BRW_NEW_PRIMITIVE */
key-primitive = brw-primitive;
diff --git a/src/mesa/drivers/dri/i965/brw_sf.c 
b/src/mesa/drivers/dri/i965/brw_sf.c
index fdc6bd7..c8b7033 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.c
+++ b/src/mesa/drivers/dri/i965/brw_sf.c
@@ -145,7 +145,7 @@ brw_upload_sf_prog(struct brw_context *brw)
/* Populate the key, noting state dependencies:
 */
/* CACHE_NEW_VS_PROG */
-   key.attrs = brw-vs.prog_data-outputs_written; 
+   key.attrs = brw-vs.prog_data-vue_map.slots_valid;
 
/* BRW_NEW_REDUCED_PRIMITIVE */
switch (brw-intel.reduced_primitive) {
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp 
b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 60575d7..b0a0dd6 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2402,7 +2402,7 @@ void
 vec4_visitor::emit_psiz_and_flags(struct brw_reg reg)
 {
if (intel-gen  6 
-   ((c-prog_data.outputs_written  BITFIELD64_BIT(VARYING_SLOT_PSIZ)) ||
+   ((c-prog_data.vue_map.slots_valid  VARYING_BIT_PSIZ) ||
 c-key.userclip_active || brw-has_negative_rhw_bug)) {
   dst_reg header1 = dst_reg(this, glsl_type::uvec4_type);
   dst_reg header1_w = header1;
@@ -2411,7 +2411,7 @@ vec4_visitor::emit_psiz_and_flags(struct brw_reg reg)
 
   emit(MOV(header1, 0u));
 
-  if (c-prog_data.outputs_written  BITFIELD64_BIT(VARYING_SLOT_PSIZ)) {
+  if (c-prog_data.vue_map.slots_valid  VARYING_BIT_PSIZ) {
 src_reg psiz = src_reg(output_reg[VARYING_SLOT_PSIZ]);
 
 current_annotation = Point size;
@@ -2456,7 +2456,7 @@ vec4_visitor::emit_psiz_and_flags(struct brw_reg reg)
   emit(MOV(retype(reg, BRW_REGISTER_TYPE_UD), 0u));
} else {
   emit(MOV(retype(reg, BRW_REGISTER_TYPE_D), src_reg(0)));
-  if