Commit ee6b3bc7 authored by Keith Whitwell's avatar Keith Whitwell

wip2

parent 18308802
......@@ -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 \
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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,
......
......@@ -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);
......
......@@ -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);
......
......@@ -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));
......
......@@ -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));
......
......@@ -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 )
......
......@@ -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,
......
......@@ -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) */
......
......@@ -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);
......
......@@ -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,
......
......@@ -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;
}
......@@ -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 );
......
......@@ -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));
......
......@@ -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
......
......@@ -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)
{
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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 )
......
......@@ -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 )