[Mesa-dev] [PATCH 1/2] nouveau: always align buffers to 0x100

Ilia Mirkin imirkin at alum.mit.edu
Tue Jul 14 07:35:06 PDT 2015


Actually any buffer can be bound as a constbuf, not just TFB.

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

On Tue, Jul 14, 2015 at 6:57 AM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> Only constbufs must be aligned to 0x100, but since a TFB buffer can be
> rebinded as a constant buffer it must be also aligned.
>
> This patch prevents this behaviour by aligning everything to 256-byte
> increments at buffer creation.
>
> This fixes dmesg fails for the following piglit test:
>   ext_transform_feedback-immediate-reuse-uniform-buffer -auto -fbo
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/gallium/drivers/nouveau/nouveau_buffer.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c b/src/gallium/drivers/nouveau/nouveau_buffer.c
> index 09cdbb5..83d5288 100644
> --- a/src/gallium/drivers/nouveau/nouveau_buffer.c
> +++ b/src/gallium/drivers/nouveau/nouveau_buffer.c
> @@ -40,12 +40,7 @@ static INLINE boolean
>  nouveau_buffer_allocate(struct nouveau_screen *screen,
>                          struct nv04_resource *buf, unsigned domain)
>  {
> -   uint32_t size = buf->base.width0;
> -
> -   if (buf->base.bind & (PIPE_BIND_CONSTANT_BUFFER |
> -                         PIPE_BIND_COMPUTE_RESOURCE |
> -                         PIPE_BIND_SHADER_RESOURCE))
> -      size = align(size, 0x100);
> +   uint32_t size = align(buf->base.width0, 0x100);
>
>     if (domain == NOUVEAU_BO_VRAM) {
>        buf->mm = nouveau_mm_allocate(screen->mm_VRAM, size,
> --
> 2.4.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list