From: Ben Widawsky Date: Fri, 29 Jan 2016 22:10:52 +0000 (-0800) Subject: anv/cmd_buffer: Emit gen9 style SF state for CHV X-Git-Tag: upstream/17.1.0~11012^2~439 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89ec36f221099cf47ade0b90d09c7731460ab381;p=platform%2Fupstream%2Fmesa.git anv/cmd_buffer: Emit gen9 style SF state for CHV The state for line width changes on Cherryview to use the GEN9 bits (for extra precision). --- diff --git a/src/vulkan/gen8_cmd_buffer.c b/src/vulkan/gen8_cmd_buffer.c index 045846b..56d80e2 100644 --- a/src/vulkan/gen8_cmd_buffer.c +++ b/src/vulkan/gen8_cmd_buffer.c @@ -225,7 +225,7 @@ flush_pipeline_select_3d(struct anv_cmd_buffer *cmd_buffer) } static void -__emit_sf_state(struct anv_cmd_buffer *cmd_buffer) +__emit_genx_sf_state(struct anv_cmd_buffer *cmd_buffer) { uint32_t sf_dw[GENX(3DSTATE_SF_length)]; struct GENX(3DSTATE_SF) sf = { @@ -237,6 +237,28 @@ __emit_sf_state(struct anv_cmd_buffer *cmd_buffer) anv_batch_emit_merge(&cmd_buffer->batch, sf_dw, cmd_buffer->state.pipeline->gen8.sf); } +static void +__emit_gen9_sf_state(struct anv_cmd_buffer *cmd_buffer) +{ + uint32_t sf_dw[GENX(3DSTATE_SF_length)]; + struct GEN9_3DSTATE_SF sf = { + GEN9_3DSTATE_SF_header, + .LineWidth = cmd_buffer->state.dynamic.line_width, + }; + GEN9_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 +__emit_sf_state(struct anv_cmd_buffer *cmd_buffer) +{ + if (cmd_buffer->device->info.is_cherryview) + __emit_gen9_sf_state(cmd_buffer); + else + __emit_genx_sf_state(cmd_buffer); +} static void cmd_buffer_flush_state(struct anv_cmd_buffer *cmd_buffer)