[Mesa-dev] [PATCH] llvmpipe: Take in consideration all current constant buffers when mapping.

Roland Scheidegger sroland at vmware.com
Thu Apr 18 12:05:44 PDT 2013


Am 18.04.2013 20:06, schrieb jfonseca at vmware.com:
> From: José Fonseca <jfonseca at vmware.com>
> 
> ---
>  src/gallium/drivers/llvmpipe/lp_texture.c |   12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c
> index 99bd6d3..0804619 100644
> --- a/src/gallium/drivers/llvmpipe/lp_texture.c
> +++ b/src/gallium/drivers/llvmpipe/lp_texture.c
> @@ -669,9 +669,15 @@ llvmpipe_transfer_map( struct pipe_context *pipe,
>  
>     /* Check if we're mapping the current constant buffer */
>     if ((usage & PIPE_TRANSFER_WRITE) &&
> -       resource == llvmpipe->constants[PIPE_SHADER_FRAGMENT][0].buffer) {
> -      /* constants may have changed */
> -      llvmpipe->dirty |= LP_NEW_CONSTANTS;
> +       (resource->bind & PIPE_BIND_CONSTANT_BUFFER)) {
> +      unsigned i;
> +      for (i = 0; i < Elements(llvmpipe->constants[PIPE_SHADER_FRAGMENT]); ++i) {
> +         if (resource == llvmpipe->constants[PIPE_SHADER_FRAGMENT][i].buffer) {
> +            /* constants may have changed */
> +            llvmpipe->dirty |= LP_NEW_CONSTANTS;
> +            break;
> +         }
> +      }
>     }
>  
>     lpt = CALLOC_STRUCT(llvmpipe_transfer);
> 

Good catch!
Reviewed-by: Roland Scheidegger <sroland at vmware.com>


More information about the mesa-dev mailing list