gallium: Add texture usage information to surface_buffer_create
authorJakob Bornecrantz <jakob@vmware.com>
Tue, 11 Aug 2009 17:33:58 +0000 (18:33 +0100)
committerJakob Bornecrantz <jakob@vmware.com>
Tue, 11 Aug 2009 17:34:43 +0000 (18:34 +0100)
We need aditional meta data about the usage of the surface
in softpipe because we need to be able tell the diffrence
between PRIMARY and DISPLAY_TARGET surfaces.

src/gallium/auxiliary/util/u_simple_screen.c
src/gallium/auxiliary/util/u_timed_winsys.c
src/gallium/drivers/identity/id_screen.c
src/gallium/drivers/softpipe/sp_texture.c
src/gallium/drivers/trace/tr_screen.c
src/gallium/include/pipe/internal/p_winsys_screen.h
src/gallium/include/pipe/p_screen.h

index 8114b53cd0d3992976fa1a64f13851132e278a4f..f01296b40fcad13f3e9f1877799e74249fd93070 100644 (file)
@@ -65,12 +65,13 @@ pass_surface_buffer_create(struct pipe_screen *screen,
                            unsigned width, unsigned height,
                            enum pipe_format format,
                            unsigned usage,
+                           unsigned tex_usage,
                            unsigned *stride)
 {
    struct pipe_buffer *buffer =
       screen->winsys->surface_buffer_create(screen->winsys,
                                                 width, height,
-                                                format, usage, stride);
+                                                format, usage, tex_usage, stride);
 
    buffer->screen = screen;
 
index 77b2a3a1c875d54d42e100781a8ce9cb5a0ee837..178acdca4dff0664181f64b8978c7b9896dd392a 100644 (file)
@@ -212,13 +212,14 @@ timed_surface_buffer_create(struct pipe_winsys *winsys,
                               unsigned width, unsigned height,
                               enum pipe_format format, 
                               unsigned usage,
+                              unsigned tex_usage,
                               unsigned *stride)
 {
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
    uint64_t start = time_start();
 
    struct pipe_buffer *ret = backend->surface_buffer_create( backend, width, height, 
-                                                             format, usage, stride );
+                                                             format, usage, tex_usage, stride );
 
    time_finish(winsys, start, 7, __FUNCTION__);
    
index 259f1be36e7ff0d8a7b76660fb4f8945cc5a76e7..26439637d08ffffeb98acb4d9a7c59bab458b592 100644 (file)
@@ -289,6 +289,7 @@ identity_screen_surface_buffer_create(struct pipe_screen *_screen,
                                       unsigned height,
                                       enum pipe_format format,
                                       unsigned usage,
+                                      unsigned tex_usage,
                                       unsigned *stride)
 {
    struct identity_screen *id_screen = identity_screen(_screen);
@@ -300,6 +301,7 @@ identity_screen_surface_buffer_create(struct pipe_screen *_screen,
                                           height,
                                           format,
                                           usage,
+                                          tex_usage,
                                           stride);
 
    if (result)
index b7e52af0322ff4d8df036d821eb0fdb4555c2c40..70f0932431146d45409db346b4fd4e28fb811ee5 100644 (file)
@@ -95,6 +95,7 @@ softpipe_displaytarget_layout(struct pipe_screen *screen,
 {
    unsigned usage = (PIPE_BUFFER_USAGE_CPU_READ_WRITE |
                      PIPE_BUFFER_USAGE_GPU_READ_WRITE);
+   unsigned tex_usage = spt->base.tex_usage;
 
    spt->base.nblocksx[0] = pf_get_nblocksx(&spt->base.block, spt->base.width[0]);  
    spt->base.nblocksy[0] = pf_get_nblocksy(&spt->base.block, spt->base.height[0]);  
@@ -104,6 +105,7 @@ softpipe_displaytarget_layout(struct pipe_screen *screen,
                                                 spt->base.height[0],
                                                 spt->base.format,
                                                 usage,
+                                                tex_usage,
                                                 &spt->stride[0]);
 
    return spt->buffer != NULL;
index 5b1e26a52d7eac115e822f0867b0a9ac9a628720..26f1c04594f305316452cb11694144f88fe08303 100644 (file)
@@ -462,6 +462,7 @@ trace_screen_surface_buffer_create(struct pipe_screen *_screen,
                                    unsigned width, unsigned height,
                                    enum pipe_format format,
                                    unsigned usage,
+                                   unsigned tex_usage,
                                    unsigned *pstride)
 {
    struct trace_screen *tr_scr = trace_screen(_screen);
@@ -476,11 +477,13 @@ trace_screen_surface_buffer_create(struct pipe_screen *_screen,
    trace_dump_arg(uint, height);
    trace_dump_arg(format, format);
    trace_dump_arg(uint, usage);
+   trace_dump_arg(uint, tex_usage);
 
    result = screen->surface_buffer_create(screen,
                                           width, height,
                                           format,
                                           usage,
+                                          tex_usage,
                                           pstride);
 
    stride = *pstride;
index f4a29e63c7e89b22b08aa287268c7aed96d7afd5..a1542dada707e3940ffd06ff4992b5ff524ffbc2 100644 (file)
@@ -140,6 +140,7 @@ struct pipe_winsys
                                                unsigned width, unsigned height,
                                                enum pipe_format format,
                                                unsigned usage,
+                                               unsigned tex_usage,
                                                unsigned *stride);
 
 
index 6cbdd759434d9b129c6efdc38880b9c31643be87..3f30c52a16927e7b5782a38e48200369019590a4 100644 (file)
@@ -194,6 +194,7 @@ struct pipe_screen {
                                                unsigned width, unsigned height,
                                                enum pipe_format format,
                                                unsigned usage,
+                                               unsigned tex_usage,
                                                unsigned *stride);