nvfx: add linear flag for buffers
authorLuca Barbieri <luca@luca-barbieri.com>
Tue, 3 Aug 2010 20:50:19 +0000 (22:50 +0200)
committerLuca Barbieri <luca@luca-barbieri.com>
Sat, 21 Aug 2010 18:42:14 +0000 (20:42 +0200)
src/gallium/drivers/nvfx/nv04_surface_2d.c
src/gallium/drivers/nvfx/nv04_surface_2d.h
src/gallium/drivers/nvfx/nvfx_buffer.c
src/gallium/drivers/nvfx/nvfx_resource.h

index 7acbb505df3387ffda7418a01862170fd395ab8a..cd0f4ce4c93de0568f93c6c2c091ade240582005 100644 (file)
@@ -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)
index 2123c3ed08b49afb3a7c4ad7457a1d4870d98368..b9020dbe961057d71e7e53cb1245cabafe2389f2 100644 (file)
@@ -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
index 05b824b8f74f57b9e1fab2220b4962743c883f42..4482d9683ed70073718a7d674940978dcc146dad 100644 (file)
@@ -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;
index a68c14cf3fbe9ae045a595d6420faf062a247a19..d28bfab9615063b375684a6b71e5bd0159822319 100644 (file)
@@ -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 {