anv/gen8: Extract SF state
authorBen Widawsky <benjamin.widawsky@intel.com>
Fri, 29 Jan 2016 21:55:41 +0000 (13:55 -0800)
committerBen Widawsky <benjamin.widawsky@intel.com>
Fri, 29 Jan 2016 22:11:53 +0000 (14:11 -0800)
For upcoming patch to address difference in Cherryview.

src/vulkan/gen8_cmd_buffer.c

index 4b1c51a8c59678601b86f4bda70d2d232f994ef4..045846b1072d573c530ab61ea3414494366648f2 100644 (file)
@@ -224,6 +224,20 @@ flush_pipeline_select_3d(struct anv_cmd_buffer *cmd_buffer)
    }
 }
 
+static void
+__emit_sf_state(struct anv_cmd_buffer *cmd_buffer)
+{
+      uint32_t sf_dw[GENX(3DSTATE_SF_length)];
+      struct GENX(3DSTATE_SF) sf = {
+         GENX(3DSTATE_SF_header),
+         .LineWidth = cmd_buffer->state.dynamic.line_width,
+      };
+      GENX(3DSTATE_SF_pack)(NULL, sf_dw, &sf);
+      /* FIXME: gen9.fs */
+      anv_batch_emit_merge(&cmd_buffer->batch, sf_dw,
+                           cmd_buffer->state.pipeline->gen8.sf);
+}
+
 static void
 cmd_buffer_flush_state(struct anv_cmd_buffer *cmd_buffer)
 {
@@ -297,14 +311,7 @@ cmd_buffer_flush_state(struct anv_cmd_buffer *cmd_buffer)
 
    if (cmd_buffer->state.dirty & (ANV_CMD_DIRTY_PIPELINE |
                                   ANV_CMD_DIRTY_DYNAMIC_LINE_WIDTH)) {
-      uint32_t sf_dw[GENX(3DSTATE_SF_length)];
-      struct GENX(3DSTATE_SF) sf = {
-         GENX(3DSTATE_SF_header),
-         .LineWidth = cmd_buffer->state.dynamic.line_width,
-      };
-      GENX(3DSTATE_SF_pack)(NULL, sf_dw, &sf);
-      /* FIXME: gen9.fs */
-      anv_batch_emit_merge(&cmd_buffer->batch, sf_dw, pipeline->gen8.sf);
+      __emit_sf_state(cmd_buffer);
    }
 
    if (cmd_buffer->state.dirty & (ANV_CMD_DIRTY_PIPELINE |