summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2010-03-13 16:38:02 +0000
committerKeith Whitwell <keithw@vmware.com>2010-03-13 16:38:02 +0000
commitee6b3bc730fcdaf8da3646d62f04578ec06d36a1 (patch)
treedfe2215194d09925ef085d114298078703628e4d /src/gallium
parent1830880212445189fe267d615075239ed17c7cc0 (diff)
wip2
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/Makefile20
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_aaline.c17
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_pstipple.c8
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer.h4
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c4
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c5
-rw-r--r--src/gallium/auxiliary/util/u_debug.c4
-rw-r--r--src/gallium/auxiliary/util/u_draw_quad.c4
-rw-r--r--src/gallium/auxiliary/util/u_gen_mipmap.c12
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h93
-rw-r--r--src/gallium/auxiliary/util/u_rect.c6
-rw-r--r--src/gallium/auxiliary/util/u_sampler.c6
-rw-r--r--src/gallium/auxiliary/util/u_sampler.h4
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_texture.c8
-rw-r--r--src/gallium/drivers/failover/fo_context.c2
-rw-r--r--src/gallium/drivers/failover/fo_state.c2
-rw-r--r--src/gallium/drivers/i915/i915_texture.c8
-rw-r--r--src/gallium/drivers/i965/brw_pipe_flush.c2
-rw-r--r--src/gallium/drivers/i965/brw_pipe_sampler.c4
-rw-r--r--src/gallium/drivers/i965/brw_screen.h7
-rw-r--r--src/gallium/drivers/i965/brw_screen_surface.c2
-rw-r--r--src/gallium/drivers/i965/brw_screen_texture.c34
-rw-r--r--src/gallium/drivers/identity/id_context.c56
-rw-r--r--src/gallium/drivers/identity/id_objects.c96
-rw-r--r--src/gallium/drivers/identity/id_objects.h70
-rw-r--r--src/gallium/drivers/identity/id_screen.c88
-rw-r--r--src/gallium/drivers/llvmpipe/lp_scene.c8
-rw-r--r--src/gallium/drivers/llvmpipe/lp_texture.c8
-rw-r--r--src/gallium/drivers/nv30/nv30_transfer.c4
-rw-r--r--src/gallium/drivers/nv40/nv40_transfer.c4
-rw-r--r--src/gallium/drivers/nv50/nv50_transfer.c4
-rw-r--r--src/gallium/drivers/r300/r300_transfer.c10
-rw-r--r--src/gallium/drivers/softpipe/sp_buffer.c44
-rw-r--r--src/gallium/drivers/softpipe/sp_buffer.h8
-rw-r--r--src/gallium/drivers/softpipe/sp_context.c16
-rw-r--r--src/gallium/drivers/softpipe/sp_state_fs.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_tile_cache.c10
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c21
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c12
-rw-r--r--src/gallium/drivers/svga/svga_screen_texture.c10
-rw-r--r--src/gallium/drivers/trace/tr_context.c14
-rw-r--r--src/gallium/drivers/trace/tr_rbug.c4
-rw-r--r--src/gallium/drivers/trace/tr_texture.c4
-rw-r--r--src/gallium/include/pipe/p_context.h10
-rw-r--r--src/gallium/include/pipe/p_defines.h7
-rw-r--r--src/gallium/include/pipe/p_screen.h26
-rw-r--r--src/gallium/include/pipe/p_state.h18
-rw-r--r--src/gallium/include/pipe/p_video_context.h1
-rw-r--r--src/gallium/state_trackers/python/st_device.c2
-rw-r--r--src/gallium/state_trackers/python/st_sample.c2
-rw-r--r--src/gallium/state_trackers/vega/api_filters.c2
-rw-r--r--src/gallium/state_trackers/vega/api_images.c2
-rw-r--r--src/gallium/state_trackers/vega/image.c4
-rw-r--r--src/gallium/state_trackers/vega/paint.c2
-rw-r--r--src/gallium/state_trackers/vega/st_inlines.h8
-rw-r--r--src/gallium/state_trackers/xorg/xorg_crtc.c2
-rw-r--r--src/gallium/state_trackers/xorg/xorg_exa.c4
-rw-r--r--src/gallium/state_trackers/xorg/xorg_xv.c6
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c4
60 files changed, 357 insertions, 494 deletions
diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile
index e2796d5bd3..425576db83 100644
--- a/src/gallium/auxiliary/Makefile
+++ b/src/gallium/auxiliary/Makefile
@@ -54,16 +54,16 @@ C_SOURCES = \
os/os_stream_str.c \
os/os_stream_null.c \
os/os_time.c \
- pipebuffer/pb_buffer_fenced.c \
- pipebuffer/pb_buffer_malloc.c \
- pipebuffer/pb_bufmgr_alt.c \
- pipebuffer/pb_bufmgr_cache.c \
- pipebuffer/pb_bufmgr_debug.c \
- pipebuffer/pb_bufmgr_mm.c \
- pipebuffer/pb_bufmgr_ondemand.c \
- pipebuffer/pb_bufmgr_pool.c \
- pipebuffer/pb_bufmgr_slab.c \
- pipebuffer/pb_validate.c \
+# pipebuffer/pb_buffer_fenced.c \
+# pipebuffer/pb_buffer_malloc.c \
+# pipebuffer/pb_bufmgr_alt.c \
+# pipebuffer/pb_bufmgr_cache.c \
+# pipebuffer/pb_bufmgr_debug.c \
+# pipebuffer/pb_bufmgr_mm.c \
+# pipebuffer/pb_bufmgr_ondemand.c \
+# pipebuffer/pb_bufmgr_pool.c \
+# pipebuffer/pb_bufmgr_slab.c \
+# pipebuffer/pb_validate.c \
rbug/rbug_connection.c \
rbug/rbug_core.c \
rbug/rbug_texture.c \
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index f4615064e6..a715eb230f 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -396,7 +396,7 @@ aaline_create_texture(struct aaline_stage *aaline)
{
struct pipe_context *pipe = aaline->pipe;
struct pipe_screen *screen = pipe->screen;
- struct pipe_texture texTemp;
+ struct pipe_resource texTemp;
struct pipe_sampler_view viewTempl;
uint level;
@@ -408,7 +408,7 @@ aaline_create_texture(struct aaline_stage *aaline)
texTemp.height0 = 1 << MAX_TEXTURE_LEVEL;
texTemp.depth0 = 1;
- aaline->texture = screen->texture_create(screen, &texTemp);
+ aaline->texture = screen->resource_create(screen, &texTemp);
if (!aaline->texture)
return FALSE;
@@ -428,16 +428,23 @@ aaline_create_texture(struct aaline_stage *aaline)
*/
for (level = 0; level <= MAX_TEXTURE_LEVEL; level++) {
struct pipe_transfer *transfer;
+ struct pipe_box box;
const uint size = u_minify(aaline->texture->width0, level);
ubyte *data;
uint i, j;
assert(aaline->texture->width0 == aaline->texture->height0);
+ u_box_orgin_2d( size, size, &box );
+
/* This texture is new, no need to flush.
*/
- transfer = pipe->get_tex_transfer(pipe, aaline->texture, 0, level, 0,
- PIPE_TRANSFER_WRITE, 0, 0, size, size);
+ transfer = pipe->get_transfer(pipe,
+ aaline->texture,
+ u_subresource(0, level),
+ PIPE_TRANSFER_WRITE,
+ &box);
+
data = pipe->transfer_map(pipe, transfer);
if (data == NULL)
return FALSE;
@@ -463,7 +470,7 @@ aaline_create_texture(struct aaline_stage *aaline)
/* unmap */
pipe->transfer_unmap(pipe, transfer);
- pipe->tex_transfer_destroy(pipe, transfer);
+ pipe->transfer_destroy(pipe, transfer);
}
return TRUE;
}
diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
index 794fd81d70..2436ce373b 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
@@ -389,8 +389,8 @@ pstip_update_texture(struct pstip_stage *pstip)
*/
pipe->flush( pipe, PIPE_FLUSH_TEXTURE_CACHE, NULL );
- transfer = pipe->get_tex_transfer(pipe, pstip->texture, 0, 0, 0,
- PIPE_TRANSFER_WRITE, 0, 0, 32, 32);
+ transfer = pipe_get_transfer(pipe, pstip->texture, 0, 0, 0,
+ PIPE_TRANSFER_WRITE, 0, 0, 32, 32);
data = pipe->transfer_map(pipe, transfer);
/*
@@ -414,7 +414,7 @@ pstip_update_texture(struct pstip_stage *pstip)
/* unmap */
pipe->transfer_unmap(pipe, transfer);
- pipe->tex_transfer_destroy(pipe, transfer);
+ pipe->transfer_destroy(pipe, transfer);
}
@@ -437,7 +437,7 @@ pstip_create_texture(struct pstip_stage *pstip)
texTemp.height0 = 32;
texTemp.depth0 = 1;
- pstip->texture = screen->texture_create(screen, &texTemp);
+ pstip->texture = screen->resource_create(screen, &texTemp);
if (pstip->texture == NULL)
return FALSE;
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
index 34b1b77df4..c4c9577c7c 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
@@ -83,7 +83,7 @@ typedef unsigned pb_size;
*/
struct pb_buffer
{
- struct pipe_buffer base;
+ struct pipe_resource base;
/**
* Pointer to the virtual function table.
@@ -196,7 +196,7 @@ pb_get_base_buffer( struct pb_buffer *buf,
assert(buf->vtbl->get_base_buffer);
buf->vtbl->get_base_buffer(buf, base_buf, offset);
assert(*base_buf);
- assert(*offset < (*base_buf)->base.size);
+ assert(*offset < (*base_buf)->base.width0);
}
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
index d97f749b6e..5bc717b9c4 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
@@ -210,7 +210,7 @@ fenced_manager_dump_locked(struct fenced_manager *fenced_mgr)
assert(!fenced_buf->fence);
debug_printf("%10p %7u %8u %7s\n",
(void *) fenced_buf,
- fenced_buf->base.base.size,
+ fenced_buf->base.base.width0,
p_atomic_read(&fenced_buf->base.base.reference.count),
fenced_buf->buffer ? "gpu" : (fenced_buf->data ? "cpu" : "none"));
curr = next;
@@ -226,7 +226,7 @@ fenced_manager_dump_locked(struct fenced_manager *fenced_mgr)
signaled = ops->fence_signalled(ops, fenced_buf->fence, 0);
debug_printf("%10p %7u %8u %7s %10p %s\n",
(void *) fenced_buf,
- fenced_buf->base.base.size,
+ fenced_buf->base.base.width0,
p_atomic_read(&fenced_buf->base.base.reference.count),
"gpu",
(void *) fenced_buf->fence,
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
index 6bdce5fcb0..b22cf6c642 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
@@ -135,9 +135,10 @@ pb_malloc_buffer_create(pb_size size,
return NULL;
pipe_reference_init(&buf->base.base.reference, 1);
- buf->base.base.alignment = desc->alignment;
buf->base.base.usage = desc->usage;
- buf->base.base.size = size;
+ buf->base.base.width0 = size;
+ buf->base.base.height0 = 1;
+ buf->base.base.depth0 = 1;
buf->base.vtbl = &malloc_buffer_vtbl;
buf->data = align_malloc(size, desc->alignment < sizeof(void*) ? sizeof(void*) : desc->alignment);
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index e997cfa8a3..619bae57b7 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -440,7 +440,7 @@ void debug_dump_surface(struct pipe_context *pipe,
*/
texture = surface->texture;
- transfer = pipe->get_tex_transfer(pipe, texture, surface->face,
+ transfer = pipe->get_transfer(pipe, texture, surface->face,
surface->level, surface->zslice,
PIPE_TRANSFER_READ, 0, 0, surface->width,
surface->height);
@@ -525,7 +525,7 @@ debug_dump_surface_bmp(struct pipe_context *pipe,
struct pipe_transfer *transfer;
struct pipe_texture *texture = surface->texture;
- transfer = pipe->get_tex_transfer(pipe, texture, surface->face,
+ transfer = pipe->get_transfer(pipe, texture, surface->face,
surface->level, surface->zslice,
PIPE_TRANSFER_READ, 0, 0, surface->width,
surface->height);
diff --git a/src/gallium/auxiliary/util/u_draw_quad.c b/src/gallium/auxiliary/util/u_draw_quad.c
index 8c194102bf..ec90c2fd65 100644
--- a/src/gallium/auxiliary/util/u_draw_quad.c
+++ b/src/gallium/auxiliary/util/u_draw_quad.c
@@ -38,7 +38,7 @@
*/
void
util_draw_vertex_buffer(struct pipe_context *pipe,
- struct pipe_buffer *vbuf,
+ struct pipe_resource *vbuf,
uint offset,
uint prim_type,
uint num_verts,
@@ -73,7 +73,7 @@ void
util_draw_texquad(struct pipe_context *pipe,
float x0, float y0, float x1, float y1, float z)
{
- struct pipe_buffer *vbuf;
+ struct pipe_resource *vbuf;
uint numAttribs = 2, vertexBytes, i, j;
vertexBytes = 4 * (4 * numAttribs * sizeof(float));
diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c
index 5c51b53d7b..5487923cf7 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.c
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.c
@@ -1127,11 +1127,11 @@ make_1d_mipmap(struct gen_mipmap_state *ctx,
struct pipe_transfer *srcTrans, *dstTrans;
void *srcMap, *dstMap;
- srcTrans = pipe->get_tex_transfer(pipe, pt, face, srcLevel, zslice,
+ srcTrans = pipe->get_transfer(pipe, pt, face, srcLevel, zslice,
PIPE_TRANSFER_READ, 0, 0,
u_minify(pt->width0, srcLevel),
u_minify(pt->height0, srcLevel));
- dstTrans = pipe->get_tex_transfer(pipe, pt, face, dstLevel, zslice,
+ dstTrans = pipe->get_transfer(pipe, pt, face, dstLevel, zslice,
PIPE_TRANSFER_WRITE, 0, 0,
u_minify(pt->width0, dstLevel),
u_minify(pt->height0, dstLevel));
@@ -1169,11 +1169,11 @@ make_2d_mipmap(struct gen_mipmap_state *ctx,
struct pipe_transfer *srcTrans, *dstTrans;
ubyte *srcMap, *dstMap;
- srcTrans = pipe->get_tex_transfer(pipe, pt, face, srcLevel, zslice,
+ srcTrans = pipe->get_transfer(pipe, pt, face, srcLevel, zslice,
PIPE_TRANSFER_READ, 0, 0,
u_minify(pt->width0, srcLevel),
u_minify(pt->height0, srcLevel));
- dstTrans = pipe->get_tex_transfer(pipe, pt, face, dstLevel, zslice,
+ dstTrans = pipe->get_transfer(pipe, pt, face, dstLevel, zslice,
PIPE_TRANSFER_WRITE, 0, 0,
u_minify(pt->width0, dstLevel),
u_minify(pt->height0, dstLevel));
@@ -1214,11 +1214,11 @@ make_3d_mipmap(struct gen_mipmap_state *ctx,
struct pipe_transfer *srcTrans, *dstTrans;
ubyte *srcMap, *dstMap;
- srcTrans = pipe->get_tex_transfer(pipe, pt, face, srcLevel, zslice,
+ srcTrans = pipe->get_transfer(pipe, pt, face, srcLevel, zslice,
PIPE_TRANSFER_READ, 0, 0,
u_minify(pt->width0, srcLevel),
u_minify(pt->height0, srcLevel));
- dstTrans = pipe->get_tex_transfer(pipe, pt, face, dstLevel, zslice,
+ dstTrans = pipe->get_transfer(pipe, pt, face, dstLevel, zslice,
PIPE_TRANSFER_WRITE, 0, 0,
u_minify(pt->width0, dstLevel),
u_minify(pt->height0, dstLevel));
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index 99e4663958..2599be554e 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -88,18 +88,6 @@ pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference)
return destroy;
}
-static INLINE void
-pipe_buffer_reference(struct pipe_buffer **ptr, struct pipe_buffer *buf)
-{
- struct pipe_buffer *old_buf;
-
- assert(ptr);
- old_buf = *ptr;
-
- if (pipe_reference(&(*ptr)->base.reference, &buf->base.reference))
- old_buf->base.screen->resource_destroy(&old_buf->base);
- *ptr = buf;
-}
static INLINE void
pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
@@ -107,19 +95,10 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
struct pipe_surface *old_surf = *ptr;
if (pipe_reference(&(*ptr)->reference, &surf->reference))
- old_surf->resource->screen->tex_surface_destroy(old_surf);
+ old_surf->texture->screen->tex_surface_destroy(old_surf);
*ptr = surf;
}
-static INLINE void
-pipe_texture_reference(struct pipe_texture **ptr, struct pipe_texture *tex)
-{
- struct pipe_texture *old_tex = *ptr;
-
- if (pipe_reference(&(*ptr)->base.reference, &tex->base.reference))
- old_tex->base.screen->resource_destroy(&old_tex->base);
- *ptr = tex;
-}
static INLINE void
pipe_resource_reference(struct pipe_resource **ptr, struct pipe_resource *tex)
@@ -131,6 +110,9 @@ pipe_resource_reference(struct pipe_resource **ptr, struct pipe_resource *tex)
*ptr = tex;
}
+#define pipe_buffer_reference pipe_resource_reference
+#define pipe_texture_reference pipe_resource_reference
+
static INLINE void
pipe_sampler_view_reference(struct pipe_sampler_view **ptr, struct pipe_sampler_view *view)
{
@@ -146,32 +128,31 @@ pipe_sampler_view_reference(struct pipe_sampler_view **ptr, struct pipe_sampler_
* Convenience wrappers for screen buffer functions.
*/
-static INLINE struct pipe_buffer *
+static INLINE struct pipe_resource *
pipe_buffer_create( struct pipe_screen *screen,
unsigned alignment, unsigned usage, unsigned size )
{
- struct pipe_buffer buffer;
+ struct pipe_resource buffer;
memset(&buffer, 0, sizeof buffer);
- buffer.base.target = PIPE_RESOURCE_BUFFER;
- buffer.base.format = PIPE_FORMAT_R8_UNORM; /* want TYPELESS or similar */
- buffer.base.usage = usage;
- buffer.base.width0 = size;
- buffer.base.height0 = 1;
- buffer.base.depth0 = 1;
- return (struct pipe_buffer *)screen->resource_create(screen, &buffer.base);
+ buffer.target = PIPE_RESOURCE_BUFFER;
+ buffer.format = PIPE_FORMAT_R8_UNORM; /* want TYPELESS or similar */
+ buffer.usage = usage;
+ buffer.width0 = size;
+ buffer.height0 = 1;
+ buffer.depth0 = 1;
+ return screen->resource_create(screen, &buffer);
}
-#if 0
-static INLINE struct pipe_buffer *
+
+static INLINE struct pipe_resource *
pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size )
{
return screen->user_buffer_create(screen, ptr, size);
}
-#endif
static INLINE void *
pipe_buffer_map_range(struct pipe_context *pipe,
- struct pipe_buffer *buffer,
+ struct pipe_resource *buffer,
unsigned offset,
unsigned length,
unsigned usage,
@@ -179,14 +160,14 @@ pipe_buffer_map_range(struct pipe_context *pipe,
{
struct pipe_box box;
- assert(offset < buffer->base.width0);
- assert(offset + length <= buffer->base.width0);
+ assert(offset < buffer->width0);
+ assert(offset + length <= buffer->width0);
assert(length);
u_box_1d(offset, length, &box);
*transfer = pipe->get_transfer( pipe,
- &buffer->base,
+ buffer,
u_subresource(0, 0),
usage,
&box);
@@ -200,17 +181,17 @@ pipe_buffer_map_range(struct pipe_context *pipe,
static INLINE void *
pipe_buffer_map(struct pipe_context *pipe,
- struct pipe_buffer *buffer,
+ struct pipe_resource *buffer,
unsigned usage,
struct pipe_transfer **transfer)
{
- return pipe_buffer_map_range(pipe, buffer, usage, 0, buffer->base.width0, transfer);
+ return pipe_buffer_map_range(pipe, buffer, usage, 0, buffer->width0, transfer);
}
static INLINE void
pipe_buffer_unmap(struct pipe_context *pipe,
- struct pipe_buffer *buf,
+ struct pipe_resource *buf,
struct pipe_transfer *transfer)
{
if (transfer) {
@@ -236,7 +217,7 @@ pipe_buffer_flush_mapped_range(struct pipe_context *pipe,
static INLINE void
pipe_buffer_write(struct pipe_context *pipe,
- struct pipe_buffer *buf,
+ struct pipe_resource *buf,
unsigned offset,
unsigned size,
const void *data)
@@ -255,7 +236,7 @@ pipe_buffer_write(struct pipe_context *pipe,
box.d = 1;
pipe->transfer_inline_write( pipe,
- &buf->base,
+ buf,
subresource,
PIPE_TRANSFER_WRITE,
&box,
@@ -270,7 +251,7 @@ pipe_buffer_write(struct pipe_context *pipe,
*/
static INLINE void
pipe_buffer_write_nooverlap(struct pipe_context *pipe,
- struct pipe_buffer *buf,
+ struct pipe_resource *buf,
unsigned offset, unsigned size,
const void *data)
{
@@ -288,7 +269,7 @@ pipe_buffer_write_nooverlap(struct pipe_context *pipe,
box.d = 1;
pipe->transfer_inline_write(pipe,
- &buf->base,
+ buf,
subresource,
(PIPE_TRANSFER_WRITE |
PIPE_TRANSFER_NOOVERWRITE),
@@ -298,7 +279,7 @@ pipe_buffer_write_nooverlap(struct pipe_context *pipe,
static INLINE void
pipe_buffer_read(struct pipe_context *pipe,
- struct pipe_buffer *buf,
+ struct pipe_resource *buf,
unsigned offset, unsigned size,
void *data)
{
@@ -316,13 +297,31 @@ pipe_buffer_read(struct pipe_context *pipe,
box.d = 1;
pipe->transfer_inline_read( pipe,
- &buf->base,
+ buf,
subresource,
PIPE_TRANSFER_READ,
&box,
data);
}
+static INLINE struct pipe_transfer *
+pipe_get_transfer( struct pipe_context *context,
+ struct pipe_resource *resource,
+ unsigned face, unsigned level,
+ unsigned zslice,
+ enum pipe_transfer_usage usage,
+ unsigned x, unsigned y,
+ unsigned w, unsigned h)
+{
+ struct pipe_box box;
+ u_box_2d_zslice( x, y, w, h, zslice, &box );
+ return context->get_transfer( context,
+ resource,
+ u_subresource(face, level),
+ usage,
+ &box );
+}
+
static INLINE void *
pipe_transfer_map( struct pipe_context *context,
struct pipe_transfer *transfer )
diff --git a/src/gallium/auxiliary/util/u_rect.c b/src/gallium/auxiliary/util/u_rect.c
index e73797f1b7..82ee36b08e 100644
--- a/src/gallium/auxiliary/util/u_rect.c
+++ b/src/gallium/auxiliary/util/u_rect.c
@@ -181,7 +181,7 @@ util_surface_copy(struct pipe_context *pipe,
src_format = src->texture->format;
dst_format = dst->texture->format;
- src_trans = pipe->get_tex_transfer(pipe,
+ src_trans = pipe->get_transfer(pipe,
src->texture,
src->face,
src->level,
@@ -189,7 +189,7 @@ util_surface_copy(struct pipe_context *pipe,
PIPE_TRANSFER_READ,
src_x, src_y, w, h);
- dst_trans = pipe->get_tex_transfer(pipe,
+ dst_trans = pipe->get_transfer(pipe,
dst->texture,
dst->face,
dst->level,
@@ -248,7 +248,7 @@ util_surface_fill(struct pipe_context *pipe,
assert(dst->texture);
if (!dst->texture)
return;
- dst_trans = pipe->get_tex_transfer(pipe,
+ dst_trans = pipe->get_transfer(pipe,
dst->texture,
dst->face,
dst->level,
diff --git a/src/gallium/auxiliary/util/u_sampler.c b/src/gallium/auxiliary/util/u_sampler.c
index 4d8f861ce4..e77f562ea2 100644
--- a/src/gallium/auxiliary/util/u_sampler.c
+++ b/src/gallium/auxiliary/util/u_sampler.c
@@ -32,7 +32,7 @@
static void
default_template(struct pipe_sampler_view *view,
- const struct pipe_texture *texture,
+ const struct pipe_resource *texture,
enum pipe_format format,
unsigned expand_green_blue)
{
@@ -77,7 +77,7 @@ default_template(struct pipe_sampler_view *view,
void
u_sampler_view_default_template(struct pipe_sampler_view *view,
- const struct pipe_texture *texture,
+ const struct pipe_resource *texture,
enum pipe_format format)
{
/* Expand to (0, 0, 0, 1) */
@@ -89,7 +89,7 @@ u_sampler_view_default_template(struct pipe_sampler_view *view,
void
u_sampler_view_default_dx9_template(struct pipe_sampler_view *view,
- const struct pipe_texture *texture,
+ const struct pipe_resource *texture,
enum pipe_format format)
{
/* Expand to (1, 1, 1, 1) */
diff --git a/src/gallium/auxiliary/util/u_sampler.h b/src/gallium/auxiliary/util/u_sampler.h
index bdd061c851..f3dad7417e 100644
--- a/src/gallium/auxiliary/util/u_sampler.h
+++ b/src/gallium/auxiliary/util/u_sampler.h
@@ -41,12 +41,12 @@ extern "C" {
void
u_sampler_view_default_template(struct pipe_sampler_view *view,
- const struct pipe_texture *texture,
+ const struct pipe_resource *texture,
enum pipe_format format);
void
u_sampler_view_default_dx9_template(struct pipe_sampler_view *view,
- const struct pipe_texture *texture,
+ const struct pipe_resource *texture,
enum pipe_format format);
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
index beb4722901..fa6342d4e9 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
@@ -680,7 +680,7 @@ xfer_buffers_map(struct vl_mpeg12_mc_renderer *r)
assert(r);
for (i = 0; i < 3; ++i) {
- r->tex_transfer[i] = r->pipe->get_tex_transfer
+ r->tex_transfer[i] = r->pipe->get_transfer
(
r->pipe, r->textures.all[i],
0, 0, 0, PIPE_TRANSFER_WRITE, 0, 0,
diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c
index c65c3b4f88..c9326d8aa4 100644
--- a/src/gallium/drivers/cell/ppu/cell_texture.c
+++ b/src/gallium/drivers/cell/ppu/cell_texture.c
@@ -355,7 +355,7 @@ cell_tex_surface_destroy(struct pipe_surface *surf)
* back out for glGetTexImage).
*/
static struct pipe_transfer *
-cell_get_tex_transfer(struct pipe_context *ctx,
+cell_get_transfer(struct pipe_context *ctx,
struct pipe_texture *texture,
unsigned face, unsigned level, unsigned zslice,
enum pipe_transfer_usage usage,
@@ -402,7 +402,7 @@ cell_get_tex_transfer(struct pipe_context *ctx,
static void
-cell_tex_transfer_destroy(struct pipe_context *ctx, struct pipe_transfer *t)
+cell_transfer_destroy(struct pipe_context *ctx, struct pipe_transfer *t)
{
struct cell_transfer *transfer = cell_transfer(t);
/* Effectively do the texture_update work here - if texture images
@@ -566,8 +566,8 @@ cell_init_screen_texture_funcs(struct pipe_screen *screen)
void
cell_init_texture_transfer_funcs(struct cell_context *cell)
{
- cell->pipe.get_tex_transfer = cell_get_tex_transfer;
- cell->pipe.tex_transfer_destroy = cell_tex_transfer_destroy;
+ cell->pipe.get_transfer = cell_get_transfer;
+ cell->pipe.transfer_destroy = cell_transfer_destroy;
cell->pipe.transfer_map = cell_transfer_map;
cell->pipe.transfer_unmap = cell_transfer_unmap;
}
diff --git a/src/gallium/drivers/failover/fo_context.c b/src/gallium/drivers/failover/fo_context.c
index 659e40cbf0..12d8e14eb5 100644
--- a/src/gallium/drivers/failover/fo_context.c
+++ b/src/gallium/drivers/failover/fo_context.c
@@ -110,7 +110,7 @@ static void failover_draw_arrays( struct pipe_context *pipe,
static unsigned int
failover_is_texture_referenced( struct pipe_context *_pipe,
- struct pipe_texture *texture,
+ struct pipe_resource *texture,
unsigned face, unsigned level)
{
struct failover_context *failover = failover_context( _pipe );
diff --git a/src/gallium/drivers/failover/fo_state.c b/src/gallium/drivers/failover/fo_state.c
index 25c6273570..726906ecc7 100644
--- a/src/gallium/drivers/failover/fo_state.c
+++ b/src/gallium/drivers/failover/fo_state.c
@@ -449,7 +449,7 @@ failover_delete_sampler_state(struct pipe_context *pipe, void *sampler)
static struct pipe_sampler_view *
failover_create_sampler_view(struct pipe_context *pipe,
- struct pipe_texture *texture,
+ struct pipe_resource *texture,
const struct pipe_sampler_view *templ)
{
struct fo_sampler_view *view = malloc(sizeof(struct fo_sampler_view));
diff --git a/src/gallium/drivers/i915/i915_texture.c b/src/gallium/drivers/i915/i915_texture.c
index b252fb5330..04860e899e 100644
--- a/src/gallium/drivers/i915/i915_texture.c
+++ b/src/gallium/drivers/i915/i915_texture.c
@@ -800,7 +800,7 @@ i915_tex_surface_destroy(struct pipe_surface *surf)
static struct pipe_transfer *
-i915_get_tex_transfer(struct pipe_context *pipe,
+i915_get_transfer(struct pipe_context *pipe,
struct pipe_texture *texture,
unsigned face, unsigned level, unsigned zslice,
enum pipe_transfer_usage usage, unsigned x, unsigned y,
@@ -868,7 +868,7 @@ i915_transfer_unmap(struct pipe_context *pipe,
}
static void
-i915_tex_transfer_destroy(struct pipe_context *pipe,
+i915_transfer_destroy(struct pipe_context *pipe,
struct pipe_transfer *trans)
{
pipe_texture_reference(&trans->texture, NULL);
@@ -883,10 +883,10 @@ i915_tex_transfer_destroy(struct pipe_context *pipe,
void
i915_init_texture_functions(struct i915_context *i915 )
{
- i915->base.get_tex_transfer = i915_get_tex_transfer;
+ i915->base.get_transfer = i915_get_transfer;
i915->base.transfer_map = i915_transfer_map;
i915->base.transfer_unmap = i915_transfer_unmap;
- i915->base.tex_transfer_destroy = i915_tex_transfer_destroy;
+ i915->base.transfer_destroy = i915_transfer_destroy;
}
void
diff --git a/src/gallium/drivers/i965/brw_pipe_flush.c b/src/gallium/drivers/i965/brw_pipe_flush.c
index fdc4814b22..175c674028 100644
--- a/src/gallium/drivers/i965/brw_pipe_flush.c
+++ b/src/gallium/drivers/i965/brw_pipe_flush.c
@@ -58,7 +58,7 @@ static unsigned brw_is_buffer_referenced(struct pipe_context *pipe,
}
static unsigned brw_is_texture_referenced(struct pipe_context *pipe,
- struct pipe_texture *texture,
+ struct pipe_resource *texture,
unsigned face,
unsigned level)
{
diff --git a/src/gallium/drivers/i965/brw_pipe_sampler.c b/src/gallium/drivers/i965/brw_pipe_sampler.c
index d2aa2bc9f3..1889acc7fd 100644
--- a/src/gallium/drivers/i965/brw_pipe_sampler.c
+++ b/src/gallium/drivers/i965/brw_pipe_sampler.c
@@ -214,7 +214,7 @@ static void brw_bind_vertex_sampler_state(struct pipe_context *pipe,
static struct pipe_sampler_view *
brw_create_sampler_view(struct pipe_context *pipe,
- struct pipe_texture *texture,
+ struct pipe_resource *texture,
const struct pipe_sampler_view *templ)
{
struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
@@ -223,7 +223,7 @@ brw_create_sampler_view(struct pipe_context *pipe,
*view = *templ;
view->reference.count = 1;
view->texture = NULL;
- pipe_texture_reference(&view->texture, texture);
+ pipe_resource_reference(&view->texture, texture);
view->context = pipe;
}
diff --git a/src/gallium/drivers/i965/brw_screen.h b/src/gallium/drivers/i965/brw_screen.h
index e3a7c64d48..84199a5ed7 100644
--- a/src/gallium/drivers/i965/brw_screen.h
+++ b/src/gallium/drivers/i965/brw_screen.h
@@ -60,7 +60,7 @@ struct brw_transfer
struct brw_buffer
{
- struct pipe_buffer base;
+ struct pipe_resource base;
/* One of either bo or user_buffer will be non-null, depending on
* whether this is a hardware or user buffer.
@@ -106,7 +106,7 @@ struct brw_surface
struct brw_texture
{
- struct pipe_texture base;
+ struct pipe_resource base;
struct brw_winsys_buffer *bo;
struct brw_surface_state ss;
@@ -154,8 +154,9 @@ brw_buffer(struct pipe_buffer *buffer)
}
static INLINE struct brw_texture *
-brw_texture(struct pipe_texture *texture)
+brw_texture(struct pipe_resource *texture)
{
+ assert(texture->target != PIPE_BUFFER);
return (struct brw_texture *)texture;
}
diff --git a/src/gallium/drivers/i965/brw_screen_surface.c b/src/gallium/drivers/i965/brw_screen_surface.c
index 904df813dd..9cd2421245 100644
--- a/src/gallium/drivers/i965/brw_screen_surface.c
+++ b/src/gallium/drivers/i965/brw_screen_surface.c
@@ -198,7 +198,7 @@ static struct brw_surface *create_in_place_view( struct brw_screen *brw_screen,
/* Get a surface which is view into a texture
*/
static struct pipe_surface *brw_get_tex_surface(struct pipe_screen *screen,
- struct pipe_texture *pt,
+ struct pipe_resource *pt,
unsigned face, unsigned level,
unsigned zslice,
unsigned usage )
diff --git a/src/gallium/drivers/i965/brw_screen_texture.c b/src/gallium/drivers/i965/brw_screen_texture.c
index cadcb7cee2..c45c2f5f0d 100644
--- a/src/gallium/drivers/i965/brw_screen_texture.c
+++ b/src/gallium/drivers/i965/brw_screen_texture.c
@@ -185,8 +185,8 @@ static GLuint translate_tex_format( enum pipe_format pf )
-static struct pipe_texture *brw_texture_create( struct pipe_screen *screen,
- const struct pipe_texture *templ )
+static struct pipe_resource *brw_texture_create( struct pipe_screen *screen,
+ const struct pipe_resource *templ )
{
struct brw_screen *bscreen = brw_screen(screen);
@@ -305,9 +305,19 @@ fail:
return NULL;
}
-static struct pipe_texture *
+static struct pipe_resource *brw_resource_create( struct pipe_screen *screen,
+ const struct pipe_texture *templ )
+{
+ if (templ.target == PIPE_BUFFER)
+ return brw_buffer_create( screen, templ );
+ else
+ return brw_texture_create( screen, templ );
+}
+
+
+static struct pipe_resource *
brw_texture_from_handle(struct pipe_screen *screen,
- const struct pipe_texture *templ,
+ const struct pipe_resource *templ,
struct winsys_handle *whandle)
{
struct brw_screen *bscreen = brw_screen(screen);
@@ -406,7 +416,7 @@ fail:
static boolean
brw_texture_get_handle(struct pipe_screen *screen,
- struct pipe_texture *texture,
+ struct pipe_resource *texture,
struct winsys_handle *whandle)
{
struct brw_screen *bscreen = brw_screen(screen);
@@ -420,7 +430,7 @@ brw_texture_get_handle(struct pipe_screen *screen,
-static void brw_texture_destroy(struct pipe_texture *pt)
+static void brw_texture_destroy(struct pipe_resource *pt)
{
struct brw_texture *tex = brw_texture(pt);
bo_reference(&tex->bo, NULL);
@@ -439,7 +449,7 @@ static boolean brw_is_format_supported( struct pipe_screen *screen,
boolean brw_is_texture_referenced_by_bo( struct brw_screen *brw_screen,
- struct pipe_texture *texture,
+ struct pipe_resource *texture,
unsigned face,
unsigned level,
struct brw_winsys_buffer *bo )
@@ -481,8 +491,8 @@ boolean brw_is_texture_referenced_by_bo( struct brw_screen *brw_screen,
*/
static struct pipe_transfer*
-brw_get_tex_transfer(struct pipe_context *pipe,
- struct pipe_texture *texture,
+brw_get_transfer(struct pipe_context *pipe,
+ struct pipe_resource *texture,
unsigned face, unsigned level, unsigned zslice,
enum pipe_transfer_usage usage, unsigned x, unsigned y,
unsigned w, unsigned h)
@@ -553,7 +563,7 @@ brw_transfer_unmap(struct pipe_context *pipe,
}
static void
-brw_tex_transfer_destroy(struct pipe_context *pipe,
+brw_transfer_destroy(struct pipe_context *pipe,
struct pipe_transfer *trans)
{
pipe_texture_reference(&trans->texture, NULL);
@@ -563,10 +573,10 @@ brw_tex_transfer_destroy(struct pipe_context *pipe,
void brw_tex_init( struct brw_context *brw )
{
- brw->base.get_tex_transfer = brw_get_tex_transfer;
+ brw->base.tex_transfer = brw_get_transfer;
brw->base.transfer_map = brw_transfer_map;
brw->base.transfer_unmap = brw_transfer_unmap;
- brw->base.tex_transfer_destroy = brw_tex_transfer_destroy;
+ brw->base.transfer_destroy = brw_transfer_destroy;
}
void brw_screen_tex_init( struct brw_screen *brw_screen )
diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c
index 00a542215a..c094b4f0b1 100644
--- a/src/gallium/drivers/identity/id_context.c
+++ b/src/gallium/drivers/identity/id_context.c
@@ -61,19 +61,19 @@ identity_draw_arrays(struct pipe_context *_pipe,
static void
identity_draw_elements(struct pipe_context *_pipe,
- struct pipe_buffer *_indexBuffer,
+ struct pipe_buffer *_indexResource,
unsigned indexSize,
unsigned prim,
unsigned start,
unsigned count)
{
struct identity_context *id_pipe = identity_context(_pipe);
- struct identity_buffer *id_buffer = identity_buffer(_indexBuffer);
+ struct identity_resource *id_resource = identity_resource(_indexResource);
struct pipe_context *pipe = id_pipe->pipe;
- struct pipe_buffer *indexBuffer = id_buffer->buffer;
+ struct pipe_resource *indexResource = id_resource->resource;
pipe->draw_elements(pipe,
- indexBuffer,
+ indexResource,
indexSize,
prim,
start,
@@ -82,7 +82,7 @@ identity_draw_elements(struct pipe_context *_pipe,
static void
identity_draw_range_elements(struct pipe_context *_pipe,
- struct pipe_buffer *_indexBuffer,
+ struct pipe_resource *_indexResource,
unsigned indexSize,
unsigned minIndex,
unsigned maxIndex,
@@ -91,12 +91,12 @@ identity_draw_range_elements(struct pipe_context *_pipe,
unsigned count)
{
struct identity_context *id_pipe = identity_context(_pipe);
- struct identity_buffer *id_buffer = identity_buffer(_indexBuffer);
+ struct identity_resource *id_resource = identity_resource(_indexResource);
struct pipe_context *pipe = id_pipe->pipe;
- struct pipe_buffer *indexBuffer = id_buffer->buffer;
+ struct pipe_resource *indexResource = id_resource->resource;
pipe->draw_range_elements(pipe,
- indexBuffer,
+ indexResource,
indexSize,
minIndex,
maxIndex,
@@ -450,23 +450,23 @@ static void
identity_set_constant_buffer(struct pipe_context *_pipe,
uint shader,
uint index,
- struct pipe_buffer *_buffer)
+ struct pipe_resource *_resource)
{
struct identity_context *id_pipe = identity_context(_pipe);
struct pipe_context *pipe = id_pipe->pipe;
- struct pipe_buffer *unwrapped_buffer;
- struct pipe_buffer *buffer = NULL;
+ struct pipe_resource *unwrapped_resource;
+ struct pipe_resource *resource = NULL;
/* XXX hmm? unwrap the input state */
- if (_buffer) {
- unwrapped_buffer = identity_buffer_unwrap(_buffer);
- buffer = unwrapped_buffer;
+ if (_resource) {
+ unwrapped_resource = identity_resource_unwrap(_resource);
+ resource = unwrapped_resource;
}
pipe->set_constant_buffer(pipe,
shader,
index,
- buffer);
+ resource);
}
static void
@@ -587,7 +587,7 @@ identity_set_vertex_buffers(struct pipe_context *_pipe,
if (num_buffers) {
memcpy(unwrapped_buffers, _buffers, num_buffers * sizeof(*_buffers));
for (i = 0; i < num_buffers; i++)
- unwrapped_buffers[i].buffer = identity_buffer_unwrap(_buffers[i].buffer);
+ unwrapped_buffers[i].resource = identity_resource_unwrap(_resources[i].resource);
buffers = unwrapped_buffers;
}
@@ -695,16 +695,16 @@ identity_is_texture_referenced(struct pipe_context *_pipe,
}
static unsigned int
-identity_is_buffer_referenced(struct pipe_context *_pipe,
- struct pipe_buffer *_buffer)
+identity_is_resource_referenced(struct pipe_context *_pipe,
+ struct pipe_resource *_resource)
{
struct identity_context *id_pipe = identity_context(_pipe);
- struct identity_buffer *id_buffer = identity_buffer(_buffer);
+ struct identity_resource *id_resource = identity_resource(_resource);
struct pipe_context *pipe = id_pipe->pipe;
- struct pipe_buffer *buffer = id_buffer->buffer;
+ struct pipe_resource *resource = id_resource->resource;
- return pipe->is_buffer_referenced(pipe,
- buffer);
+ return pipe->is_resource_referenced(pipe,
+ resource);
}
static struct pipe_sampler_view *
@@ -749,7 +749,7 @@ identity_sampler_view_destroy(struct pipe_context *pipe,
static struct pipe_transfer *
-identity_context_get_tex_transfer(struct pipe_context *_context,
+identity_context_get_transfer(struct pipe_context *_context,
struct pipe_texture *_texture,
unsigned face,
unsigned level,
@@ -766,7 +766,7 @@ identity_context_get_tex_transfer(struct pipe_context *_context,
struct pipe_texture *texture = id_texture->texture;
struct pipe_transfer *result;
- result = context->get_tex_transfer(context,
+ result = context->tex_transfer(context,
texture,
face,
level,
@@ -783,7 +783,7 @@ identity_context_get_tex_transfer(struct pipe_context *_context,
}
static void
-identity_context_tex_transfer_destroy(struct pipe_context *_pipe,
+identity_context_transfer_destroy(struct pipe_context *_pipe,
struct pipe_transfer *_transfer)
{
identity_transfer_destroy(identity_context(_pipe),
@@ -879,11 +879,11 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
id_pipe->base.clear = identity_clear;
id_pipe->base.flush = identity_flush;
id_pipe->base.is_texture_referenced = identity_is_texture_referenced;
- id_pipe->base.is_buffer_referenced = identity_is_buffer_referenced;
+ id_pipe->base.is_resource_referenced = identity_is_resource_referenced;
id_pipe->base.create_sampler_view = identity_create_sampler_view;
id_pipe->base.sampler_view_destroy = identity_sampler_view_destroy;
- id_pipe->base.get_tex_transfer = identity_context_get_tex_transfer;
- id_pipe->base.tex_transfer_destroy = identity_context_tex_transfer_destroy;
+ id_pipe->base.tex_transfer = identity_context_get_transfer;
+ id_pipe->base.transfer_destroy = identity_context_transfer_destroy;
id_pipe->base.transfer_map = identity_context_transfer_map;
id_pipe->base.transfer_unmap = identity_context_transfer_unmap;
diff --git a/src/gallium/drivers/identity/id_objects.c b/src/gallium/drivers/identity/id_objects.c
index d37fb0042e..33658df91e 100644
--- a/src/gallium/drivers/identity/id_objects.c
+++ b/src/gallium/drivers/identity/id_objects.c
@@ -32,80 +32,46 @@
#include "id_objects.h"
#include "id_context.h"
-struct pipe_buffer *
-identity_buffer_create(struct identity_screen *id_screen,
- struct pipe_buffer *buffer)
-{
- struct identity_buffer *id_buffer;
-
- if(!buffer)
- goto error;
-
- assert(buffer->screen == id_screen->screen);
-
- id_buffer = CALLOC_STRUCT(identity_buffer);
- if(!id_buffer)
- goto error;
-
- memcpy(&id_buffer->base, buffer, sizeof(struct pipe_buffer));
-
- pipe_reference_init(&id_buffer->base.reference, 1);
- id_buffer->base.screen = &id_screen->base;
- id_buffer->buffer = buffer;
-
- return &id_buffer->base;
-
-error:
- pipe_buffer_reference(&buffer, NULL);
- return NULL;
-}
-
-void
-identity_buffer_destroy(struct identity_buffer *id_buffer)
-{
- pipe_buffer_reference(&id_buffer->buffer, NULL);
- FREE(id_buffer);
-}
-struct pipe_texture *
-identity_texture_create(struct identity_screen *id_screen,
- struct pipe_texture *texture)
+struct pipe_resource *
+identity_resource_create(struct identity_screen *id_screen,
+ struct pipe_resource *resource)
{
- struct identity_texture *id_texture;
+ struct identity_resource *id_resource;
- if(!texture)
+ if(!resource)
goto error;
- assert(texture->screen == id_screen->screen);
+ assert(resource->screen == id_screen->screen);
- id_texture = CALLOC_STRUCT(identity_texture);
- if(!id_texture)
+ id_resource = CALLOC_STRUCT(identity_resource);
+ if(!id_resource)
goto error;
- memcpy(&id_texture->base, texture, sizeof(struct pipe_texture));
+ memcpy(&id_resource->base, resource, sizeof(struct pipe_resource));
- pipe_reference_init(&id_texture->base.reference, 1);
- id_texture->base.screen = &id_screen->base;
- id_texture->texture = texture;
+ pipe_reference_init(&id_resource->base.reference, 1);
+ id_resource->base.screen = &id_screen->base;
+ id_resource->resource = resource;
- return &id_texture->base;
+ return &id_resource->base;
error:
- pipe_texture_reference(&texture, NULL);
+ pipe_resource_reference(&resource, NULL);
return NULL;
}
void
-identity_texture_destroy(struct identity_texture *id_texture)
+identity_resource_destroy(struct identity_resource *id_resource)
{
- pipe_texture_reference(&id_texture->texture, NULL);
- FREE(id_texture);
+ pipe_resource_reference(&id_resource->resource, NULL);
+ FREE(id_resource);
}
struct pipe_surface *
-identity_surface_create(struct identity_texture *id_texture,
+identity_surface_create(struct identity_resource *id_resource,
struct pipe_surface *surface)
{
struct identity_surface *id_surface;
@@ -113,7 +79,7 @@ identity_surface_create(struct identity_texture *id_texture,
if(!surface)
goto error;
- assert(surface->texture == id_texture->texture);
+ assert(surface->resource == id_resource->resource);
id_surface = CALLOC_STRUCT(identity_surface);
if(!id_surface)
@@ -122,8 +88,8 @@ identity_surface_create(struct identity_texture *id_texture,
memcpy(&id_surface->base, surface, sizeof(struct pipe_surface));
pipe_reference_init(&id_surface->base.reference, 1);
- id_surface->base.texture = NULL;
- pipe_texture_reference(&id_surface->base.texture, &id_texture->base);
+ id_surface->base.resource = NULL;
+ pipe_resource_reference(&id_surface->base.resource, &id_resource->base);
id_surface->surface = surface;
return &id_surface->base;
@@ -136,7 +102,7 @@ error:
void
identity_surface_destroy(struct identity_surface *id_surface)
{
- pipe_texture_reference(&id_surface->base.texture, NULL);
+ pipe_resource_reference(&id_surface->base.resource, NULL);
pipe_surface_reference(&id_surface->surface, NULL);
FREE(id_surface);
}
@@ -144,7 +110,7 @@ identity_surface_destroy(struct identity_surface *id_surface)
struct pipe_transfer *
identity_transfer_create(struct identity_context *id_context,
- struct identity_texture *id_texture,
+ struct identity_resource *id_resource,
struct pipe_transfer *transfer)
{
struct identity_transfer *id_transfer;
@@ -152,7 +118,7 @@ identity_transfer_create(struct identity_context *id_context,
if(!transfer)
goto error;
- assert(transfer->texture == id_texture->texture);
+ assert(transfer->resource == id_resource->resource);
id_transfer = CALLOC_STRUCT(identity_transfer);
if(!id_transfer)
@@ -160,16 +126,16 @@ identity_transfer_create(struct identity_context *id_context,
memcpy(&id_transfer->base, transfer, sizeof(struct pipe_transfer));
- id_transfer->base.texture = NULL;
+ id_transfer->base.resource = NULL;
id_transfer->transfer = transfer;
- pipe_texture_reference(&id_transfer->base.texture, &id_texture->base);
- assert(id_transfer->base.texture == &id_texture->base);
+ pipe_resource_reference(&id_transfer->base.resource, &id_resource->base);
+ assert(id_transfer->base.resource == &id_resource->base);
return &id_transfer->base;
error:
- id_context->pipe->tex_transfer_destroy(id_context->pipe, transfer);
+ id_context->pipe->transfer_destroy(id_context->pipe, transfer);
return NULL;
}
@@ -177,9 +143,9 @@ void
identity_transfer_destroy(struct identity_context *id_context,
struct identity_transfer *id_transfer)
{
- pipe_texture_reference(&id_transfer->base.texture, NULL);
- id_context->pipe->tex_transfer_destroy(id_context->pipe,
- id_transfer->transfer);
+ pipe_resource_reference(&id_transfer->base.resource, NULL);
+ id_context->pipe->transfer_destroy(id_context->pipe,
+ id_transfer->transfer);
FREE(id_transfer);
}
diff --git a/src/gallium/drivers/identity/id_objects.h b/src/gallium/drivers/identity/id_objects.h
index 9a07ebe8d7..293c886145 100644
--- a/src/gallium/drivers/identity/id_objects.h
+++ b/src/gallium/drivers/identity/id_objects.h
@@ -37,19 +37,12 @@
struct identity_context;
-struct identity_buffer
-{
- struct pipe_buffer base;
-
- struct pipe_buffer *buffer;
-};
-
-struct identity_texture
+struct identity_resource
{
- struct pipe_texture base;
+ struct pipe_resource base;
- struct pipe_texture *texture;
+ struct pipe_resource *resource;
};
@@ -86,22 +79,14 @@ struct identity_video_surface
};
-static INLINE struct identity_buffer *
-identity_buffer(struct pipe_buffer *_buffer)
-{
- if(!_buffer)
- return NULL;
- (void)identity_screen(_buffer->screen);
- return (struct identity_buffer *)_buffer;
-}
-static INLINE struct identity_texture *
-identity_texture(struct pipe_texture *_texture)
+static INLINE struct identity_resource *
+identity_resource(struct pipe_resource *_resource)
{
- if(!_texture)
+ if(!_resource)
return NULL;
- (void)identity_screen(_texture->screen);
- return (struct identity_texture *)_texture;
+ (void)identity_screen(_resource->screen);
+ return (struct identity_resource *)_resource;
}
static INLINE struct identity_sampler_view *
@@ -118,7 +103,7 @@ identity_surface(struct pipe_surface *_surface)
{
if(!_surface)
return NULL;
- (void)identity_texture(_surface->texture);
+ (void)identity_resource(_surface->resource);
return (struct identity_surface *)_surface;
}
@@ -127,7 +112,7 @@ identity_transfer(struct pipe_transfer *_transfer)
{
if(!_transfer)
return NULL;
- (void)identity_texture(_transfer->texture);
+ (void)identity_resource(_transfer->resource);
return (struct identity_transfer *)_transfer;
}
@@ -141,20 +126,12 @@ identity_video_surface(struct pipe_video_surface *_video_surface)
return (struct identity_video_surface *)_video_surface;
}
-static INLINE struct pipe_buffer *
-identity_buffer_unwrap(struct pipe_buffer *_buffer)
+static INLINE struct pipe_resource *
+identity_resource_unwrap(struct pipe_resource *_resource)
{
- if(!_buffer)
+ if(!_resource)
return NULL;
- return identity_buffer(_buffer)->buffer;
-}
-
-static INLINE struct pipe_texture *
-identity_texture_unwrap(struct pipe_texture *_texture)
-{
- if(!_texture)
- return NULL;
- return identity_texture(_texture)->texture;
+ return identity_resource(_resource)->resource;
}
static INLINE struct pipe_sampler_view *
@@ -183,22 +160,15 @@ identity_transfer_unwrap(struct pipe_transfer *_transfer)
}
-struct pipe_buffer *
-identity_buffer_create(struct identity_screen *id_screen,
- struct pipe_buffer *buffer);
-
-void
-identity_buffer_destroy(struct identity_buffer *id_buffer);
-
-struct pipe_texture *
-identity_texture_create(struct identity_screen *id_screen,
- struct pipe_texture *texture);
+struct pipe_resource *
+identity_resource_create(struct identity_screen *id_screen,
+ struct pipe_resource *resource);
void
-identity_texture_destroy(struct identity_texture *id_texture);
+identity_resource_destroy(struct identity_resource *id_resource);
struct pipe_surface *
-identity_surface_create(struct identity_texture *id_texture,
+identity_surface_create(struct identity_resource *id_resource,
struct pipe_surface *surface);
void
@@ -206,7 +176,7 @@ identity_surface_destroy(struct identity_surface *id_surface);
struct pipe_transfer *
identity_transfer_create(struct identity_context *id_context,
- struct identity_texture *id_texture,
+ struct identity_resource *id_resource,
struct pipe_transfer *transfer);
void
diff --git a/src/gallium/drivers/identity/id_screen.c b/src/gallium/drivers/identity/id_screen.c
index 419b146578..67b1f5ae6b 100644
--- a/src/gallium/drivers/identity/id_screen.c
+++ b/src/gallium/drivers/identity/id_screen.c
@@ -208,25 +208,6 @@ identity_screen_tex_surface_destroy(struct pipe_surface *_surface)
}
-static struct pipe_buffer *
-identity_screen_buffer_create(struct pipe_screen *_screen,
- unsigned alignment,
- unsigned usage,
- unsigned size)
-{
- struct identity_screen *id_screen = identity_screen(_screen);
- struct pipe_screen *screen = id_screen->screen;
- struct pipe_buffer *result;
-
- result = screen->buffer_create(screen,
- alignment,
- usage,
- size);
-
- if (result)
- return identity_buffer_create(id_screen, result);
- return NULL;
-}
static struct pipe_buffer *
identity_screen_user_buffer_create(struct pipe_screen *_screen,
@@ -247,75 +228,6 @@ identity_screen_user_buffer_create(struct pipe_screen *_screen,
}
-static void *
-identity_screen_buffer_map(struct pipe_screen *_screen,
- struct pipe_buffer *_buffer,
- unsigned usage)
-{
- struct identity_screen *id_screen = identity_screen(_screen);
- struct identity_buffer *id_buffer = identity_buffer(_buffer);
- struct pipe_screen *screen = id_screen->screen;
- struct pipe_buffer *buffer = id_buffer->buffer;
-
- return screen->buffer_map(screen,
- buffer,
- usage);
-}
-
-static void *
-identity_screen_buffer_map_range(struct pipe_screen *_screen,
- struct pipe_buffer *_buffer,
- unsigned offset,
- unsigned length,
- unsigned usage)
-{
- struct identity_screen *id_screen = identity_screen(_screen);
- struct identity_buffer *id_buffer = identity_buffer(_buffer);
- struct pipe_screen *screen = id_screen->screen;
- struct pipe_buffer *buffer = id_buffer->buffer;
-
- return screen->buffer_map_range(screen,
- buffer,
- offset,
- length,
- usage);
-}
-
-static void
-identity_screen_buffer_flush_mapped_range(struct pipe_screen *_screen,
- struct pipe_buffer *_buffer,
- unsigned offset,
- unsigned length)
-{
- struct identity_screen *id_screen = identity_screen(_screen);
- struct identity_buffer *id_buffer = identity_buffer(_buffer);
- struct pipe_screen *screen = id_screen->screen;
- struct pipe_buffer *buffer = id_buffer->buffer;
-
- screen->buffer_flush_mapped_range(screen,
- buffer,
- offset,
- length);
-}
-
-static void
-identity_screen_buffer_unmap(struct pipe_screen *_screen,
- struct pipe_buffer *_buffer)
-{
- struct identity_screen *id_screen = identity_screen(_screen);
- struct identity_buffer *id_buffer = identity_buffer(_buffer);
- struct pipe_screen *screen = id_screen->screen;
- struct pipe_buffer *buffer = id_buffer->buffer;
-
- screen->buffer_unmap(screen,
- buffer);
-}
-
-static void
-identity_screen_buffer_destroy(struct pipe_buffer *_buffer)
-{
- identity_buffer_destroy(identity_buffer(_buffer));
-}
static struct pipe_video_surface *
identity_screen_video_surface_create(struct pipe_screen *_screen,
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c
index 505cb21503..74c96b933d 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.c
+++ b/src/gallium/drivers/llvmpipe/lp_scene.c
@@ -409,7 +409,7 @@ lp_scene_map_buffers( struct lp_scene *scene )
for (i = 0; i < scene->fb.nr_cbufs; i++) {
cbuf = scene->fb.cbufs[i];
if (cbuf) {
- scene->cbuf_transfer[i] = pipe->get_tex_transfer(pipe,
+ scene->cbuf_transfer[i] = pipe_get_transfer(pipe,
cbuf->texture,
cbuf->face,
cbuf->level,
@@ -432,7 +432,7 @@ lp_scene_map_buffers( struct lp_scene *scene )
*/
zsbuf = scene->fb.zsbuf;
if (zsbuf) {
- scene->zsbuf_transfer = pipe->get_tex_transfer(pipe,
+ scene->zsbuf_transfer = pipe_get_transfer(pipe,
zsbuf->texture,
zsbuf->face,
zsbuf->level,
@@ -477,7 +477,7 @@ lp_scene_unmap_buffers( struct lp_scene *scene )
pipe->transfer_unmap(pipe, scene->cbuf_transfer[i]);
if (scene->cbuf_transfer[i])
- pipe->tex_transfer_destroy(pipe, scene->cbuf_transfer[i]);
+ pipe->transfer_destroy(pipe, scene->cbuf_transfer[i]);
scene->cbuf_transfer[i] = NULL;
scene->cbuf_map[i] = NULL;
@@ -487,7 +487,7 @@ lp_scene_unmap_buffers( struct lp_scene *scene )
pipe->transfer_unmap(pipe, scene->zsbuf_transfer);
if (scene->zsbuf_transfer)
- pipe->tex_transfer_destroy(pipe, scene->zsbuf_transfer);
+ pipe->transfer_destroy(pipe, scene->zsbuf_transfer);
scene->zsbuf_transfer = NULL;
scene->zsbuf_map = NULL;
diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c
index f2c6dbd088..5f75078109 100644
--- a/src/gallium/drivers/llvmpipe/lp_texture.c
+++ b/src/gallium/drivers/llvmpipe/lp_texture.c
@@ -243,7 +243,7 @@ llvmpipe_tex_surface_destroy(struct pipe_surface *surf)
static struct pipe_transfer *
-llvmpipe_get_tex_transfer(struct pipe_context *pipe,
+llvmpipe_get_transfer(struct pipe_context *pipe,
struct pipe_texture *texture,
unsigned face, unsigned level, unsigned zslice,
enum pipe_transfer_usage usage,
@@ -294,7 +294,7 @@ llvmpipe_get_tex_transfer(struct pipe_context *pipe,
static void
-llvmpipe_tex_transfer_destroy(struct pipe_context *pipe,
+llvmpipe_transfer_destroy(struct pipe_context *pipe,
struct pipe_transfer *transfer)
{
/* Effectively do the texture_update work here - if texture images
@@ -383,8 +383,8 @@ llvmpipe_init_screen_texture_funcs(struct pipe_screen *screen)
void
llvmpipe_init_context_texture_funcs(struct pipe_context *pipe)
{
- pipe->get_tex_transfer = llvmpipe_get_tex_transfer;
- pipe->tex_transfer_destroy = llvmpipe_tex_transfer_destroy;
+ pipe->get_transfer = llvmpipe_get_transfer;
+ pipe->transfer_destroy = llvmpipe_transfer_destroy;
pipe->transfer_map = llvmpipe_transfer_map;
pipe->transfer_unmap = llvmpipe_transfer_unmap;
}
diff --git a/src/gallium/drivers/nv30/nv30_transfer.c b/src/gallium/drivers/nv30/nv30_transfer.c
index cfc109bb74..08cc0fa4e3 100644
--- a/src/gallium/drivers/nv30/nv30_transfer.c
+++ b/src/gallium/drivers/nv30/nv30_transfer.c
@@ -175,8 +175,8 @@ nv30_transfer_unmap(struct pipe_context *pcontext, struct pipe_transfer *ptx)
void
nv30_init_transfer_functions(struct nv30_context *nv30)
{
- nv30->pipe.get_tex_transfer = nv30_transfer_new;
- nv30->pipe.tex_transfer_destroy = nv30_transfer_del;
+ nv30->pipe.get_transfer = nv30_transfer_new;
+ nv30->pipe.transfer_destroy = nv30_transfer_del;
nv30->pipe.transfer_map = nv30_transfer_map;
nv30->pipe.transfer_unmap = nv30_transfer_unmap;
}
diff --git a/src/gallium/drivers/nv40/nv40_transfer.c b/src/gallium/drivers/nv40/nv40_transfer.c
index c552a68113..e96ce2c46b 100644
--- a/src/gallium/drivers/nv40/nv40_transfer.c
+++ b/src/gallium/drivers/nv40/nv40_transfer.c
@@ -174,8 +174,8 @@ nv40_transfer_unmap(struct pipe_context *pcontext, struct pipe_transfer *ptx)
void
nv40_init_transfer_functions(struct nv40_context *nv40)
{
- nv40->pipe.get_tex_transfer = nv40_transfer_new;
- nv40->pipe.tex_transfer_destroy = nv40_transfer_del;
+ nv40->pipe.get_transfer = nv40_transfer_new;
+ nv40->pipe.transfer_destroy = nv40_transfer_del;
nv40->pipe.transfer_map = nv40_transfer_map;
nv40->pipe.transfer_unmap = nv40_transfer_unmap;
}
diff --git a/src/gallium/drivers/nv50/nv50_transfer.c b/src/gallium/drivers/nv50/nv50_transfer.c
index 9eb223eca6..c30b787167 100644
--- a/src/gallium/drivers/nv50/nv50_transfer.c
+++ b/src/gallium/drivers/nv50/nv50_transfer.c
@@ -247,8 +247,8 @@ nv50_transfer_unmap(struct pipe_context *pcontext, struct pipe_transfer *ptx)
void
nv50_init_transfer_functions(struct nv50_context *nv50)
{
- nv50->pipe.get_tex_transfer = nv50_transfer_new;
- nv50->pipe.tex_transfer_destroy = nv50_transfer_del;
+ nv50->pipe.get_transfer = nv50_transfer_new;
+ nv50->pipe.transfer_destroy = nv50_transfer_del;
nv50->pipe.transfer_map = nv50_transfer_map;
nv50->pipe.transfer_unmap = nv50_transfer_unmap;
}
diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c
index 495e3dee76..2b1a40bd8d 100644
--- a/src/gallium/drivers/r300/r300_transfer.c
+++ b/src/gallium/drivers/r300/r300_transfer.c
@@ -36,7 +36,7 @@ struct r300_transfer {
/* Pipe context. */
struct pipe_context *ctx;
- /* Parameters of get_tex_transfer. */
+ /* Parameters of get_transfer. */
unsigned x, y, level, zslice, face;
/* Offset from start of buffer. */
@@ -118,7 +118,7 @@ static void r300_copy_into_tiled_texture(struct pipe_context *ctx,
}
static struct pipe_transfer*
-r300_get_tex_transfer(struct pipe_context *ctx,
+r300_get_transfer(struct pipe_context *ctx,
struct pipe_texture *texture,
unsigned face, unsigned level, unsigned zslice,
enum pipe_transfer_usage usage, unsigned x, unsigned y,
@@ -205,7 +205,7 @@ r300_get_tex_transfer(struct pipe_context *ctx,
return &trans->transfer;
}
-static void r300_tex_transfer_destroy(struct pipe_context *ctx,
+static void r300_transfer_destroy(struct pipe_context *ctx,
struct pipe_transfer *trans)
{
struct r300_transfer *r300transfer = r300_transfer(trans);
@@ -269,8 +269,8 @@ void r300_init_transfer_functions( struct r300_context *r300ctx )
{
struct pipe_context *ctx = &r300ctx->context;
- ctx->get_tex_transfer = r300_get_tex_transfer;
- ctx->tex_transfer_destroy = r300_tex_transfer_destroy;
+ ctx->get_transfer = r300_get_transfer;
+ ctx->transfer_destroy = r300_transfer_destroy;
ctx->transfer_map = r300_transfer_map;
ctx->transfer_unmap = r300_transfer_unmap;
}
diff --git a/src/gallium/drivers/softpipe/sp_buffer.c b/src/gallium/drivers/softpipe/sp_buffer.c
index 8f39025086..f1a835fd1a 100644
--- a/src/gallium/drivers/softpipe/sp_buffer.c
+++ b/src/gallium/drivers/softpipe/sp_buffer.c
@@ -34,36 +34,8 @@
#include "sp_buffer.h"
-static void *
-softpipe_buffer_map(struct pipe_screen *screen,
- struct pipe_buffer *buf,
- unsigned flags)
-{
- struct softpipe_buffer *softpipe_buf = softpipe_buffer(buf);
- return softpipe_buf->data;
-}
-
-
-static void
-softpipe_buffer_unmap(struct pipe_screen *screen,
- struct pipe_buffer *buf)
-{
-}
-
-static void
-softpipe_buffer_destroy(struct pipe_buffer *buf)
-{
- struct softpipe_buffer *sbuf = softpipe_buffer(buf);
-
- if (!sbuf->userBuffer)
- align_free(sbuf->data);
-
- FREE(sbuf);
-}
-
-
-static struct pipe_buffer *
+struct pipe_resource *
softpipe_buffer_create(struct pipe_screen *screen,
unsigned alignment,
unsigned usage,
@@ -73,9 +45,10 @@ softpipe_buffer_create(struct pipe_screen *screen,
pipe_reference_init(&buffer->base.reference, 1);
buffer->base.screen = screen;
- buffer->base.alignment = MAX2(alignment, 16);
buffer->base.usage = usage;
- buffer->base.size = size;
+ buffer->base.width0 = size;
+ buffer->base.height0 = 1;
+ buffer->base.depth0 = 1;
buffer->data = align_malloc(size, alignment);
@@ -99,7 +72,10 @@ softpipe_user_buffer_create(struct pipe_screen *screen,
pipe_reference_init(&buffer->base.reference, 1);
buffer->base.screen = screen;
- buffer->base.size = bytes;
+ buffer->base.usage = PIPE_BUFFER_USAGE_CPU_READ;
+ buffer->base.width0 = bytes;
+ buffer->base.height0 = 1;
+ buffer->base.depth0 = 1;
buffer->userBuffer = TRUE;
buffer->data = ptr;
@@ -110,9 +86,5 @@ softpipe_user_buffer_create(struct pipe_screen *screen,
void
softpipe_init_screen_buffer_funcs(struct pipe_screen *screen)
{
- screen->buffer_create = softpipe_buffer_create;
screen->user_buffer_create = softpipe_user_buffer_create;
- screen->buffer_map = softpipe_buffer_map;
- screen->buffer_unmap = softpipe_buffer_unmap;
- screen->buffer_destroy = softpipe_buffer_destroy;
}
diff --git a/src/gallium/drivers/softpipe/sp_buffer.h b/src/gallium/drivers/softpipe/sp_buffer.h
index 9d8e56a176..47340b46ae 100644
--- a/src/gallium/drivers/softpipe/sp_buffer.h
+++ b/src/gallium/drivers/softpipe/sp_buffer.h
@@ -34,11 +34,17 @@
struct softpipe_buffer
{
- struct pipe_buffer base;
+ struct pipe_resource base;
boolean userBuffer; /** Is this a user-space buffer? */
void *data;
};
+struct pipe_resource *
+softpipe_buffer_create(struct pipe_screen *screen,
+ unsigned alignment,
+ unsigned usage,
+ unsigned size);
+
/** Cast wrapper */
static INLINE struct softpipe_buffer *
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index 937a573092..385d5f05c8 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -135,13 +135,16 @@ softpipe_destroy( struct pipe_context *pipe )
* return PIPE_UNREFERENCED
*/
static unsigned int
-softpipe_is_texture_referenced( struct pipe_context *pipe,
- struct pipe_texture *texture,
+softpipe_is_resource_referenced( struct pipe_context *pipe,
+ struct pipe_resource *texture,
unsigned face, unsigned level)
{
struct softpipe_context *softpipe = softpipe_context( pipe );
unsigned i;
+ if (texture->target == PIPE_BUFFER)
+ return PIPE_UNREFERENCED;
+
/* check if any of the bound drawing surfaces are this texture */
if (softpipe->dirty_render_cache) {
for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++) {
@@ -172,12 +175,6 @@ softpipe_is_texture_referenced( struct pipe_context *pipe,
}
-static unsigned int
-softpipe_is_buffer_referenced( struct pipe_context *pipe,
- struct pipe_buffer *buf)
-{
- return PIPE_UNREFERENCED;
-}
static void
@@ -274,8 +271,7 @@ softpipe_create_context( struct pipe_screen *screen,
softpipe->pipe.clear = softpipe_clear;
softpipe->pipe.flush = softpipe_flush;
- softpipe->pipe.is_texture_referenced = softpipe_is_texture_referenced;
- softpipe->pipe.is_buffer_referenced = softpipe_is_buffer_referenced;
+ softpipe->pipe.is_resource_referenced = softpipe_is_resource_referenced;
softpipe_init_query_funcs( softpipe );
softpipe_init_texture_funcs( &softpipe->pipe );
diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c
index 2b089c2831..9bd9c514f1 100644
--- a/src/gallium/drivers/softpipe/sp_state_fs.c
+++ b/src/gallium/drivers/softpipe/sp_state_fs.c
@@ -170,7 +170,7 @@ softpipe_set_constant_buffer(struct pipe_context *pipe,
struct pipe_buffer *constants)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
- unsigned size = constants ? constants->size : 0;
+ unsigned size = constants ? constants->width0 : 0;
const void *data = constants ? softpipe_buffer(constants)->data : NULL;
assert(shader < PIPE_SHADER_TYPES);
diff --git a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
index 6594514c38..edd8e5c187 100644
--- a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
@@ -69,10 +69,10 @@ sp_destroy_tex_tile_cache(struct softpipe_tex_tile_cache *tc)
/*assert(tc->entries[pos].x < 0);*/
}
if (tc->transfer) {
- tc->pipe->tex_transfer_destroy(tc->pipe, tc->transfer);
+ tc->pipe->transfer_destroy(tc->pipe, tc->transfer);
}
if (tc->tex_trans) {
- tc->pipe->tex_transfer_destroy(tc->pipe, tc->tex_trans);
+ tc->pipe->transfer_destroy(tc->pipe, tc->tex_trans);
}
FREE( tc );
@@ -136,7 +136,7 @@ sp_tex_tile_cache_set_sampler_view(struct softpipe_tex_tile_cache *tc,
tc->tex_trans_map = NULL;
}
- tc->pipe->tex_transfer_destroy(tc->pipe, tc->tex_trans);
+ tc->pipe->transfer_destroy(tc->pipe, tc->tex_trans);
tc->tex_trans = NULL;
}
@@ -239,12 +239,12 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc,
tc->tex_trans_map = NULL;
}
- tc->pipe->tex_transfer_destroy(tc->pipe, tc->tex_trans);
+ tc->pipe->transfer_destroy(tc->pipe, tc->tex_trans);
tc->tex_trans = NULL;
}
tc->tex_trans =
- tc->pipe->get_tex_transfer(tc->pipe, tc->texture,
+ tc->pipe->get_transfer(tc->pipe, tc->texture,
addr.bits.face,
addr.bits.level,
addr.bits.z,
diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
index da8529c154..d108bef002 100644
--- a/src/gallium/drivers/softpipe/sp_texture.c
+++ b/src/gallium/drivers/softpipe/sp_texture.c
@@ -256,11 +256,11 @@ softpipe_tex_surface_destroy(struct pipe_surface *surf)
* \param height height of region to read/write
*/
static struct pipe_transfer *
-softpipe_get_tex_transfer(struct pipe_context *pipe,
- struct pipe_texture *texture,
- unsigned face, unsigned level, unsigned zslice,
+softpipe_get_transfer(struct pipe_context *pipe,
+ struct pipe_resource *resource,
+ struct pipe_subresource subresource,
enum pipe_transfer_usage usage,
- unsigned x, unsigned y, unsigned w, unsigned h)
+ const struct pipe_box *box)
{
struct softpipe_texture *sptex = softpipe_texture(texture);
struct softpipe_transfer *spt;
@@ -275,8 +275,9 @@ softpipe_get_tex_transfer(struct pipe_context *pipe,
spt = CALLOC_STRUCT(softpipe_transfer);
if (spt) {
struct pipe_transfer *pt = &spt->base;
- int nblocksy = util_format_get_nblocksy(texture->format, u_minify(texture->height0, level));
- pipe_texture_reference(&pt->texture, texture);
+ int nblocksy = util_format_get_nblocksy(texture->format,
+ u_minify(texture->height0, level));
+ pipe_texture_reference(&resource, texture);
pt->x = x;
pt->y = y;
pt->width = w;
@@ -307,10 +308,10 @@ softpipe_get_tex_transfer(struct pipe_context *pipe,
/**
* Free a pipe_transfer object which was created with
- * softpipe_get_tex_transfer().
+ * softpipe_get_transfer().
*/
static void
-softpipe_tex_transfer_destroy(struct pipe_context *pipe,
+softpipe_transfer_destroy(struct pipe_context *pipe,
struct pipe_transfer *transfer)
{
/* Effectively do the texture_update work here - if texture images
@@ -451,8 +452,8 @@ softpipe_video_surface_destroy(struct pipe_video_surface *vsfc)
void
softpipe_init_texture_funcs(struct pipe_context *pipe)
{
- pipe->get_tex_transfer = softpipe_get_tex_transfer;
- pipe->tex_transfer_destroy = softpipe_tex_transfer_destroy;
+ pipe->get_transfer = softpipe_get_transfer;
+ pipe->transfer_destroy = softpipe_transfer_destroy;
pipe->transfer_map = softpipe_transfer_map;
pipe->transfer_unmap = softpipe_transfer_unmap;
}
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index 1c3c2667d7..cd99a92237 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -121,7 +121,7 @@ sp_destroy_tile_cache(struct softpipe_tile_cache *tc)
/*assert(tc->entries[pos].x < 0);*/
}
if (tc->transfer) {
- tc->pipe->tex_transfer_destroy(tc->pipe, tc->transfer);
+ tc->pipe->transfer_destroy(tc->pipe, tc->transfer);
}
FREE( tc );
@@ -146,17 +146,17 @@ sp_tile_cache_set_surface(struct softpipe_tile_cache *tc,
tc->transfer_map = NULL;
}
- pipe->tex_transfer_destroy(pipe, tc->transfer);
+ pipe->transfer_destroy(pipe, tc->transfer);
tc->transfer = NULL;
}
tc->surface = ps;
if (ps) {
- tc->transfer = pipe->get_tex_transfer(pipe, ps->texture, ps->face,
- ps->level, ps->zslice,
- PIPE_TRANSFER_READ_WRITE,
- 0, 0, ps->width, ps->height);
+ tc->transfer = pipe_get_transfer(pipe, ps->texture, ps->face,
+ ps->level, ps->zslice,
+ PIPE_TRANSFER_READ_WRITE,
+ 0, 0, ps->width, ps->height);
tc->depth_stencil = (ps->format == PIPE_FORMAT_Z24S8_UNORM ||
ps->format == PIPE_FORMAT_Z24X8_UNORM ||
diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c
index 107e4a3962..70322b2d46 100644
--- a/src/gallium/drivers/svga/svga_screen_texture.c
+++ b/src/gallium/drivers/svga/svga_screen_texture.c
@@ -787,7 +787,7 @@ svga_surface_needs_propagation(struct pipe_surface *surf)
* can now modify it to queue transfers on the context.
*/
static struct pipe_transfer *
-svga_get_tex_transfer(struct pipe_context *pipe,
+svga_get_transfer(struct pipe_context *pipe,
struct pipe_texture *texture,
unsigned face, unsigned level, unsigned zslice,
enum pipe_transfer_usage usage, unsigned x, unsigned y,
@@ -899,8 +899,8 @@ svga_transfer_unmap(struct pipe_context *pipe,
static void
-svga_tex_transfer_destroy(struct pipe_context *pipe,
- struct pipe_transfer *transfer)
+svga_transfer_destroy(struct pipe_context *pipe,
+ struct pipe_transfer *transfer)
{
struct svga_texture *tex = svga_texture(transfer->texture);
struct svga_screen *ss = svga_screen(pipe->screen);
@@ -924,10 +924,10 @@ svga_tex_transfer_destroy(struct pipe_context *pipe,
void
svga_init_texture_functions(struct pipe_context *pipe)
{
- pipe->get_tex_transfer = svga_get_tex_transfer;
+ pipe->tex_transfer = svga_get_transfer;
pipe->transfer_map = svga_transfer_map;
pipe->transfer_unmap = svga_transfer_unmap;
- pipe->tex_transfer_destroy = svga_tex_transfer_destroy;
+ pipe->transfer_destroy = svga_transfer_destroy;
}
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index 5c24bd1f7d..ed648d2301 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -1349,7 +1349,7 @@ trace_is_buffer_referenced( struct pipe_context *_pipe,
static struct pipe_transfer *
-trace_context_get_tex_transfer(struct pipe_context *_context,
+trace_context_get_transfer(struct pipe_context *_context,
struct pipe_texture *_texture,
unsigned face, unsigned level,
unsigned zslice,
@@ -1364,7 +1364,7 @@ trace_context_get_tex_transfer(struct pipe_context *_context,
assert(texture->screen == context->screen);
- trace_dump_call_begin("pipe_context", "get_tex_transfer");
+ trace_dump_call_begin("pipe_context", "get_transfer");
trace_dump_arg(ptr, context);
trace_dump_arg(ptr, texture);
@@ -1378,7 +1378,7 @@ trace_context_get_tex_transfer(struct pipe_context *_context,
trace_dump_arg(uint, w);
trace_dump_arg(uint, h);
- result = context->get_tex_transfer(context, texture, face, level, zslice, usage,
+ result = pipe_get_transfer(context, texture, face, level, zslice, usage,
x, y, w, h);
trace_dump_ret(ptr, result);
@@ -1393,7 +1393,7 @@ trace_context_get_tex_transfer(struct pipe_context *_context,
static void
-trace_context_tex_transfer_destroy(struct pipe_context *_context,
+trace_context_transfer_destroy(struct pipe_context *_context,
struct pipe_transfer *_transfer)
{
struct trace_context *tr_context = trace_context(_context);
@@ -1401,7 +1401,7 @@ trace_context_tex_transfer_destroy(struct pipe_context *_context,
struct pipe_context *context = tr_context->pipe;
struct pipe_transfer *transfer = tr_trans->transfer;
- trace_dump_call_begin("pipe_context", "tex_transfer_destroy");
+ trace_dump_call_begin("pipe_context", "transfer_destroy");
trace_dump_arg(ptr, context);
trace_dump_arg(ptr, transfer);
@@ -1558,8 +1558,8 @@ trace_context_create(struct trace_screen *tr_scr,
tr_ctx->base.is_texture_referenced = trace_is_texture_referenced;
tr_ctx->base.is_buffer_referenced = trace_is_buffer_referenced;
- tr_ctx->base.get_tex_transfer = trace_context_get_tex_transfer;
- tr_ctx->base.tex_transfer_destroy = trace_context_tex_transfer_destroy;
+ tr_ctx->base.get_transfer = trace_context_get_transfer;
+ tr_ctx->base.transfer_destroy = trace_context_transfer_destroy;
tr_ctx->base.transfer_map = trace_context_transfer_map;
tr_ctx->base.transfer_unmap = trace_context_transfer_unmap;
diff --git a/src/gallium/drivers/trace/tr_rbug.c b/src/gallium/drivers/trace/tr_rbug.c
index 53ab8c686d..287c37ca65 100644
--- a/src/gallium/drivers/trace/tr_rbug.c
+++ b/src/gallium/drivers/trace/tr_rbug.c
@@ -239,7 +239,7 @@ trace_rbug_texture_read(struct trace_rbug *tr_rbug, struct rbug_header *header,
}
tex = tr_tex->texture;
- t = context->get_tex_transfer(context, tex,
+ t = pipe_get_transfer(context, tex,
gptr->face, gptr->level, gptr->zslice,
PIPE_TRANSFER_READ,
gptr->x, gptr->y, gptr->w, gptr->h);
@@ -257,7 +257,7 @@ trace_rbug_texture_read(struct trace_rbug *tr_rbug, struct rbug_header *header,
NULL);
context->transfer_unmap(context, t);
- context->tex_transfer_destroy(context, t);
+ context->transfer_destroy(context, t);
pipe_mutex_unlock(tr_scr->list_mutex);
diff --git a/src/gallium/drivers/trace/tr_texture.c b/src/gallium/drivers/trace/tr_texture.c
index d818e21bb8..d6b7c6f7eb 100644
--- a/src/gallium/drivers/trace/tr_texture.c
+++ b/src/gallium/drivers/trace/tr_texture.c
@@ -154,7 +154,7 @@ trace_transfer_create(struct trace_context *tr_ctx,
return &tr_trans->base;
error:
- tr_ctx->pipe->tex_transfer_destroy(tr_ctx->pipe, transfer);
+ tr_ctx->pipe->transfer_destroy(tr_ctx->pipe, transfer);
return NULL;
}
@@ -170,7 +170,7 @@ trace_transfer_destroy(struct trace_context *tr_context,
trace_screen_remove_from_list(tr_scr, transfers, tr_trans);
pipe_texture_reference(&tr_trans->base.texture, NULL);
- context->tex_transfer_destroy(context, transfer);
+ context->transfer_destroy(context, transfer);
FREE(tr_trans);
}
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index 04ece1d760..675a2a3398 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -65,7 +65,7 @@ struct pipe_context {
unsigned mode, unsigned start, unsigned count);
void (*draw_elements)( struct pipe_context *pipe,
- struct pipe_buffer *indexBuffer,
+ struct pipe_resource *indexBuffer,
unsigned indexSize,
unsigned mode, unsigned start, unsigned count);
@@ -77,7 +77,7 @@ struct pipe_context {
unsigned instanceCount);
void (*draw_elements_instanced)(struct pipe_context *pipe,
- struct pipe_buffer *indexBuffer,
+ struct pipe_resource *indexBuffer,
unsigned indexSize,
unsigned mode,
unsigned start,
@@ -91,7 +91,7 @@ struct pipe_context {
* module.
*/
void (*draw_range_elements)( struct pipe_context *pipe,
- struct pipe_buffer *indexBuffer,
+ struct pipe_resource *indexBuffer,
unsigned indexSize,
unsigned minIndex,
unsigned maxIndex,
@@ -200,7 +200,7 @@ struct pipe_context {
void (*set_constant_buffer)( struct pipe_context *,
uint shader, uint index,
- struct pipe_buffer *buf );
+ struct pipe_resource *buf );
void (*set_framebuffer_state)( struct pipe_context *,
const struct pipe_framebuffer_state * );
@@ -299,7 +299,7 @@ struct pipe_context {
* Create a view on a texture to be used by a shader stage.
*/
struct pipe_sampler_view * (*create_sampler_view)(struct pipe_context *ctx,
- struct pipe_texture *texture,
+ struct pipe_resource *texture,
const struct pipe_sampler_view *templat);
void (*sampler_view_destroy)(struct pipe_context *ctx,
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 2ff2e99716..a85110b8eb 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -298,6 +298,13 @@ enum pipe_transfer_usage {
#define PIPE_BUFFER_USAGE_VERTEX (1 << 5)
#define PIPE_BUFFER_USAGE_INDEX (1 << 6)
#define PIPE_BUFFER_USAGE_CONSTANT (1 << 7)
+/* Convenient shortcuts */
+#define PIPE_BUFFER_USAGE_CPU_READ_WRITE \
+ ( PIPE_BUFFER_USAGE_CPU_READ | PIPE_BUFFER_USAGE_CPU_WRITE )
+#define PIPE_BUFFER_USAGE_GPU_READ_WRITE \
+ ( PIPE_BUFFER_USAGE_GPU_READ | PIPE_BUFFER_USAGE_GPU_WRITE )
+#define PIPE_BUFFER_USAGE_WRITE \
+ ( PIPE_BUFFER_USAGE_CPU_WRITE | PIPE_BUFFER_USAGE_GPU_WRITE )
/**
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index 379b8ed906..e355f74f8b 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -54,7 +54,6 @@ struct winsys_handle;
/** Opaque type */
struct pipe_fence_handle;
struct pipe_winsys;
-struct pipe_buffer;
struct pipe_texture;
struct pipe_resource;
struct pipe_surface;
@@ -145,6 +144,31 @@ struct pipe_screen {
/**
+ * Create a buffer that wraps user-space data.
+ *
+ * Effectively this schedules a delayed call to buffer_create
+ * followed by an upload of the data at *some point in the future*,
+ * or perhaps never. Basically the allocate/upload is delayed
+ * until the buffer is actually passed to hardware.
+ *
+ * The intention is to provide a quick way to turn regular data
+ * into a buffer, and secondly to avoid a copy operation if that
+ * data subsequently turns out to be only accessed by the CPU.
+ *
+ * Common example is OpenGL vertex buffers that are subsequently
+ * processed either by software TNL in the driver or by passing to
+ * hardware.
+ *
+ * XXX: What happens if the delayed call to buffer_create() fails?
+ *
+ * Note that ptr may be accessed at any time upto the time when the
+ * buffer is destroyed, so the data must not be freed before then.
+ */
+ struct pipe_resource *(*user_buffer_create)(struct pipe_screen *screen,
+ void *ptr,
+ unsigned bytes);
+
+ /**
* Create a video surface suitable for use as a decoding target by the
* driver's pipe_video_context.
*/
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index 5588d76c1b..4803ff7295 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -272,7 +272,7 @@ struct pipe_sampler_state
struct pipe_surface
{
struct pipe_reference reference;
- struct pipe_resource *resource; /**< resource into which this is a view */
+ struct pipe_resource *texture; /**< resource into which this is a view */
enum pipe_format format;
unsigned width; /**< logical width in pixels */
@@ -298,7 +298,7 @@ struct pipe_sampler_view
{
struct pipe_reference reference;
enum pipe_format format; /**< typed PIPE_FORMAT_x */
- struct pipe_texture *texture; /**< texture into which this is a view */
+ struct pipe_resource *texture; /**< texture into which this is a view */
struct pipe_context *context; /**< context this view belongs to */
unsigned first_level:8; /**< first mipmap level */
unsigned last_level:8; /**< last mipmap level */
@@ -314,7 +314,7 @@ struct pipe_sampler_view
*/
struct pipe_transfer
{
- struct pipe_resource *texture; /**< resource to transfer to/from */
+ struct pipe_resource *resource; /**< resource to transfer to/from */
unsigned stride;
unsigned slice_stride;
void *data;
@@ -342,16 +342,8 @@ struct pipe_resource
unsigned tex_usage; /**< bitmask of PIPE_TEXTURE_USAGE_* */
};
-/* Transition helpers:
- */
-struct pipe_buffer {
- struct pipe_resource base;
-};
-
-struct pipe_texture {
- struct pipe_resource base;
-};
-
+#define pipe_texture pipe_resource
+#define pipe_buffer pipe_resource
struct pipe_subresource
{
diff --git a/src/gallium/include/pipe/p_video_context.h b/src/gallium/include/pipe/p_video_context.h
index 927bdf15d7..5d1ab47418 100644
--- a/src/gallium/include/pipe/p_video_context.h
+++ b/src/gallium/include/pipe/p_video_context.h
@@ -35,7 +35,6 @@ extern "C" {
#include <pipe/p_video_state.h>
struct pipe_screen;
-struct pipe_buffer;
struct pipe_surface;
struct pipe_video_surface;
struct pipe_macroblock;
diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c
index 0d87c705e7..c09452f777 100644
--- a/src/gallium/state_trackers/python/st_device.c
+++ b/src/gallium/state_trackers/python/st_device.c
@@ -245,7 +245,7 @@ st_context_create(struct st_device *st_dev)
st_ctx->default_texture = screen->texture_create( screen, &templat );
if(st_ctx->default_texture) {
- transfer = screen->get_tex_transfer(screen,
+ transfer = screen->get_transfer(screen,
st_ctx->default_texture,
0, 0, 0,
PIPE_TRANSFER_WRITE,
diff --git a/src/gallium/state_trackers/python/st_sample.c b/src/gallium/state_trackers/python/st_sample.c
index e180815346..ea27275325 100644
--- a/src/gallium/state_trackers/python/st_sample.c
+++ b/src/gallium/state_trackers/python/st_sample.c
@@ -533,7 +533,7 @@ st_sample_surface(struct st_surface *surface, float *rgba)
struct pipe_transfer *transfer;
void *raw;
- transfer = screen->get_tex_transfer(screen,
+ transfer = screen->get_transfer(screen,
surface->texture,
surface->face,
surface->level,
diff --git a/src/gallium/state_trackers/vega/api_filters.c b/src/gallium/state_trackers/vega/api_filters.c
index 18e2cc1f25..b1bd297ff3 100644
--- a/src/gallium/state_trackers/vega/api_filters.c
+++ b/src/gallium/state_trackers/vega/api_filters.c
@@ -78,7 +78,7 @@ static INLINE struct pipe_texture *create_texture_1d(struct vg_context *ctx,
{ /* upload color_data */
struct pipe_transfer *transfer =
- pipe->get_tex_transfer(pipe, tex,
+ pipe->get_transfer(pipe, tex,
0, 0, 0,
PIPE_TRANSFER_READ_WRITE ,
0, 0, tex->width0, tex->height0);
diff --git a/src/gallium/state_trackers/vega/api_images.c b/src/gallium/state_trackers/vega/api_images.c
index fec473d9d2..3765f15ffa 100644
--- a/src/gallium/state_trackers/vega/api_images.c
+++ b/src/gallium/state_trackers/vega/api_images.c
@@ -441,7 +441,7 @@ void vgReadPixels(void * data, VGint dataStride,
{
struct pipe_transfer *transfer;
- transfer = pipe->get_tex_transfer(pipe, strb->texture, 0, 0, 0,
+ transfer = pipe->get_transfer(pipe, strb->texture, 0, 0, 0,
PIPE_TRANSFER_READ,
0, 0, width, height);
diff --git a/src/gallium/state_trackers/vega/image.c b/src/gallium/state_trackers/vega/image.c
index a71579cd26..bf86533d3d 100644
--- a/src/gallium/state_trackers/vega/image.c
+++ b/src/gallium/state_trackers/vega/image.c
@@ -412,7 +412,7 @@ void image_sub_data(struct vg_image *image,
}
{ /* upload color_data */
- struct pipe_transfer *transfer = pipe->get_tex_transfer(
+ struct pipe_transfer *transfer = pipe->get_transfer(
pipe, texture, 0, 0, 0,
PIPE_TRANSFER_WRITE, 0, 0, texture->width0, texture->height0);
src += (dataStride * yoffset);
@@ -443,7 +443,7 @@ void image_get_sub_data(struct vg_image * image,
{
struct pipe_transfer *transfer =
- pipe->get_tex_transfer(pipe,
+ pipe->get_transfer(pipe,
image->texture, 0, 0, 0,
PIPE_TRANSFER_READ,
0, 0,
diff --git a/src/gallium/state_trackers/vega/paint.c b/src/gallium/state_trackers/vega/paint.c
index dc56b8c5f3..1bf0227f23 100644
--- a/src/gallium/state_trackers/vega/paint.c
+++ b/src/gallium/state_trackers/vega/paint.c
@@ -162,7 +162,7 @@ static INLINE struct pipe_texture *create_gradient_texture(struct vg_paint *p)
{ /* upload color_data */
struct pipe_transfer *transfer =
- st_no_flush_get_tex_transfer(p->base.ctx, tex, 0, 0, 0,
+ st_no_flush_get_transfer(p->base.ctx, tex, 0, 0, 0,
PIPE_TRANSFER_WRITE, 0, 0, 1024, 1);
void *map = pipe->transfer_map(pipe, transfer);
memcpy(map, p->gradient.color_data, sizeof(VGint)*1024);
diff --git a/src/gallium/state_trackers/vega/st_inlines.h b/src/gallium/state_trackers/vega/st_inlines.h
index 4d12a4efdd..a35658d1fa 100644
--- a/src/gallium/state_trackers/vega/st_inlines.h
+++ b/src/gallium/state_trackers/vega/st_inlines.h
@@ -42,7 +42,7 @@
#include "pipe/p_state.h"
static INLINE struct pipe_transfer *
-st_cond_flush_get_tex_transfer(struct vg_context *st,
+st_cond_flush_get_transfer(struct vg_context *st,
struct pipe_texture *pt,
unsigned int face,
unsigned int level,
@@ -59,12 +59,12 @@ st_cond_flush_get_tex_transfer(struct vg_context *st,
(usage & PIPE_TRANSFER_WRITE)))
vgFlush();
- return pipe->get_tex_transfer(pipe, pt, face, level, zslice, usage,
+ return pipe->get_transfer(pipe, pt, face, level, zslice, usage,
x, y, w, h);
}
static INLINE struct pipe_transfer *
-st_no_flush_get_tex_transfer(struct vg_context *st,
+st_no_flush_get_transfer(struct vg_context *st,
struct pipe_texture *pt,
unsigned int face,
unsigned int level,
@@ -75,7 +75,7 @@ st_no_flush_get_tex_transfer(struct vg_context *st,
{
struct pipe_context *pipe = st->pipe;
- return pipe->get_tex_transfer(pipe, pt, face, level,
+ return pipe->get_transfer(pipe, pt, face, level,
zslice, usage, x, y, w, h);
}
diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c
index eef428232b..a811c829fc 100644
--- a/src/gallium/state_trackers/xorg/xorg_crtc.c
+++ b/src/gallium/state_trackers/xorg/xorg_crtc.c
@@ -220,7 +220,7 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
crtcp->cursor_handle = whandle.handle;
}
- transfer = ms->ctx->get_tex_transfer(ms->ctx, crtcp->cursor_tex,
+ transfer = ms->ctx->get_transfer(ms->ctx, crtcp->cursor_tex,
0, 0, 0,
PIPE_TRANSFER_WRITE,
0, 0, 64, 64);
diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c
index f94cca4c90..bcf6cfcbfc 100644
--- a/src/gallium/state_trackers/xorg/xorg_exa.c
+++ b/src/gallium/state_trackers/xorg/xorg_exa.c
@@ -188,7 +188,7 @@ ExaDownloadFromScreen(PixmapPtr pPix, int x, int y, int w, int h, char *dst,
if (!priv || !priv->tex)
return FALSE;
- transfer = exa->pipe->get_tex_transfer(exa->pipe, priv->tex, 0, 0, 0,
+ transfer = exa->pipe->get_transfer(exa->pipe, priv->tex, 0, 0, 0,
PIPE_TRANSFER_READ, x, y, w, h);
if (!transfer)
return FALSE;
@@ -222,7 +222,7 @@ ExaUploadToScreen(PixmapPtr pPix, int x, int y, int w, int h, char *src,
if (!priv || !priv->tex)
return FALSE;
- transfer = exa->pipe->get_tex_transfer(exa->pipe, priv->tex, 0, 0, 0,
+ transfer = exa->pipe->get_transfer(exa->pipe, priv->tex, 0, 0, 0,
PIPE_TRANSFER_WRITE, x, y, w, h);
if (!transfer)
return FALSE;
diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c
index 5a195cb482..a821762f12 100644
--- a/src/gallium/state_trackers/xorg/xorg_xv.c
+++ b/src/gallium/state_trackers/xorg/xorg_xv.c
@@ -281,15 +281,15 @@ copy_packed_data(ScrnInfoPtr pScrn,
int yidx, uidx, vidx;
int y_array_size = w * h;
- ytrans = pipe->get_tex_transfer(pipe, dst[0],
+ ytrans = pipe->get_transfer(pipe, dst[0],
0, 0, 0,
PIPE_TRANSFER_WRITE,
left, top, w, h);
- utrans = pipe->get_tex_transfer(pipe, dst[1],
+ utrans = pipe->get_transfer(pipe, dst[1],
0, 0, 0,
PIPE_TRANSFER_WRITE,
left, top, w, h);
- vtrans = pipe->get_tex_transfer(pipe, dst[2],
+ vtrans = pipe->get_transfer(pipe, dst[2],
0, 0, 0,
PIPE_TRANSFER_WRITE,
left, top, w, h);
diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
index 21517b4bb5..4f9c455180 100644
--- a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
+++ b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
@@ -19,8 +19,8 @@ dri_surface_from_handle(struct drm_api *api, struct pipe_screen *pscreen,
unsigned width, unsigned height, unsigned pitch)
{
struct pipe_surface *ps = NULL;
- struct pipe_texture *pt = NULL;
- struct pipe_texture tmpl;
+ struct pipe_resource *pt = NULL;
+ struct pipe_resource tmpl;
struct winsys_handle whandle;
memset(&tmpl, 0, sizeof(tmpl));