ilo: add variants of 3DSTATE_VS
authorChia-I Wu <olvaffe@gmail.com>
Tue, 11 Nov 2014 02:31:55 +0000 (10:31 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Tue, 11 Nov 2014 05:51:36 +0000 (13:51 +0800)
Add gen6_disable_3DSTATE_VS() to disable VS.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
src/gallium/drivers/ilo/ilo_builder_3d_top.h
src/gallium/drivers/ilo/ilo_render_gen6.c
src/gallium/drivers/ilo/ilo_render_gen7.c

index 39bd1e5d27839a6dfe6cad0619ced4595eb73d0a..9794e92393ec52bbece0093aa3d4aac9448fe2bb 100644 (file)
@@ -550,31 +550,19 @@ gen6_3DSTATE_VS(struct ilo_builder *builder,
                 const struct ilo_shader_state *vs)
 {
    const uint8_t cmd_len = 6;
-   const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_VS) | (cmd_len - 2);
    const struct ilo_shader_cso *cso;
    uint32_t dw2, dw4, dw5, *dw;
 
    ILO_DEV_ASSERT(builder->dev, 6, 7.5);
 
-   if (!vs) {
-      ilo_builder_batch_pointer(builder, cmd_len, &dw);
-      dw[0] = dw0;
-      dw[1] = 0;
-      dw[2] = 0;
-      dw[3] = 0;
-      dw[4] = 0;
-      dw[5] = 0;
-
-      return;
-   }
-
    cso = ilo_shader_get_kernel_cso(vs);
    dw2 = cso->payload[0];
    dw4 = cso->payload[1];
    dw5 = cso->payload[2];
 
    ilo_builder_batch_pointer(builder, cmd_len, &dw);
-   dw[0] = dw0;
+
+   dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_VS) | (cmd_len - 2);
    dw[1] = ilo_shader_get_kernel_offset(vs);
    dw[2] = dw2;
    dw[3] = 0; /* scratch */
@@ -582,6 +570,24 @@ gen6_3DSTATE_VS(struct ilo_builder *builder,
    dw[5] = dw5;
 }
 
+static inline void
+gen6_disable_3DSTATE_VS(struct ilo_builder *builder)
+{
+   const uint8_t cmd_len = 6;
+   uint32_t *dw;
+
+   ILO_DEV_ASSERT(builder->dev, 6, 7.5);
+
+   ilo_builder_batch_pointer(builder, cmd_len, &dw);
+
+   dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_VS) | (cmd_len - 2);
+   dw[1] = 0;
+   dw[2] = 0;
+   dw[3] = 0;
+   dw[4] = 0;
+   dw[5] = 0;
+}
+
 static inline void
 gen7_3DSTATE_HS(struct ilo_builder *builder,
                 const struct ilo_shader_state *hs)
index 4e3bd18b3091dff0e839735897d1c48855960e74..fcdbd676270f08f17ff8a626ed1183b6d7968974 100644 (file)
@@ -844,7 +844,7 @@ gen6_rectlist_vs_to_sf(struct ilo_render *r,
                        const struct ilo_blitter *blitter)
 {
    gen6_3DSTATE_CONSTANT_VS(r->builder, NULL, NULL, 0);
-   gen6_3DSTATE_VS(r->builder, NULL);
+   gen6_disable_3DSTATE_VS(r->builder);
 
    gen6_wa_post_3dstate_constant_vs(r);
 
index 34a881aa067bba9dbc045bbb2b95a0be19e895dd..a8c24434bcea1c748382ae83b0ab20b35961304d 100644 (file)
@@ -721,7 +721,7 @@ gen7_rectlist_vs_to_sf(struct ilo_render *r,
                        const struct ilo_blitter *blitter)
 {
    gen7_3DSTATE_CONSTANT_VS(r->builder, NULL, NULL, 0);
-   gen6_3DSTATE_VS(r->builder, NULL);
+   gen6_disable_3DSTATE_VS(r->builder);
 
    gen7_3DSTATE_CONSTANT_HS(r->builder, NULL, NULL, 0);
    gen7_3DSTATE_HS(r->builder, NULL);