st/xorg: set up rasterizer state in init
authorKeith Whitwell <keithw@vmware.com>
Thu, 26 Nov 2009 10:15:01 +0000 (10:15 +0000)
committerKeith Whitwell <keithw@vmware.com>
Thu, 26 Nov 2009 11:23:36 +0000 (11:23 +0000)
src/gallium/state_trackers/xorg/xorg_composite.c
src/gallium/state_trackers/xorg/xorg_renderer.c
src/gallium/state_trackers/xorg/xorg_renderer.h

index 99e357328d18c413295f5ce3fb1c570a6bbef27d..67e4eca68c5bb24bf2e43f79a5b493ee46f45bdd 100644 (file)
@@ -492,7 +492,6 @@ boolean xorg_composite_bind_state(struct exa_context *exa,
    renderer_bind_destination(exa->renderer, dst_surf);
 
    bind_blend_state(exa, op, pSrcPicture, pMaskPicture, pDstPicture);
-   renderer_bind_rasterizer(exa->renderer);
    bind_shaders(exa, op, pSrcPicture, pMaskPicture, pDstPicture, pSrc, pMask);
    bind_samplers(exa, op, pSrcPicture, pMaskPicture,
                  pDstPicture, pSrc, pMask, pDst);
@@ -561,7 +560,6 @@ boolean xorg_solid_bind_state(struct exa_context *exa,
    fs_traits = FS_SOLID_FILL;
 
    renderer_bind_destination(exa->renderer, dst_surf);
-   renderer_bind_rasterizer(exa->renderer);
    bind_blend_state(exa, PictOpSrc, NULL, NULL, NULL);
    cso_set_samplers(exa->renderer->cso, 0, NULL);
    cso_set_sampler_textures(exa->renderer->cso, 0, NULL);
index 63a7883cd167fd6b09bad908e617089d8719446a..32b056a362e5b423de327ab2c184a6af2e8d8f48 100644 (file)
@@ -97,10 +97,18 @@ static void
 renderer_init_state(struct xorg_renderer *r)
 {
    struct pipe_depth_stencil_alpha_state dsa;
+   struct pipe_rasterizer_state raster;
 
    /* set common initial clip state */
    memset(&dsa, 0, sizeof(struct pipe_depth_stencil_alpha_state));
    cso_set_depth_stencil_alpha(r->cso, &dsa);
+
+
+   /* XXX: move to renderer_init_state? */
+   memset(&raster, 0, sizeof(struct pipe_rasterizer_state));
+   raster.gl_rasterization_rules = 1;
+   cso_set_rasterizer(r->cso, &raster);
+
 }
 
 
@@ -412,16 +420,6 @@ void renderer_destroy(struct xorg_renderer *r)
 
 
 
-void renderer_bind_rasterizer(struct xorg_renderer *r)
-{
-   struct pipe_rasterizer_state raster;
-
-   /* XXX: move to renderer_init_state? */
-   memset(&raster, 0, sizeof(struct pipe_rasterizer_state));
-   raster.gl_rasterization_rules = 1;
-   cso_set_rasterizer(r->cso, &raster);
-}
-
 void renderer_set_constants(struct xorg_renderer *r,
                             int shader_type,
                             const float *params,
@@ -533,8 +531,6 @@ static void renderer_copy_texture(struct xorg_renderer *r,
    /* texture */
    cso_set_sampler_textures(r->cso, 1, &src);
 
-   renderer_bind_rasterizer(r);
-
    /* shaders */
    shader = xorg_shaders_get(r->shaders,
                              VS_COMPOSITE,
@@ -632,8 +628,6 @@ void renderer_copy_pixmap(struct xorg_renderer *r,
                           int width, int height)
 {
    float dst_loc[4], src_loc[4];
-   float dst_bounds[4], src_bounds[4];
-   float src_shift[4], dst_shift[4], shift[4];
    struct pipe_texture *dst = dst_priv->tex;
    struct pipe_texture *src = src_priv->tex;
 
index 51e0272b46f3ad45dab298bce9286b437a19ff43..249bb719b6a705f7c1e20962504ee27c08b94030 100644 (file)
@@ -44,7 +44,6 @@ void renderer_bind_framebuffer(struct xorg_renderer *r,
                                struct exa_pixmap_priv *priv);
 void renderer_bind_viewport(struct xorg_renderer *r,
                             struct exa_pixmap_priv *dst);
-void renderer_bind_rasterizer(struct xorg_renderer *r);
 void renderer_set_constants(struct xorg_renderer *r,
                             int shader_type,
                             const float *buffer,