[Mesa-dev] [PATCH 2/3] anv: Simplify Cherryview line handling.
Kenneth Graunke
kenneth at whitecape.org
Thu May 4 19:07:20 UTC 2017
We can just use the new CHVLineWidth field rather than an entirely
different generation's packing function.
---
src/intel/vulkan/gen8_cmd_buffer.c | 45 ++++++++------------------------------
1 file changed, 9 insertions(+), 36 deletions(-)
diff --git a/src/intel/vulkan/gen8_cmd_buffer.c b/src/intel/vulkan/gen8_cmd_buffer.c
index 0e26ddaeba2..1522b36039f 100644
--- a/src/intel/vulkan/gen8_cmd_buffer.c
+++ b/src/intel/vulkan/gen8_cmd_buffer.c
@@ -105,13 +105,20 @@ gen8_cmd_buffer_emit_depth_viewport(struct anv_cmd_buffer *cmd_buffer,
#endif
static void
-__emit_genx_sf_state(struct anv_cmd_buffer *cmd_buffer)
+__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,
};
+#if GEN_GEN == 8
+ if (cmd_buffer->device->info.is_cherryview)
+ sf.CHVLineWidth = cmd_buffer->state.dynamic.line_width;
+ else
+ sf.LineWidth = cmd_buffer->state.dynamic.line_width;
+#else
+ sf.LineWidth = cmd_buffer->state.dynamic.line_width,
+#endif
GENX(3DSTATE_SF_pack)(NULL, sf_dw, &sf);
/* FIXME: gen9.fs */
anv_batch_emit_merge(&cmd_buffer->batch, sf_dw,
@@ -119,40 +126,6 @@ __emit_genx_sf_state(struct anv_cmd_buffer *cmd_buffer)
}
void
-gen9_emit_sf_state(struct anv_cmd_buffer *cmd_buffer);
-
-#if GEN_GEN == 9
-
-void
-gen9_emit_sf_state(struct anv_cmd_buffer *cmd_buffer)
-{
- __emit_genx_sf_state(cmd_buffer);
-}
-
-#endif
-
-#if GEN_GEN == 8
-
-static void
-__emit_sf_state(struct anv_cmd_buffer *cmd_buffer)
-{
- if (cmd_buffer->device->info.is_cherryview)
- gen9_emit_sf_state(cmd_buffer);
- else
- __emit_genx_sf_state(cmd_buffer);
-}
-
-#else
-
-static void
-__emit_sf_state(struct anv_cmd_buffer *cmd_buffer)
-{
- __emit_genx_sf_state(cmd_buffer);
-}
-
-#endif
-
-void
genX(cmd_buffer_enable_pma_fix)(struct anv_cmd_buffer *cmd_buffer, bool enable)
{
if (cmd_buffer->state.pma_fix_enabled == enable)
--
2.12.2
More information about the mesa-dev
mailing list