[Mesa-dev] [PATCH 24/36] i965: clip: Add VUE map computation to clip stage for Gen4-5.

Paul Berry stereotype441 at gmail.com
Fri Sep 2 09:07:03 PDT 2011


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

diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c
index b49c9f4..b9ec55a 100644
--- a/src/mesa/drivers/dri/i965/brw_clip.c
+++ b/src/mesa/drivers/dri/i965/brw_clip.c
@@ -71,6 +71,8 @@ static void compile_clip_prog( struct brw_context *brw,
    c.func.single_program_flow = 1;
 
    c.key = *key;
+   brw_compute_vue_map(&c.vue_map, intel, c.key.nr_userclip,
+                       c.key.do_twoside_color, c.key.attrs);
 
    /* Need to locate the two positions present in vertex + header.
     * These are currently hardcoded:
@@ -174,6 +176,7 @@ static void upload_clip_prog(struct brw_context *brw)
    /* _NEW_LIGHT */
    key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT);
    key.pv_first = (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION);
+   key.do_twoside_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide);
    /* _NEW_TRANSFORM */
    key.nr_userclip = brw_count_bits(ctx->Transform.ClipPlanesEnabled);
 
diff --git a/src/mesa/drivers/dri/i965/brw_clip.h b/src/mesa/drivers/dri/i965/brw_clip.h
index 3a8cd7b..ca2362c 100644
--- a/src/mesa/drivers/dri/i965/brw_clip.h
+++ b/src/mesa/drivers/dri/i965/brw_clip.h
@@ -55,7 +55,8 @@ struct brw_clip_prog_key {
    GLuint copy_bfc_cw:1;
    GLuint copy_bfc_ccw:1;
    GLuint clip_mode:3;
-   GLuint pad0:11;
+   GLuint do_twoside_color:1;
+   GLuint pad0:10;
 
    GLfloat offset_factor;
    GLfloat offset_units;
@@ -119,6 +120,8 @@ struct brw_clip_compile {
    GLuint offset[VERT_RESULT_MAX];
    /** Mapping from attribute index to VERT_RESULT_* */
    GLuint idx_to_attr[VERT_RESULT_MAX];
+
+   struct brw_vue_map vue_map;
 };
 
 #define ATTR_SIZE  (4*4)
-- 
1.7.6



More information about the mesa-dev mailing list