Merge branch 'master' into pipe-format-simplify
[mesa.git] / src / gallium / state_trackers / xorg / xorg_composite.c
index 760adafa065114c2b5cfce5cfa365127f9469aae..1c248a629e681e24625a98125bb6d0323492d761 100644 (file)
@@ -423,23 +423,6 @@ bind_samplers(struct exa_context *exa, int op,
 
 
 
-static void
-setup_fs_constant_buffer(struct exa_context *exa)
-{
-   const int param_bytes = 4 * sizeof(float);
-   const float fs_consts[8] = {
-      0, 0, 0, 1,
-   };
-   renderer_set_constants(exa->renderer, PIPE_SHADER_FRAGMENT,
-                          fs_consts, param_bytes);
-}
-
-static void
-setup_constant_buffers(struct exa_context *exa, struct exa_pixmap_priv *pDst)
-{
-   setup_fs_constant_buffer(exa);
-}
-
 static INLINE boolean matrix_from_pict_transform(PictTransform *trans, float *matrix)
 {
    if (!trans)
@@ -489,13 +472,14 @@ boolean xorg_composite_bind_state(struct exa_context *exa,
 {
    struct pipe_surface *dst_surf = xorg_gpu_surface(exa->scrn, pDst);
 
-   renderer_bind_destination(exa->renderer, dst_surf);
+   renderer_bind_destination(exa->renderer, dst_surf,
+                             pDst->width,
+                             pDst->height);
 
    bind_blend_state(exa, op, pSrcPicture, pMaskPicture, pDstPicture);
    bind_shaders(exa, op, pSrcPicture, pMaskPicture, pDstPicture, pSrc, pMask);
    bind_samplers(exa, op, pSrcPicture, pMaskPicture,
                  pDstPicture, pSrc, pMask, pDst);
-   setup_constant_buffers(exa, pDst);
 
    setup_transforms(exa, pSrcPicture, pMaskPicture);
 
@@ -507,6 +491,8 @@ boolean xorg_composite_bind_state(struct exa_context *exa,
                               exa->num_bound_samplers);
    }
 
+
+   pipe_surface_reference(&dst_surf, NULL);
    return TRUE;
 }
 
@@ -559,11 +545,11 @@ boolean xorg_solid_bind_state(struct exa_context *exa,
    vs_traits = VS_SOLID_FILL;
    fs_traits = FS_SOLID_FILL;
 
-   renderer_bind_destination(exa->renderer, dst_surf);
+   renderer_bind_destination(exa->renderer, dst_surf, 
+                             pixmap->width, pixmap->height);
    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);
-   setup_constant_buffers(exa, pixmap);
 
    shader = xorg_shaders_get(exa->renderer->shaders, vs_traits, fs_traits);
    cso_set_vertex_shader_handle(exa->renderer->cso, shader.vs);
@@ -571,6 +557,7 @@ boolean xorg_solid_bind_state(struct exa_context *exa,
 
    renderer_begin_solid(exa->renderer);
 
+   pipe_surface_reference(&dst_surf, NULL);
    return TRUE;
 }