i965: Use gs_prog_data in is_drawing_points/lines().
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 26 Aug 2016 05:52:22 +0000 (22:52 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 31 Aug 2016 18:50:15 +0000 (11:50 -0700)
State upload code should use prog_data rather than poking at core
Mesa shader data structures wherever possible.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/gen6_clip_state.c
src/mesa/drivers/dri/i965/gen6_sf_state.c
src/mesa/drivers/dri/i965/gen7_sf_state.c
src/mesa/drivers/dri/i965/gen8_sf_state.c

index 8a3d05a6a007ab75a05747fe981260d4da820b9a..1c5b9441d5acccdd6744c64ebd617592a5568c18 100644 (file)
@@ -43,9 +43,9 @@ brw_is_drawing_points(const struct brw_context *brw)
       return true;
    }
 
-   if (brw->geometry_program) {
-      /* BRW_NEW_GEOMETRY_PROGRAM */
-      return brw->geometry_program->OutputType == GL_POINTS;
+   if (brw->gs.prog_data) {
+      /* BRW_NEW_GS_PROG_DATA */
+      return brw->gs.prog_data->output_topology == _3DPRIM_POINTLIST;
    } else if (brw->tes.prog_data) {
       /* BRW_NEW_TES_PROG_DATA */
       return brw->tes.prog_data->output_topology ==
@@ -66,9 +66,9 @@ brw_is_drawing_lines(const struct brw_context *brw)
       return true;
    }
 
-   if (brw->geometry_program) {
-      /* BRW_NEW_GEOMETRY_PROGRAM */
-      return brw->geometry_program->OutputType == GL_LINE_STRIP;
+   if (brw->gs.prog_data) {
+      /* BRW_NEW_GS_PROG_DATA */
+      return brw->gs.prog_data->output_topology == _3DPRIM_LINESTRIP;
    } else if (brw->tes.prog_data) {
       /* BRW_NEW_TES_PROG_DATA */
       return brw->tes.prog_data->output_topology ==
@@ -263,7 +263,7 @@ const struct brw_tracked_state gen6_clip_state = {
       .brw   = BRW_NEW_BLORP |
                BRW_NEW_CONTEXT |
                BRW_NEW_FS_PROG_DATA |
-               BRW_NEW_GEOMETRY_PROGRAM |
+               BRW_NEW_GS_PROG_DATA |
                BRW_NEW_META_IN_PROGRESS |
                BRW_NEW_PRIMITIVE |
                BRW_NEW_RASTERIZER_DISCARD |
@@ -281,7 +281,7 @@ const struct brw_tracked_state gen7_clip_state = {
       .brw   = BRW_NEW_BLORP |
                BRW_NEW_CONTEXT |
                BRW_NEW_FS_PROG_DATA |
-               BRW_NEW_GEOMETRY_PROGRAM |
+               BRW_NEW_GS_PROG_DATA |
                BRW_NEW_META_IN_PROGRESS |
                BRW_NEW_PRIMITIVE |
                BRW_NEW_RASTERIZER_DISCARD |
index 7cef17a7ad3fdc042bcb867eb4964a79466e1fd6..059dd90369905f552f3622bad64ddfa6bf70232b 100644 (file)
@@ -193,7 +193,7 @@ calculate_attr_overrides(const struct brw_context *brw,
     * correctly set the attr overrides.
     *
     * _NEW_POLYGON
-    * BRW_NEW_PRIMITIVE | BRW_NEW_GEOMETRY_PROGRAM | BRW_NEW_TES_PROG_DATA
+    * BRW_NEW_PRIMITIVE | BRW_NEW_GS_PROG_DATA | BRW_NEW_TES_PROG_DATA
     */
    bool drawing_points = brw_is_drawing_points(brw);
 
@@ -335,7 +335,9 @@ upload_sf_state(struct brw_context *brw)
        unreachable("not reached");
    }
 
-   /* _NEW_SCISSOR _NEW_POLYGON BRW_NEW_GEOMETRY_PROGRAM BRW_NEW_PRIMITIVE */
+   /* _NEW_SCISSOR | _NEW_POLYGON,
+    * BRW_NEW_GS_PROG_DATA | BRW_NEW_TES_PROG_DATA | BRW_NEW_PRIMITIVE
+    */
    if (ctx->Scissor.EnableFlags ||
        brw_is_drawing_points(brw) || brw_is_drawing_lines(brw))
       dw3 |= GEN6_SF_SCISSOR_ENABLE;
@@ -448,7 +450,7 @@ const struct brw_tracked_state gen6_sf_state = {
                BRW_NEW_CONTEXT |
                BRW_NEW_FRAGMENT_PROGRAM |
                BRW_NEW_FS_PROG_DATA |
-               BRW_NEW_GEOMETRY_PROGRAM |
+               BRW_NEW_GS_PROG_DATA |
                BRW_NEW_PRIMITIVE |
                BRW_NEW_TES_PROG_DATA |
                BRW_NEW_VUE_MAP_GEOM_OUT,
index 8727bf86efd887bb659fe16a9de690d77185a42a..06d3463577af9c2d9092c5d2b1fc1f9515126671 100644 (file)
@@ -61,7 +61,7 @@ upload_sbe_state(struct brw_context *brw)
 
    /* _NEW_POINT | _NEW_LIGHT | _NEW_PROGRAM,
     * BRW_NEW_FS_PROG_DATA | BRW_NEW_FRAGMENT_PROGRAM |
-    * BRW_NEW_GEOMETRY_PROGRAM | BRW_NEW_PRIMITIVE | BRW_NEW_TES_PROG_DATA |
+    * BRW_NEW_GS_PROG_DATA | BRW_NEW_PRIMITIVE | BRW_NEW_TES_PROG_DATA |
     * BRW_NEW_VUE_MAP_GEOM_OUT
     */
    uint32_t urb_entry_read_length;
@@ -98,7 +98,7 @@ const struct brw_tracked_state gen7_sbe_state = {
                BRW_NEW_CONTEXT |
                BRW_NEW_FRAGMENT_PROGRAM |
                BRW_NEW_FS_PROG_DATA |
-               BRW_NEW_GEOMETRY_PROGRAM |
+               BRW_NEW_GS_PROG_DATA |
                BRW_NEW_TES_PROG_DATA |
                BRW_NEW_PRIMITIVE |
                BRW_NEW_VUE_MAP_GEOM_OUT,
@@ -192,7 +192,7 @@ upload_sf_state(struct brw_context *brw)
    }
 
    /* _NEW_SCISSOR | _NEW_POLYGON,
-    * BRW_NEW_GEOMETRY_PROGRAM | BRW_NEW_PRIMITIVE | BRW_NEW_TES_PROG_DATA
+    * BRW_NEW_GS_PROG_DATA | BRW_NEW_PRIMITIVE | BRW_NEW_TES_PROG_DATA
     */
    if (ctx->Scissor.EnableFlags ||
        brw_is_drawing_points(brw) || brw_is_drawing_lines(brw))
@@ -262,7 +262,7 @@ const struct brw_tracked_state gen7_sf_state = {
                _NEW_SCISSOR,
       .brw   = BRW_NEW_BLORP |
                BRW_NEW_CONTEXT |
-               BRW_NEW_GEOMETRY_PROGRAM |
+               BRW_NEW_GS_PROG_DATA |
                BRW_NEW_PRIMITIVE |
                BRW_NEW_TES_PROG_DATA |
                BRW_NEW_VUE_MAP_GEOM_OUT,
index 93c77f74b697f54f5bb68f37ddb1b4717b3585ba..52722174c27c41b6e29dbc12e265d41f80144fd2 100644 (file)
@@ -62,7 +62,7 @@ upload_sbe(struct brw_context *brw)
 
    /* _NEW_POINT | _NEW_LIGHT | _NEW_PROGRAM,
     * BRW_NEW_FS_PROG_DATA | BRW_NEW_FRAGMENT_PROGRAM |
-    * BRW_NEW_GEOMETRY_PROGRAM | BRW_NEW_PRIMITIVE | BRW_NEW_TES_PROG_DATA |
+    * BRW_NEW_GS_PROG_DATA | BRW_NEW_PRIMITIVE | BRW_NEW_TES_PROG_DATA |
     * BRW_NEW_VUE_MAP_GEOM_OUT
     */
    calculate_attr_overrides(brw, attr_overrides,
@@ -140,7 +140,7 @@ const struct brw_tracked_state gen8_sbe_state = {
                BRW_NEW_CONTEXT |
                BRW_NEW_FRAGMENT_PROGRAM |
                BRW_NEW_FS_PROG_DATA |
-               BRW_NEW_GEOMETRY_PROGRAM |
+               BRW_NEW_GS_PROG_DATA |
                BRW_NEW_TES_PROG_DATA |
                BRW_NEW_VUE_MAP_GEOM_OUT,
    },