From 37fa0cf4eaf6e67876a1f6b33389f17f99b02461 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Tue, 3 Aug 2010 22:50:19 +0200 Subject: nvfx: add linear flag for buffers --- src/gallium/drivers/nvfx/nv04_surface_2d.c | 1 + src/gallium/drivers/nvfx/nv04_surface_2d.h | 2 -- src/gallium/drivers/nvfx/nvfx_buffer.c | 2 ++ src/gallium/drivers/nvfx/nvfx_resource.h | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/nvfx/nv04_surface_2d.c b/src/gallium/drivers/nvfx/nv04_surface_2d.c index 7acbb505df..cd0f4ce4c9 100644 --- a/src/gallium/drivers/nvfx/nv04_surface_2d.c +++ b/src/gallium/drivers/nvfx/nv04_surface_2d.c @@ -8,6 +8,7 @@ #include "nouveau/nouveau_util.h" #include "nouveau/nouveau_screen.h" #include "nv04_surface_2d.h" +#include "nvfx_resource.h" static INLINE int nv04_surface_format(enum pipe_format format) diff --git a/src/gallium/drivers/nvfx/nv04_surface_2d.h b/src/gallium/drivers/nvfx/nv04_surface_2d.h index 2123c3ed08..b9020dbe96 100644 --- a/src/gallium/drivers/nvfx/nv04_surface_2d.h +++ b/src/gallium/drivers/nvfx/nv04_surface_2d.h @@ -38,6 +38,4 @@ nv04_surface_2d_takedown(struct nv04_surface_2d **); struct nv04_surface* nv04_surface_wrap_for_render(struct pipe_screen *pscreen, struct nv04_surface_2d* eng2d, struct nv04_surface* ns); -#define NVFX_RESOURCE_FLAG_LINEAR (PIPE_RESOURCE_FLAG_DRV_PRIV << 0) - #endif diff --git a/src/gallium/drivers/nvfx/nvfx_buffer.c b/src/gallium/drivers/nvfx/nvfx_buffer.c index 05b824b8f7..4482d9683e 100644 --- a/src/gallium/drivers/nvfx/nvfx_buffer.c +++ b/src/gallium/drivers/nvfx/nvfx_buffer.c @@ -97,6 +97,7 @@ nvfx_buffer_create(struct pipe_screen *pscreen, return NULL; buffer->base = *template; + buffer->base.flags |= NVFX_RESOURCE_FLAG_LINEAR; buffer->vtbl = &nvfx_buffer_vtbl; pipe_reference_init(&buffer->base.reference, 1); buffer->base.screen = pscreen; @@ -132,6 +133,7 @@ nvfx_user_buffer_create(struct pipe_screen *pscreen, pipe_reference_init(&buffer->base.reference, 1); buffer->vtbl = &nvfx_buffer_vtbl; + buffer->base.flags = NVFX_RESOURCE_FLAG_LINEAR; buffer->base.screen = pscreen; buffer->base.format = PIPE_FORMAT_R8_UNORM; buffer->base.usage = PIPE_USAGE_IMMUTABLE; diff --git a/src/gallium/drivers/nvfx/nvfx_resource.h b/src/gallium/drivers/nvfx/nvfx_resource.h index a68c14cf3f..d28bfab961 100644 --- a/src/gallium/drivers/nvfx/nvfx_resource.h +++ b/src/gallium/drivers/nvfx/nvfx_resource.h @@ -20,6 +20,8 @@ struct nvfx_resource { struct nouveau_bo *bo; }; +#define NVFX_RESOURCE_FLAG_LINEAR (PIPE_RESOURCE_FLAG_DRV_PRIV << 0) + #define NVFX_MAX_TEXTURE_LEVELS 16 struct nvfx_miptree { -- cgit v1.2.3