Commit fb6764d3 authored by Keith Whitwell's avatar Keith Whitwell

heaps of wip

parent ee6b3bc7
......@@ -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 \
......@@ -125,9 +125,7 @@ C_SOURCES = \
util/u_surface.c \
util/u_texture.c \
util/u_tile.c \
util/u_timed_winsys.c \
util/u_upload_mgr.c \
util/u_simple_screen.c
# Disabling until pipe-video branch gets merged in
#vl/vl_bitstream_parser.c \
#vl/vl_mpeg12_mc_renderer.c \
......
......@@ -71,7 +71,7 @@ struct cso_context {
unsigned nr_vertex_samplers_saved;
void *vertex_samplers_saved[PIPE_MAX_VERTEX_SAMPLERS];
struct pipe_texture *textures[PIPE_MAX_SAMPLERS];
struct pipe_resource *textures[PIPE_MAX_SAMPLERS];
uint nr_fragment_sampler_views;
struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
uint nr_textures;
......@@ -80,7 +80,7 @@ struct cso_context {
struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_VERTEX_SAMPLERS];
uint nr_textures_saved;
struct pipe_texture *textures_saved[PIPE_MAX_SAMPLERS];
struct pipe_resource *textures_saved[PIPE_MAX_SAMPLERS];
uint nr_fragment_sampler_views_saved;
struct pipe_sampler_view *fragment_sampler_views_saved[PIPE_MAX_SAMPLERS];
......@@ -299,8 +299,8 @@ void cso_release_all( struct cso_context *ctx )
}
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
pipe_texture_reference(&ctx->textures[i], NULL);
pipe_texture_reference(&ctx->textures_saved[i], NULL);
pipe_resource_reference(&ctx->textures[i], NULL);
pipe_resource_reference(&ctx->textures_saved[i], NULL);
pipe_sampler_view_reference(&ctx->fragment_sampler_views[i], NULL);
pipe_sampler_view_reference(&ctx->fragment_sampler_views_saved[i], NULL);
}
......@@ -626,7 +626,7 @@ cso_restore_vertex_samplers(struct cso_context *ctx)
enum pipe_error cso_set_sampler_textures( struct cso_context *ctx,
uint count,
struct pipe_texture **textures )
struct pipe_resource **textures )
{
uint i;
......
......@@ -106,7 +106,7 @@ cso_single_vertex_sampler_done(struct cso_context *cso);
enum pipe_error cso_set_sampler_textures( struct cso_context *cso,
uint count,
struct pipe_texture **textures );
struct pipe_resource **textures );
void cso_save_sampler_textures( struct cso_context *cso );
void cso_restore_sampler_textures( struct cso_context *cso );
......
......@@ -88,7 +88,7 @@ struct aaline_stage
uint pos_slot;
void *sampler_cso;
struct pipe_texture *texture;
struct pipe_resource *texture;
struct pipe_sampler_view *sampler_view;
uint num_samplers;
uint num_sampler_views;
......@@ -753,7 +753,7 @@ aaline_destroy(struct draw_stage *stage)
aaline->pipe->delete_sampler_state(aaline->pipe, aaline->sampler_cso);
if (aaline->texture)
pipe_texture_reference(&aaline->texture, NULL);
pipe_resource_reference(&aaline->texture, NULL);
if (aaline->sampler_view) {
pipe_sampler_view_reference(&aaline->sampler_view, NULL);
......
......@@ -75,7 +75,7 @@ struct pstip_stage
struct draw_stage stage;
void *sampler_cso;
struct pipe_texture *texture;
struct pipe_resource *texture;
struct pipe_sampler_view *sampler_view;
uint num_samplers;
uint num_sampler_views;
......@@ -426,7 +426,7 @@ pstip_create_texture(struct pstip_stage *pstip)
{
struct pipe_context *pipe = pstip->pipe;
struct pipe_screen *screen = pipe->screen;
struct pipe_texture texTemp;
struct pipe_resource texTemp;
struct pipe_sampler_view viewTempl;
memset(&texTemp, 0, sizeof(texTemp));
......@@ -591,7 +591,7 @@ pstip_destroy(struct draw_stage *stage)
pstip->pipe->delete_sampler_state(pstip->pipe, pstip->sampler_cso);
pipe_texture_reference(&pstip->texture, NULL);
pipe_resource_reference(&pstip->texture, NULL);
if (pstip->sampler_view) {
pipe_sampler_view_reference(&pstip->sampler_view, NULL);
......
......@@ -48,7 +48,6 @@
#include "util/u_debug.h"
#include "util/u_inlines.h"
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
#ifdef __cplusplus
......@@ -58,8 +57,23 @@ extern "C" {
struct pb_vtbl;
struct pb_validate;
struct pipe_fence_handle;
#define PB_USAGE_CPU_READ (1 << 0)
#define PB_USAGE_CPU_WRITE (1 << 1)
#define PB_USAGE_GPU_READ (1 << 2)
#define PB_USAGE_GPU_WRITE (1 << 3)
#define PB_USAGE_UNSYNCHRONIZED (1 << 10)
#define PB_USAGE_DONTBLOCK (1 << 9)
#define PB_USAGE_CPU_READ_WRITE \
( PB_USAGE_CPU_READ | PB_USAGE_CPU_WRITE )
#define PB_USAGE_GPU_READ_WRITE \
( PB_USAGE_GPU_READ | PB_USAGE_GPU_WRITE )
#define PB_USAGE_WRITE \
( PB_USAGE_CPU_WRITE | PB_USAGE_GPU_WRITE )
/**
* Buffer description.
*
......@@ -83,7 +97,14 @@ typedef unsigned pb_size;
*/
struct pb_buffer
{
struct pipe_resource base;
/* This used to be a pipe_buffer struct:
*/
struct {
struct pipe_reference reference;
unsigned size;
unsigned alignment;
unsigned usage;
} base;
/**
* Pointer to the virtual function table.
......@@ -106,7 +127,7 @@ struct pb_vtbl
/**
* Map the entire data store of a buffer object into the client's address.
* flags is bitmask of PIPE_BUFFER_FLAG_READ/WRITE.
* flags is bitmask of PB_USAGE_CPU_READ/WRITE.
*/
void *(*map)( struct pb_buffer *buf,
unsigned flags );
......@@ -138,23 +159,6 @@ struct pb_vtbl
};
static INLINE struct pipe_buffer *
pb_pipe_buffer( struct pb_buffer *pbuf )
{
assert(pbuf);
return &pbuf->base;
}
static INLINE struct pb_buffer *
pb_buffer( struct pipe_buffer *buf )
{
assert(buf);
/* Could add a magic cookie check on debug builds.
*/
return (struct pb_buffer *)buf;
}
/* Accessor functions for pb->vtbl:
*/
......@@ -196,7 +200,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.width0);
assert(*offset < (*base_buf)->base.size);
}
......
......@@ -135,7 +135,7 @@ struct fenced_buffer
void *data;
/**
* A bitmask of PIPE_BUFFER_USAGE_CPU/GPU_READ/WRITE describing the current
* A bitmask of PB_USAGE_CPU/GPU_READ/WRITE describing the current
* buffer usage.
*/
unsigned flags;
......@@ -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.width0,
fenced_buf->base.base.size,
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.width0,
fenced_buf->base.base.size,
p_atomic_read(&fenced_buf->base.base.reference.count),
"gpu",
(void *) fenced_buf->fence,
......@@ -270,7 +270,7 @@ fenced_buffer_add_locked(struct fenced_manager *fenced_mgr,
struct fenced_buffer *fenced_buf)
{
assert(pipe_is_referenced(&fenced_buf->base.base.reference));
assert(fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_READ_WRITE);
assert(fenced_buf->flags & PB_USAGE_GPU_READ_WRITE);
assert(fenced_buf->fence);
p_atomic_inc(&fenced_buf->base.base.reference.count);
......@@ -299,7 +299,7 @@ fenced_buffer_remove_locked(struct fenced_manager *fenced_mgr,
assert(fenced_buf->mgr == fenced_mgr);
ops->fence_reference(ops, &fenced_buf->fence, NULL);
fenced_buf->flags &= ~PIPE_BUFFER_USAGE_GPU_READ_WRITE;
fenced_buf->flags &= ~PB_USAGE_GPU_READ_WRITE;
assert(fenced_buf->head.prev);
assert(fenced_buf->head.next);
......@@ -377,7 +377,7 @@ fenced_buffer_finish_locked(struct fenced_manager *fenced_mgr,
assert(!destroyed);
fenced_buf->flags &= ~PIPE_BUFFER_USAGE_GPU_READ_WRITE;
fenced_buf->flags &= ~PB_USAGE_GPU_READ_WRITE;
ret = PIPE_OK;
}
......@@ -624,7 +624,7 @@ fenced_buffer_copy_storage_to_gpu_locked(struct fenced_buffer *fenced_buf)
assert(fenced_buf->data);
assert(fenced_buf->buffer);
map = pb_map(fenced_buf->buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
map = pb_map(fenced_buf->buffer, PB_USAGE_CPU_WRITE);
if(!map)
return PIPE_ERROR;
......@@ -644,7 +644,7 @@ fenced_buffer_copy_storage_to_cpu_locked(struct fenced_buffer *fenced_buf)
assert(fenced_buf->data);
assert(fenced_buf->buffer);
map = pb_map(fenced_buf->buffer, PIPE_BUFFER_USAGE_CPU_READ);
map = pb_map(fenced_buf->buffer, PB_USAGE_CPU_READ);
if(!map)
return PIPE_ERROR;
......@@ -683,24 +683,24 @@ fenced_buffer_map(struct pb_buffer *buf,
pipe_mutex_lock(fenced_mgr->mutex);
assert(!(flags & PIPE_BUFFER_USAGE_GPU_READ_WRITE));
assert(!(flags & PB_USAGE_GPU_READ_WRITE));
/*
* Serialize writes.
*/
while((fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_WRITE) ||
((fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_READ) &&
(flags & PIPE_BUFFER_USAGE_CPU_WRITE))) {
while((fenced_buf->flags & PB_USAGE_GPU_WRITE) ||
((fenced_buf->flags & PB_USAGE_GPU_READ) &&
(flags & PB_USAGE_CPU_WRITE))) {
/*
* Don't wait for the GPU to finish accessing it, if blocking is forbidden.
*/
if((flags & PIPE_BUFFER_USAGE_DONTBLOCK) &&
if((flags & PB_USAGE_DONTBLOCK) &&
ops->fence_signalled(ops, fenced_buf->fence, 0) != 0) {
goto done;
}
if (flags & PIPE_BUFFER_USAGE_UNSYNCHRONIZED) {
if (flags & PB_USAGE_UNSYNCHRONIZED) {
break;
}
......@@ -721,7 +721,7 @@ fenced_buffer_map(struct pb_buffer *buf,
if(map) {
++fenced_buf->mapcount;
fenced_buf->flags |= flags & PIPE_BUFFER_USAGE_CPU_READ_WRITE;
fenced_buf->flags |= flags & PB_USAGE_CPU_READ_WRITE;
}
done:
......@@ -745,7 +745,7 @@ fenced_buffer_unmap(struct pb_buffer *buf)
pb_unmap(fenced_buf->buffer);
--fenced_buf->mapcount;
if(!fenced_buf->mapcount)
fenced_buf->flags &= ~PIPE_BUFFER_USAGE_CPU_READ_WRITE;
fenced_buf->flags &= ~PB_USAGE_CPU_READ_WRITE;
}
pipe_mutex_unlock(fenced_mgr->mutex);
......@@ -771,9 +771,9 @@ fenced_buffer_validate(struct pb_buffer *buf,
goto done;
}
assert(flags & PIPE_BUFFER_USAGE_GPU_READ_WRITE);
assert(!(flags & ~PIPE_BUFFER_USAGE_GPU_READ_WRITE));
flags &= PIPE_BUFFER_USAGE_GPU_READ_WRITE;
assert(flags & PB_USAGE_GPU_READ_WRITE);
assert(!(flags & ~PB_USAGE_GPU_READ_WRITE));
flags &= PB_USAGE_GPU_READ_WRITE;
/* Buffer cannot be validated in two different lists */
if(fenced_buf->vl && fenced_buf->vl != vl) {
......
......@@ -59,7 +59,6 @@ extern "C" {
#endif
struct pipe_buffer;
struct pipe_fence_handle;
......
......@@ -136,9 +136,8 @@ pb_malloc_buffer_create(pb_size size,
pipe_reference_init(&buf->base.base.reference, 1);
buf->base.base.usage = desc->usage;
buf->base.base.width0 = size;
buf->base.base.height0 = 1;
buf->base.base.depth0 = 1;
buf->base.base.size = size;
buf->base.base.alignment = desc->alignment;
buf->base.vtbl = &malloc_buffer_vtbl;
buf->data = align_malloc(size, desc->alignment < sizeof(void*) ? sizeof(void*) : desc->alignment);
......
......@@ -60,7 +60,6 @@ extern "C" {
struct pb_desc;
struct pipe_buffer;
/**
......
......@@ -158,7 +158,7 @@ pb_debug_buffer_fill(struct pb_debug_buffer *buf)
{
uint8_t *map;
map = pb_map(buf->buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
map = pb_map(buf->buffer, PB_USAGE_CPU_WRITE);
assert(map);
if(map) {
fill_random_pattern(map, buf->underflow_size);
......@@ -180,8 +180,8 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf)
uint8_t *map;
map = pb_map(buf->buffer,
PIPE_BUFFER_USAGE_CPU_READ |
PIPE_BUFFER_USAGE_UNSYNCHRONIZED);
PB_USAGE_CPU_READ |
PB_USAGE_UNSYNCHRONIZED);
assert(map);
if(map) {
boolean underflow, overflow;
......@@ -382,8 +382,8 @@ pb_debug_manager_create_buffer(struct pb_manager *_mgr,
real_size = mgr->underflow_size + size + mgr->overflow_size;
real_desc = *desc;
real_desc.usage |= PIPE_BUFFER_USAGE_CPU_WRITE;
real_desc.usage |= PIPE_BUFFER_USAGE_CPU_READ;
real_desc.usage |= PB_USAGE_CPU_WRITE;
real_desc.usage |= PB_USAGE_CPU_READ;
buf->buffer = mgr->provider->create_buffer(mgr->provider,
real_size,
......
......@@ -268,8 +268,8 @@ mm_bufmgr_create_from_buffer(struct pb_buffer *buffer,
mm->buffer = buffer;
mm->map = pb_map(mm->buffer,
PIPE_BUFFER_USAGE_CPU_READ |
PIPE_BUFFER_USAGE_CPU_WRITE);
PB_USAGE_CPU_READ |
PB_USAGE_CPU_WRITE);
if(!mm->map)
goto failure;
......
......@@ -150,7 +150,7 @@ pb_ondemand_buffer_instantiate(struct pb_ondemand_buffer *buf)
if(!buf->buffer)
return PIPE_ERROR_OUT_OF_MEMORY;
map = pb_map(buf->buffer, PIPE_BUFFER_USAGE_CPU_READ);
map = pb_map(buf->buffer, PB_USAGE_CPU_READ);
if(!map) {
pb_reference(&buf->buffer, NULL);
return PIPE_ERROR;
......
......@@ -284,8 +284,8 @@ pool_bufmgr_create(struct pb_manager *provider,
goto failure;
pool->map = pb_map(pool->buffer,
PIPE_BUFFER_USAGE_CPU_READ |
PIPE_BUFFER_USAGE_CPU_WRITE);
PB_USAGE_CPU_READ |
PB_USAGE_CPU_WRITE);
if(!pool->map)
goto failure;
......
......@@ -315,8 +315,8 @@ pb_slab_create(struct pb_slab_manager *mgr)
/* Note down the slab virtual address. All mappings are accessed directly
* through this address so it is required that the buffer is pinned. */
slab->virtual = pb_map(slab->bo,
PIPE_BUFFER_USAGE_CPU_READ |
PIPE_BUFFER_USAGE_CPU_WRITE);
PB_USAGE_CPU_READ |
PB_USAGE_CPU_WRITE);
if(!slab->virtual) {
ret = PIPE_ERROR_OUT_OF_MEMORY;
goto out_err1;
......
......@@ -69,9 +69,9 @@ pb_validate_add_buffer(struct pb_validate *vl,
if(!buf)
return PIPE_ERROR;
assert(flags & PIPE_BUFFER_USAGE_GPU_READ_WRITE);
assert(!(flags & ~PIPE_BUFFER_USAGE_GPU_READ_WRITE));
flags &= PIPE_BUFFER_USAGE_GPU_READ_WRITE;
assert(flags & PB_USAGE_GPU_READ_WRITE);
assert(!(flags & ~PB_USAGE_GPU_READ_WRITE));
flags &= PB_USAGE_GPU_READ_WRITE;
/* We only need to store one reference for each buffer, so avoid storing
* consecutive references for the same buffer. It might not be the most
......
......@@ -68,7 +68,7 @@ struct blit_state
void *vs;
void *fs[TGSI_WRITEMASK_XYZW + 1];
struct pipe_buffer *vbuf; /**< quad vertices */
struct pipe_resource *vbuf; /**< quad vertices */
unsigned vbuf_slot;
float vertices[4][2][4]; /**< vertex/texcoords for quad */
......@@ -166,7 +166,7 @@ util_destroy_blit(struct blit_state *ctx)
if (ctx->fs[i])
pipe->delete_fs_state(pipe, ctx->fs[i]);
pipe_buffer_reference(&ctx->vbuf, NULL);
pipe_resource_reference(&ctx->vbuf, NULL);
FREE(ctx);
}
......@@ -235,7 +235,7 @@ setup_vertex_data_tex(struct blit_state *ctx,
offset = get_next_slot( ctx );
pipe_buffer_write_nooverlap(ctx->pipe->screen, ctx->vbuf,
pipe_buffer_write_nooverlap(ctx->pipe, ctx->vbuf,
offset, sizeof(ctx->vertices), ctx->vertices);
return offset;
......@@ -290,7 +290,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
{
struct pipe_context *pipe = ctx->pipe;
struct pipe_screen *screen = pipe->screen;
struct pipe_texture *tex = NULL;
struct pipe_resource *tex = NULL;
struct pipe_framebuffer_state fb;
const int srcW = abs(srcX1 - srcX0);
const int srcH = abs(srcY1 - srcY0);
......@@ -344,7 +344,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
src->texture->target != PIPE_TEXTURE_2D ||
src->texture->last_level != 0)
{
struct pipe_texture texTemp;
struct pipe_resource texTemp;
struct pipe_surface *texSurf;
const int srcLeft = MIN2(srcX0, srcX1);
const int srcTop = MIN2(srcY0, srcY1);
......@@ -372,7 +372,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
texTemp.height0 = srcH;
texTemp.depth0 = 1;
tex = screen->texture_create(screen, &texTemp);
tex = screen->resource_create(screen, &texTemp);
if (!tex)
return;
......@@ -401,7 +401,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
t1 = 1.0f;
}
else {
pipe_texture_reference(&tex, src->texture);
pipe_resource_reference(&tex, src->texture);
s0 = srcX0 / (float)tex->width0;
s1 = srcX1 / (float)tex->width0;
t0 = srcY0 / (float)tex->height0;
......@@ -494,7 +494,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
cso_restore_clip(ctx->cso);
cso_restore_vertex_elements(ctx->cso);
pipe_texture_reference(&tex, NULL);
pipe_resource_reference(&tex, NULL);
}
......@@ -524,7 +524,7 @@ util_blit_pixels(struct blit_state *ctx,
*/
void util_blit_flush( struct blit_state *ctx )
{
pipe_buffer_reference(&ctx->vbuf, NULL);
pipe_resource_reference(&ctx->vbuf, NULL);
ctx->vbuf_slot = 0;
}
......@@ -539,7 +539,7 @@ void util_blit_flush( struct blit_state *ctx )
*/
void
util_blit_pixels_tex(struct blit_state *ctx,
struct pipe_texture *tex,
struct pipe_resource *tex,
int srcX0, int srcY0,
int srcX1, int srcY1,
struct pipe_surface *dst,
......
......@@ -37,7 +37,7 @@ extern "C" {
struct pipe_context;
struct pipe_surface;
struct pipe_texture;
struct pipe_resource;
struct cso_context;
......@@ -73,7 +73,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
extern void
util_blit_pixels_tex(struct blit_state *ctx,
struct pipe_texture *tex,
struct pipe_resource *tex,
int srcX0, int srcY0,
int srcX1, int srcY1,
struct pipe_surface *dst,
......
......@@ -56,7 +56,7 @@ struct blitter_context_priv
struct blitter_context blitter;
struct pipe_context *pipe; /**< pipe context */
struct pipe_buffer *vbuf; /**< quad */
struct pipe_resource *vbuf; /**< quad */
float vertices[4][2][4]; /**< {pos, color} or {pos, texcoord} */
......@@ -259,7 +259,7 @@ void util_blitter_destroy(struct blitter_context *blitter)
pipe_sampler_view_reference(&ctx->sampler_view, NULL);
}
pipe_buffer_reference(&ctx->vbuf, NULL);
pipe_resource_reference(&ctx->vbuf, NULL);
FREE(ctx);
}
......@@ -451,7 +451,7 @@ static void blitter_draw_quad(struct blitter_context_priv *ctx)
struct pipe_context *pipe = ctx->pipe;
/* write vertices and draw them */
pipe_buffer_write(pipe->screen, ctx->vbuf,
pipe_buffer_write(pipe, ctx->vbuf,
0, sizeof(ctx->vertices), ctx->vertices);
util_draw_vertex_buffer(pipe, ctx->vbuf, 0, PIPE_PRIM_TRIANGLE_FAN,
......@@ -714,8 +714,8 @@ static void util_blitter_overlap_copy(struct blitter_context *blitter,
struct pipe_context *pipe = ctx->pipe;
struct pipe_screen *screen = pipe->screen;
struct pipe_texture texTemp;
struct pipe_texture *texture;
struct pipe_resource texTemp;
struct pipe_resource *texture;
struct pipe_surface *tex_surf;
/* check whether the states are properly saved */
......@@ -729,7 +729,7 @@ static void util_blitter_overlap_copy(struct blitter_context *blitter,
texTemp.height0 = height;
texTemp.depth0 = 1;
texture = screen->texture_create(screen, &texTemp);
texture = screen->resource_create(screen, &texTemp);
if (!texture)
return;
......@@ -747,7 +747,7 @@ static void util_blitter_overlap_copy(struct blitter_context *blitter,
width, height,
FALSE);
pipe_surface_reference(&tex_surf, NULL);
pipe_texture_reference(&texture, NULL);
pipe_resource_reference(&texture, NULL);
blitter_restore_CSOs(ctx);
}
......
......@@ -425,7 +425,7 @@ void debug_dump_surface(struct pipe_context *pipe,
const char *prefix,
struct pipe_surface *surface)
{
struct pipe_texture *texture;
struct pipe_resource *texture;
struct pipe_transfer *transfer;
void *data;
......@@ -440,7 +440,7 @@ void debug_dump_surface(struct pipe_context *pipe,
*/
texture = surface->texture;
transfer = pipe->get_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);
......@@ -452,20 +452,20 @@ void debug_dump_surface(struct pipe_context *pipe,
debug_dump_image(prefix,
texture->format,
util_format_get_blocksize(texture->format),
util_format_get_nblocksx(texture->format, transfer->width),
util_format_get_nblocksy(texture->format, transfer->height),
util_format_get_nblocksx(texture->format, surface->width),
util_format_get_nblocksy(texture->format, surface->height),
transfer->stride,
data);
pipe->transfer_unmap(pipe, transfer);
error:
pipe->tex_transfer_destroy(pipe, transfer);
pipe->transfer_destroy(pipe, transfer);
}
void debug_dump_texture(struct pipe_context *pipe,
const char *prefix,
struct pipe_texture *texture)
struct pipe_resource *texture)
{
struct pipe_surface *surface;
struct pipe_screen *screen;
......@@ -523,16 +523,16 @@ debug_dump_surface_bmp(struct pipe_context *pipe,
{
#ifndef PIPE_SUBSYSTEM_WINDOWS_MINIPORT
struct pipe_transfer *transfer;
struct pipe_texture *texture = surface->texture;
struct pipe_resource *texture = surface->texture;
transfer = pipe->get_transfer(pipe, texture, surface->face,
surface->level, surface->zslice,
PIPE_TRANSFER_READ, 0, 0, surface->width,
surface->height);
transfer = pipe_get_transfer(pipe, texture, surface->face,
surface->level, surface->zslice,
PIPE_TRANSFER_READ, 0, 0, surface->width,
surface->height);
debug_dump_transfer_bmp(pipe, filename, transfer);
pipe->tex_transfer_destroy(pipe, transfer);
pipe->transfer_destroy(pipe, transfer);
#endif
}
......@@ -547,17 +547,20 @@ debug_dump_transfer_bmp(struct pipe_context *pipe,
if (!transfer)
goto error1;
rgba = MALLOC(transfer->width*transfer->height*4*sizeof(float));
rgba = MALLOC(transfer->box.width *
transfer->box.height *
transfer->box.depth *
4*sizeof(float));
if(!rgba)
goto error1;
pipe_get_tile_rgba(pipe, transfer, 0, 0,
transfer->width, transfer->height,
transfer->box.width, transfer->box.height,
rgba);