Commit c2cb7713 authored by Samuel Pitoiset's avatar Samuel Pitoiset
Browse files

nouveau: always align buffers to 0x100



Only constbufs must be aligned to 0x100, but since all buffers can be
rebinded as constant buffers they 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's avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin's avatarIlia Mirkin <imirkin@alum.mit.edu>
parent 19a6214b
...@@ -40,13 +40,7 @@ static INLINE boolean ...@@ -40,13 +40,7 @@ static INLINE boolean
nouveau_buffer_allocate(struct nouveau_screen *screen, nouveau_buffer_allocate(struct nouveau_screen *screen,
struct nv04_resource *buf, unsigned domain) struct nv04_resource *buf, unsigned domain)
{ {
uint32_t size = buf->base.width0; uint32_t size = align(buf->base.width0, 0x100);
if (buf->base.bind & (PIPE_BIND_CONSTANT_BUFFER |
PIPE_BIND_COMPUTE_RESOURCE |
PIPE_BIND_SHADER_BUFFER |
PIPE_BIND_SHADER_IMAGE))
size = align(size, 0x100);
if (domain == NOUVEAU_BO_VRAM) { if (domain == NOUVEAU_BO_VRAM) {
buf->mm = nouveau_mm_allocate(screen->mm_VRAM, size, buf->mm = nouveau_mm_allocate(screen->mm_VRAM, size,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment