st/xorg: don't set up constant buffer for non-xv fragment shaders
authorKeith Whitwell <keithw@vmware.com>
Thu, 26 Nov 2009 10:40:40 +0000 (10:40 +0000)
committerKeith Whitwell <keithw@vmware.com>
Thu, 26 Nov 2009 11:23:36 +0000 (11:23 +0000)
These currently don't reference any constants.  Can add this back
if newer shaders need them, but in the meantime don't create
a new constant buffer every time we do a blit.

src/gallium/state_trackers/xorg/xorg_composite.c
src/gallium/state_trackers/xorg/xorg_renderer.c

index 760adafa065114c2b5cfce5cfa365127f9469aae..a35249d60d21a8992793fb504751520488721cf3 100644 (file)
@@ -423,22 +423,7 @@ 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)
 {
@@ -495,7 +480,6 @@ boolean xorg_composite_bind_state(struct exa_context *exa,
    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);
 
@@ -563,7 +547,6 @@ boolean xorg_solid_bind_state(struct exa_context *exa,
    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);
index 32b056a362e5b423de327ab2c184a6af2e8d8f48..589942c9156def4e88d365955cbf1d84b15b7ff8 100644 (file)
@@ -441,17 +441,6 @@ void renderer_set_constants(struct xorg_renderer *r,
    r->pipe->set_constant_buffer(r->pipe, shader_type, 0, cbuf);
 }
 
-static void
-setup_fs_constant_buffer(struct xorg_renderer *r)
-{
-   const int param_bytes = 4 * sizeof(float);
-   const float fs_consts[8] = {
-      0, 0, 0, 1,
-   };
-   renderer_set_constants(r, PIPE_SHADER_FRAGMENT,
-                          fs_consts, param_bytes);
-}
-
 
 static void renderer_copy_texture(struct xorg_renderer *r,
                                   struct pipe_texture *src,
@@ -538,8 +527,6 @@ static void renderer_copy_texture(struct xorg_renderer *r,
    cso_set_vertex_shader_handle(r->cso, shader.vs);
    cso_set_fragment_shader_handle(r->cso, shader.fs);
 
-   setup_fs_constant_buffer(r);
-
    /* draw quad */
    buf = setup_vertex_data_tex(r,
                                dx1, dy1,