i965/fs: Handle fixed HW GRF subnr in reg_offset().
[mesa.git] / src / mesa / drivers / dri / i965 / gen8_sf_state.c
index 2ac21f7c8737f1ddaabd9d4603fc1aa906bd732e..52722174c27c41b6e29dbc12e265d41f80144fd2 100644 (file)
@@ -39,7 +39,6 @@ upload_sbe(struct brw_context *brw)
    uint32_t urb_entry_read_length;
    uint32_t urb_entry_read_offset;
    uint32_t point_sprite_enables;
-   uint32_t flat_enables;
    int sbe_cmd_length;
 
    uint32_t dw1 =
@@ -61,12 +60,13 @@ upload_sbe(struct brw_context *brw)
    else
       dw1 |= GEN6_SF_POINT_SPRITE_UPPERLEFT;
 
-   /* BRW_NEW_VUE_MAP_GEOM_OUT | BRW_NEW_FRAGMENT_PROGRAM |
-    * _NEW_POINT | _NEW_LIGHT | _NEW_PROGRAM | BRW_NEW_FS_PROG_DATA
+   /* _NEW_POINT | _NEW_LIGHT | _NEW_PROGRAM,
+    * BRW_NEW_FS_PROG_DATA | BRW_NEW_FRAGMENT_PROGRAM |
+    * 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,
                             &point_sprite_enables,
-                            &flat_enables,
                             &urb_entry_read_length,
                             &urb_entry_read_offset);
 
@@ -109,7 +109,7 @@ upload_sbe(struct brw_context *brw)
    OUT_BATCH(_3DSTATE_SBE << 16 | (sbe_cmd_length - 2));
    OUT_BATCH(dw1);
    OUT_BATCH(point_sprite_enables);
-   OUT_BATCH(flat_enables);
+   OUT_BATCH(brw->wm.prog_data->flat_inputs);
    if (sbe_cmd_length >= 6) {
       OUT_BATCH(dw4);
       OUT_BATCH(dw5);
@@ -134,10 +134,14 @@ const struct brw_tracked_state gen8_sbe_state = {
       .mesa  = _NEW_BUFFERS |
                _NEW_LIGHT |
                _NEW_POINT |
+               _NEW_POLYGON |
                _NEW_PROGRAM,
-      .brw   = BRW_NEW_CONTEXT |
+      .brw   = BRW_NEW_BLORP |
+               BRW_NEW_CONTEXT |
                BRW_NEW_FRAGMENT_PROGRAM |
                BRW_NEW_FS_PROG_DATA |
+               BRW_NEW_GS_PROG_DATA |
+               BRW_NEW_TES_PROG_DATA |
                BRW_NEW_VUE_MAP_GEOM_OUT,
    },
    .emit = upload_sbe,
@@ -167,14 +171,14 @@ upload_sf(struct brw_context *brw)
       dw2 |= GEN6_SF_LINE_END_CAP_WIDTH_1_0;
    }
 
-   /* Clamp to ARB_point_parameters user limits */
+   /* _NEW_POINT - Clamp to ARB_point_parameters user limits */
    point_size = CLAMP(ctx->Point.Size, ctx->Point.MinSize, ctx->Point.MaxSize);
 
    /* Clamp to the hardware limits and convert to fixed point */
    dw3 |= U_FIXED(CLAMP(point_size, 0.125f, 255.875f), 3);
 
-   /* _NEW_PROGRAM | _NEW_POINT */
-   if (!(ctx->VertexProgram.PointSizeEnabled || ctx->Point._Attenuated))
+   /* _NEW_PROGRAM | _NEW_POINT, BRW_NEW_VUE_MAP_GEOM_OUT */
+   if (use_state_point_size(brw))
       dw3 |= GEN6_SF_USE_STATE_POINT_WIDTH;
 
    /* _NEW_POINT | _NEW_MULTISAMPLE */
@@ -209,7 +213,9 @@ const struct brw_tracked_state gen8_sf_state = {
                _NEW_LINE |
                _NEW_MULTISAMPLE |
                _NEW_POINT,
-      .brw   = BRW_NEW_CONTEXT,
+      .brw   = BRW_NEW_BLORP |
+               BRW_NEW_CONTEXT |
+               BRW_NEW_VUE_MAP_GEOM_OUT,
    },
    .emit = upload_sf,
 };
@@ -326,7 +332,8 @@ const struct brw_tracked_state gen8_raster_state = {
                _NEW_POLYGON |
                _NEW_SCISSOR |
                _NEW_TRANSFORM,
-      .brw   = BRW_NEW_CONTEXT,
+      .brw   = BRW_NEW_BLORP |
+               BRW_NEW_CONTEXT,
    },
    .emit = upload_raster,
 };