ilo: use ilo_rasterizer_state exclusively in GPE 06/7106/1
authorChia-I Wu <olvaffe@gmail.com>
Fri, 21 Jun 2013 04:30:23 +0000 (12:30 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Tue, 25 Jun 2013 05:18:07 +0000 (13:18 +0800)
Replace pipe_rasterizer_state by ilo_rasterizer_state for the remaining GPE
functions for consistency.

src/gallium/drivers/ilo/ilo_3d_pipeline_gen7.c
src/gallium/drivers/ilo/ilo_gpe_gen6.c
src/gallium/drivers/ilo/ilo_gpe_gen6.h
src/gallium/drivers/ilo/ilo_gpe_gen7.c
src/gallium/drivers/ilo/ilo_gpe_gen7.h

index 20f06d6..a86b495 100644 (file)
@@ -442,8 +442,7 @@ gen7_pipeline_sf(struct ilo_3d_pipeline *p,
          (ilo->gs)? ilo->gs->shader :
          (ilo->vs)? ilo->vs->shader : NULL;
 
-      p->gen7_3DSTATE_SBE(p->dev,
-            &ilo->rasterizer->state, fs, last_sh, p->cp);
+      p->gen7_3DSTATE_SBE(p->dev, ilo->rasterizer, fs, last_sh, p->cp);
    }
 
    /* 3DSTATE_SF */
index ad0884e..7e11318 100644 (file)
@@ -1757,11 +1757,13 @@ ilo_gpe_init_rasterizer_sf(const struct ilo_dev_info *dev,
  */
 void
 ilo_gpe_gen6_fill_3dstate_sf_raster(const struct ilo_dev_info *dev,
-                                    const struct ilo_rasterizer_sf *sf,
+                                    const struct ilo_rasterizer_state *rasterizer,
                                     int num_samples,
                                     enum pipe_format depth_format,
                                     uint32_t *payload, unsigned payload_len)
 {
+   const struct ilo_rasterizer_sf *sf = &rasterizer->sf;
+
    assert(payload_len == Elements(sf->payload));
 
    if (sf) {
@@ -1811,7 +1813,7 @@ ilo_gpe_gen6_fill_3dstate_sf_raster(const struct ilo_dev_info *dev,
  */
 void
 ilo_gpe_gen6_fill_3dstate_sf_sbe(const struct ilo_dev_info *dev,
-                                 const struct pipe_rasterizer_state *rasterizer,
+                                 const struct ilo_rasterizer_state *rasterizer,
                                  const struct ilo_shader *fs,
                                  const struct ilo_shader *last_sh,
                                  uint32_t *dw, int num_dwords)
@@ -1868,11 +1870,11 @@ ilo_gpe_gen6_fill_3dstate_sf_sbe(const struct ilo_dev_info *dev,
        * TODO We do not check that yet.
        */
       if (semantic == TGSI_SEMANTIC_GENERIC &&
-          (rasterizer->sprite_coord_enable & (1 << index)))
+          (rasterizer->state.sprite_coord_enable & (1 << index)))
          point_sprite_enable |= 1 << dst;
 
       if (interp == TGSI_INTERPOLATE_CONSTANT ||
-          (interp == TGSI_INTERPOLATE_COLOR && rasterizer->flatshade))
+          (interp == TGSI_INTERPOLATE_COLOR && rasterizer->state.flatshade))
          const_interp_enable |= 1 << dst;
 
       if (!last_sh) {
@@ -1889,7 +1891,8 @@ ilo_gpe_gen6_fill_3dstate_sf_sbe(const struct ilo_dev_info *dev,
 
          ctrl = src;
 
-         if (semantic == TGSI_SEMANTIC_COLOR && rasterizer->light_twoside &&
+         if (semantic == TGSI_SEMANTIC_COLOR &&
+             rasterizer->state.light_twoside &&
              src < vue_len - 1) {
             const int next = src + 1;
 
@@ -1984,7 +1987,7 @@ ilo_gpe_gen6_fill_3dstate_sf_sbe(const struct ilo_dev_info *dev,
          dw[0] |= GEN6_SF_SWIZZLE_ENABLE;
    }
 
-   switch (rasterizer->sprite_coord_mode) {
+   switch (rasterizer->state.sprite_coord_mode) {
    case PIPE_SPRITE_COORD_UPPER_LEFT:
       dw[0] |= GEN6_SF_POINT_SPRITE_UPPERLEFT;
       break;
@@ -2017,9 +2020,9 @@ gen6_emit_3DSTATE_SF(const struct ilo_dev_info *dev,
 
    ILO_GPE_VALID_GEN(dev, 6, 6);
 
-   ilo_gpe_gen6_fill_3dstate_sf_raster(dev, &rasterizer->sf,
+   ilo_gpe_gen6_fill_3dstate_sf_raster(dev, rasterizer,
          1, PIPE_FORMAT_NONE, payload_raster, Elements(payload_raster));
-   ilo_gpe_gen6_fill_3dstate_sf_sbe(dev, &rasterizer->state,
+   ilo_gpe_gen6_fill_3dstate_sf_sbe(dev, rasterizer,
          fs, last_sh, payload_sbe, Elements(payload_sbe));
 
    ilo_cp_begin(cp, cmd_len);
index a8a986a..433d2c8 100644 (file)
@@ -544,14 +544,14 @@ ilo_gpe_gen6_translate_texture(enum pipe_texture_target target);
 
 void
 ilo_gpe_gen6_fill_3dstate_sf_raster(const struct ilo_dev_info *dev,
-                                    const struct ilo_rasterizer_sf *sf,
+                                    const struct ilo_rasterizer_state *rasterizer,
                                     int num_samples,
                                     enum pipe_format depth_format,
                                     uint32_t *payload, unsigned payload_len);
 
 void
 ilo_gpe_gen6_fill_3dstate_sf_sbe(const struct ilo_dev_info *dev,
-                                 const struct pipe_rasterizer_state *rasterizer,
+                                 const struct ilo_rasterizer_state *rasterizer,
                                  const struct ilo_shader *fs,
                                  const struct ilo_shader *last_sh,
                                  uint32_t *dw, int num_dwords);
index 79e01d7..40c23d9 100644 (file)
@@ -184,7 +184,7 @@ gen7_emit_3DSTATE_SF(const struct ilo_dev_info *dev,
    ILO_GPE_VALID_GEN(dev, 7, 7);
 
    ilo_gpe_gen6_fill_3dstate_sf_raster(dev,
-         &rasterizer->sf, num_samples,
+         rasterizer, num_samples,
          (zs_surf) ? zs_surf->format : PIPE_FORMAT_NONE,
          payload, Elements(payload));
 
@@ -654,7 +654,7 @@ gen7_emit_3DSTATE_STREAMOUT(const struct ilo_dev_info *dev,
 
 static void
 gen7_emit_3DSTATE_SBE(const struct ilo_dev_info *dev,
-                      const struct pipe_rasterizer_state *rasterizer,
+                      const struct ilo_rasterizer_state *rasterizer,
                       const struct ilo_shader *fs,
                       const struct ilo_shader *last_sh,
                       struct ilo_cp *cp)
index ac0fb0e..e81884e 100644 (file)
@@ -224,7 +224,7 @@ typedef void
 
 typedef void
 (*ilo_gpe_gen7_3DSTATE_SBE)(const struct ilo_dev_info *dev,
-                            const struct pipe_rasterizer_state *rasterizer,
+                            const struct ilo_rasterizer_state *rasterizer,
                             const struct ilo_shader *fs,
                             const struct ilo_shader *last_sh,
                             struct ilo_cp *cp);