Commit f3e98fd4 authored by Keith Whitwell's avatar Keith Whitwell

st/vega: convert to pipe_resource

parent d1b7b00a
......@@ -53,17 +53,17 @@ struct filter_info {
const void *const_buffer;
VGint const_buffer_len;
VGTilingMode tiling_mode;
struct pipe_texture *extra_texture;
struct pipe_resource *extra_texture;
};
static INLINE struct pipe_texture *create_texture_1d(struct vg_context *ctx,
static INLINE struct pipe_resource *create_texture_1d(struct vg_context *ctx,
const VGuint *color_data,
const VGint color_data_len)
{
struct pipe_context *pipe = ctx->pipe;
struct pipe_screen *screen = pipe->screen;
struct pipe_texture *tex = 0;
struct pipe_texture templ;
struct pipe_resource *tex = 0;
struct pipe_resource templ;
memset(&templ, 0, sizeof(templ));
templ.target = PIPE_TEXTURE_1D;
......@@ -74,18 +74,18 @@ static INLINE struct pipe_texture *create_texture_1d(struct vg_context *ctx,
templ.depth0 = 1;
templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
tex = screen->texture_create(screen, &templ);
tex = screen->resource_create(screen, &templ);
{ /* upload color_data */
struct pipe_transfer *transfer =
pipe->get_transfer(pipe, tex,
pipe_get_transfer(pipe, tex,
0, 0, 0,
PIPE_TRANSFER_READ_WRITE ,
0, 0, tex->width0, tex->height0);
void *map = pipe->transfer_map(pipe, transfer);
memcpy(map, color_data, sizeof(VGint)*color_data_len);
pipe->transfer_unmap(pipe, transfer);
pipe->tex_transfer_destroy(pipe, transfer);
pipe->transfer_destroy(pipe, transfer);
}
return tex;
......@@ -147,11 +147,11 @@ static void setup_constant_buffer(struct vg_context *ctx, const void *buffer,
VGint param_bytes)
{
struct pipe_context *pipe = ctx->pipe;
struct pipe_buffer **cbuf = &ctx->filter.buffer;
struct pipe_resource **cbuf = &ctx->filter.buffer;
/* We always need to get a new buffer, to keep the drivers simple and
* avoid gratuitous rendering synchronization. */
pipe_buffer_reference(cbuf, NULL);
pipe_resource_reference(cbuf, NULL);
*cbuf = pipe_buffer_create(pipe->screen, 16,
PIPE_BUFFER_USAGE_CONSTANT,
......@@ -168,7 +168,7 @@ static void setup_constant_buffer(struct vg_context *ctx, const void *buffer,
static void setup_samplers(struct vg_context *ctx, struct filter_info *info)
{
struct pipe_sampler_state *samplers[PIPE_MAX_SAMPLERS];
struct pipe_texture *textures[PIPE_MAX_SAMPLERS];
struct pipe_resource *textures[PIPE_MAX_SAMPLERS];
struct pipe_sampler_state sampler[3];
int num_samplers = 0;
int num_textures = 0;
......@@ -688,7 +688,7 @@ void vgLookup(VGImage dst, VGImage src,
struct vg_image *d, *s;
VGuint color_data[256];
VGint i;
struct pipe_texture *lut_texture;
struct pipe_resource *lut_texture;
VGfloat buffer[4];
struct filter_info info;
......@@ -732,7 +732,7 @@ void vgLookup(VGImage dst, VGImage src,
execute_filter(ctx, &info);
pipe_texture_reference(&lut_texture, NULL);
pipe_resource_reference(&lut_texture, NULL);
}
void vgLookupSingle(VGImage dst, VGImage src,
......@@ -743,7 +743,7 @@ void vgLookupSingle(VGImage dst, VGImage src,
{
struct vg_context *ctx = vg_current_context();
struct vg_image *d, *s;
struct pipe_texture *lut_texture;
struct pipe_resource *lut_texture;
VGfloat buffer[4];
struct filter_info info;
VGuint color_data[256];
......@@ -801,5 +801,5 @@ void vgLookupSingle(VGImage dst, VGImage src,
execute_filter(ctx, &info);
pipe_texture_reference(&lut_texture, NULL);
pipe_resource_reference(&lut_texture, NULL);
}
......@@ -441,9 +441,9 @@ void vgReadPixels(void * data, VGint dataStride,
{
struct pipe_transfer *transfer;
transfer = pipe->get_transfer(pipe, strb->texture, 0, 0, 0,
PIPE_TRANSFER_READ,
0, 0, width, height);
transfer = pipe_get_transfer(pipe, strb->texture, 0, 0, 0,
PIPE_TRANSFER_READ,
0, 0, width, height);
/* Do a row at a time to flip image data vertically */
for (i = 0; i < height; i++) {
......@@ -457,7 +457,7 @@ void vgReadPixels(void * data, VGint dataStride,
dst += dataStride;
}
pipe->tex_transfer_destroy(pipe, transfer);
pipe->transfer_destroy(pipe, transfer);
}
}
......
......@@ -51,7 +51,7 @@ draw_clear_quad(struct vg_context *st,
const VGfloat color[4])
{
struct pipe_context *pipe = st->pipe;
struct pipe_buffer *buf;
struct pipe_resource *buf;
VGuint i;
/* positions */
......@@ -81,7 +81,8 @@ draw_clear_quad(struct vg_context *st,
/* put vertex data into vbuf */
buf = pipe_user_buffer_create(pipe->screen,
st->clear.vertices,
sizeof(st->clear.vertices));
sizeof(st->clear.vertices),
PIPE_BUFFER_USAGE_VERTEX);
/* draw */
......@@ -93,7 +94,7 @@ draw_clear_quad(struct vg_context *st,
4, /* verts */
2); /* attribs/vert */
pipe_buffer_reference(&buf, NULL);
pipe_resource_reference(&buf, NULL);
}
}
......
......@@ -80,8 +80,8 @@ static INLINE void vg_sync_size(VGfloat *src_loc, VGfloat *dst_loc)
static void vg_copy_texture(struct vg_context *ctx,
struct pipe_texture *dst, VGint dx, VGint dy,
struct pipe_texture *src, VGint sx, VGint sy,
struct pipe_resource *dst, VGint dx, VGint dy,
struct pipe_resource *src, VGint sx, VGint sy,
VGint width, VGint height)
{
VGfloat dst_loc[4], src_loc[4];
......@@ -216,9 +216,9 @@ void vg_copy_surface(struct vg_context *ctx,
}
static struct pipe_texture *image_texture(struct vg_image *img)
static struct pipe_resource *image_texture(struct vg_image *img)
{
struct pipe_texture *tex = img->texture;
struct pipe_resource *tex = img->texture;
return tex;
}
......@@ -249,7 +249,7 @@ struct vg_image * image_create(VGImageFormat format,
struct vg_context *ctx = vg_current_context();
struct vg_image *image = CALLOC_STRUCT(vg_image);
enum pipe_format pformat = vg_format_to_pipe(format);
struct pipe_texture pt, *newtex;
struct pipe_resource pt, *newtex;
struct pipe_screen *screen = ctx->pipe->screen;
vg_init_object(&image->base, ctx, VG_OBJECT_IMAGE);
......@@ -277,7 +277,7 @@ struct vg_image * image_create(VGImageFormat format,
pt.depth0 = 1;
pt.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
newtex = screen->texture_create(screen, &pt);
newtex = screen->resource_create(screen, &pt);
debug_assert(newtex);
......@@ -345,7 +345,7 @@ void image_destroy(struct vg_image *img)
array_destroy(img->children_array);
}
pipe_texture_reference(&img->texture, NULL);
pipe_resource_reference(&img->texture, NULL);
free(img);
}
......@@ -379,7 +379,7 @@ void image_sub_data(struct vg_image *image,
VGint i;
struct vg_context *ctx = vg_current_context();
struct pipe_context *pipe = ctx->pipe;
struct pipe_texture *texture = image_texture(image);
struct pipe_resource *texture = image_texture(image);
VGint xoffset = 0, yoffset = 0;
if (x < 0) {
......@@ -412,7 +412,7 @@ void image_sub_data(struct vg_image *image,
}
{ /* upload color_data */
struct pipe_transfer *transfer = pipe->get_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);
......@@ -422,7 +422,7 @@ void image_sub_data(struct vg_image *image,
y += yStep;
src += dataStride;
}
pipe->tex_transfer_destroy(pipe, transfer);
pipe->transfer_destroy(pipe, transfer);
}
}
......@@ -443,7 +443,7 @@ void image_get_sub_data(struct vg_image * image,
{
struct pipe_transfer *transfer =
pipe->get_transfer(pipe,
pipe_get_transfer(pipe,
image->texture, 0, 0, 0,
PIPE_TRANSFER_READ,
0, 0,
......@@ -460,7 +460,7 @@ void image_get_sub_data(struct vg_image * image,
dst += dataStride;
}
pipe->tex_transfer_destroy(pipe, transfer);
pipe->transfer_destroy(pipe, transfer);
}
}
......@@ -479,7 +479,7 @@ struct vg_image * image_child_image(struct vg_image *parent,
image->height = height;
image->parent = parent;
image->texture = 0;
pipe_texture_reference(&image->texture,
pipe_resource_reference(&image->texture,
parent->texture);
image->sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
......@@ -624,7 +624,7 @@ VGboolean vg_image_overlaps(struct vg_image *dst,
}
VGint image_bind_samplers(struct vg_image *img, struct pipe_sampler_state **samplers,
struct pipe_texture **textures)
struct pipe_resource **textures)
{
img->sampler.min_img_filter = image_sampler_filter(img->base.ctx);
img->sampler.mag_img_filter = image_sampler_filter(img->base.ctx);
......
......@@ -30,7 +30,7 @@
#include "vg_context.h"
#include "pipe/p_state.h"
struct pipe_texture;
struct pipe_resource;
struct array;
struct vg_context;
struct pipe_surface;
......@@ -43,7 +43,7 @@ struct vg_image {
struct vg_image *parent;
struct pipe_texture *texture;
struct pipe_resource *texture;
struct pipe_sampler_state sampler;
struct array *children_array;
......@@ -89,7 +89,7 @@ void image_get_pixels(struct vg_image *dst, VGint dx, VGint dy,
VGint width, VGint height);
VGint image_bind_samplers(struct vg_image *dst, struct pipe_sampler_state **samplers,
struct pipe_texture **textures);
struct pipe_resource **textures);
VGboolean vg_image_overlaps(struct vg_image *dst,
struct vg_image *src);
......
......@@ -45,7 +45,7 @@ struct vg_mask_layer {
VGint width;
VGint height;
struct pipe_texture *texture;
struct pipe_resource *texture;
};
static INLINE struct pipe_surface *
......@@ -217,7 +217,7 @@ static void setup_mask_framebuffer(struct pipe_surface *surf,
static void setup_mask_operation(VGMaskOperation operation)
{
struct vg_context *ctx = vg_current_context();
struct pipe_buffer **cbuf = &ctx->mask.cbuf;
struct pipe_resource **cbuf = &ctx->mask.cbuf;
const VGint param_bytes = 4 * sizeof(VGfloat);
const VGfloat ones[4] = {1.f, 1.f, 1.f, 1.f};
void *shader = 0;
......@@ -225,7 +225,7 @@ static void setup_mask_operation(VGMaskOperation operation)
/* We always need to get a new buffer, to keep the drivers simple and
* avoid gratuitous rendering synchronization.
*/
pipe_buffer_reference(cbuf, NULL);
pipe_resource_reference(cbuf, NULL);
*cbuf = pipe_buffer_create(ctx->pipe->screen, 1,
PIPE_BUFFER_USAGE_CONSTANT,
......@@ -284,13 +284,13 @@ static void setup_mask_operation(VGMaskOperation operation)
cso_set_fragment_shader_handle(ctx->cso_context, shader);
}
static void setup_mask_samplers(struct pipe_texture *umask)
static void setup_mask_samplers(struct pipe_resource *umask)
{
struct vg_context *ctx = vg_current_context();
struct pipe_sampler_state *samplers[PIPE_MAX_SAMPLERS];
struct pipe_texture *textures[PIPE_MAX_SAMPLERS];
struct pipe_resource *textures[PIPE_MAX_SAMPLERS];
struct st_framebuffer *fb_buffers = ctx->draw_buffer;
struct pipe_texture *uprev = NULL;
struct pipe_resource *uprev = NULL;
struct pipe_sampler_state sampler;
uprev = fb_buffers->blend_texture;
......@@ -320,13 +320,13 @@ static void setup_mask_samplers(struct pipe_texture *umask)
static void setup_mask_fill(const VGfloat color[4])
{
struct vg_context *ctx = vg_current_context();
struct pipe_buffer **cbuf = &ctx->mask.cbuf;
struct pipe_resource **cbuf = &ctx->mask.cbuf;
const VGint param_bytes = 4 * sizeof(VGfloat);
/* We always need to get a new buffer, to keep the drivers simple and
* avoid gratuitous rendering synchronization.
*/
pipe_buffer_reference(cbuf, NULL);
pipe_resource_reference(cbuf, NULL);
*cbuf = pipe_buffer_create(ctx->pipe->screen, 1,
PIPE_BUFFER_USAGE_CONSTANT,
......@@ -411,7 +411,7 @@ static void surface_fill(struct pipe_surface *surf,
}
static void mask_using_texture(struct pipe_texture *texture,
static void mask_using_texture(struct pipe_resource *texture,
VGMaskOperation operation,
VGint x, VGint y,
VGint width, VGint height)
......@@ -483,7 +483,7 @@ struct vg_mask_layer * mask_layer_create(VGint width, VGint height)
mask->height = height;
{
struct pipe_texture pt;
struct pipe_resource pt;
struct pipe_screen *screen = ctx->pipe->screen;
memset(&pt, 0, sizeof(pt));
......@@ -496,7 +496,7 @@ struct vg_mask_layer * mask_layer_create(VGint width, VGint height)
pt.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
pt.compressed = 0;
mask->texture = screen->texture_create(screen, &pt);
mask->texture = screen->resource_create(screen, &pt);
}
vg_context_add_object(ctx, VG_OBJECT_MASK, mask);
......@@ -509,7 +509,7 @@ void mask_layer_destroy(struct vg_mask_layer *layer)
struct vg_context *ctx = vg_current_context();
vg_context_remove_object(ctx, VG_OBJECT_MASK, layer);
pipe_texture_release(&layer->texture);
pipe_resource_release(&layer->texture);
free(layer);
}
......@@ -672,7 +672,7 @@ void mask_fill(VGint x, VGint y, VGint width, VGint height,
}
VGint mask_bind_samplers(struct pipe_sampler_state **samplers,
struct pipe_texture **textures)
struct pipe_resource **textures)
{
struct vg_context *ctx = vg_current_context();
......
......@@ -31,7 +31,7 @@
struct path;
struct vg_image;
struct pipe_texture;
struct pipe_resource;
struct vg_mask_layer *mask_layer_create(VGint width, VGint height);
void mask_layer_destroy(struct vg_mask_layer *layer);
......@@ -63,6 +63,6 @@ void mask_fill(VGint x, VGint y,
VGfloat value);
VGint mask_bind_samplers(struct pipe_sampler_state **samplers,
struct pipe_texture **textures);
struct pipe_resource **textures);
#endif
......@@ -61,7 +61,7 @@ struct vg_paint {
VGfloat vals[5];
VGint valsi[5];
} radial;
struct pipe_texture *texture;
struct pipe_resource *texture;
struct pipe_sampler_state sampler;
VGfloat *ramp_stops;
......@@ -72,13 +72,13 @@ struct vg_paint {
} gradient;
struct {
struct pipe_texture *texture;
struct pipe_resource *texture;
VGTilingMode tiling_mode;
struct pipe_sampler_state sampler;
} pattern;
/* XXX next 3 all unneded? */
struct pipe_buffer *cbuf;
struct pipe_resource *cbuf;
struct pipe_shader_state fs_state;
void *fs;
};
......@@ -142,12 +142,12 @@ static INLINE void create_gradient_data(const VGfloat *ramp_stops,
data[size-1] = last_color;
}
static INLINE struct pipe_texture *create_gradient_texture(struct vg_paint *p)
static INLINE struct pipe_resource *create_gradient_texture(struct vg_paint *p)
{
struct pipe_context *pipe = p->base.ctx->pipe;
struct pipe_screen *screen = pipe->screen;
struct pipe_texture *tex = 0;
struct pipe_texture templ;
struct pipe_resource *tex = 0;
struct pipe_resource templ;
memset(&templ, 0, sizeof(templ));
templ.target = PIPE_TEXTURE_1D;
......@@ -158,7 +158,7 @@ static INLINE struct pipe_texture *create_gradient_texture(struct vg_paint *p)
templ.depth0 = 1;
templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
tex = screen->texture_create(screen, &templ);
tex = screen->resource_create(screen, &templ);
{ /* upload color_data */
struct pipe_transfer *transfer =
......@@ -167,7 +167,7 @@ static INLINE struct pipe_texture *create_gradient_texture(struct vg_paint *p)
void *map = pipe->transfer_map(pipe, transfer);
memcpy(map, p->gradient.color_data, sizeof(VGint)*1024);
pipe->transfer_unmap(pipe, transfer);
pipe->tex_transfer_destroy(pipe, transfer);
pipe->transfer_destroy(pipe, transfer);
}
return tex;
......@@ -208,7 +208,7 @@ void paint_destroy(struct vg_paint *paint)
{
struct vg_context *ctx = paint->base.ctx;
if (paint->pattern.texture)
pipe_texture_reference(&paint->pattern.texture, NULL);
pipe_resource_reference(&paint->pattern.texture, NULL);
if (ctx)
vg_context_remove_object(ctx, VG_OBJECT_PAINT, paint);
......@@ -395,7 +395,7 @@ void paint_set_ramp_stops(struct vg_paint *paint, const VGfloat *stops,
1024);
if (paint->gradient.texture) {
pipe_texture_reference(&paint->gradient.texture, NULL);
pipe_resource_reference(&paint->gradient.texture, NULL);
paint->gradient.texture = 0;
}
......@@ -460,10 +460,10 @@ void paint_set_pattern(struct vg_paint *paint,
struct vg_image *img)
{
if (paint->pattern.texture)
pipe_texture_reference(&paint->pattern.texture, NULL);
pipe_resource_reference(&paint->pattern.texture, NULL);
paint->pattern.texture = 0;
pipe_texture_reference(&paint->pattern.texture,
pipe_resource_reference(&paint->pattern.texture,
img->texture);
}
......@@ -611,7 +611,7 @@ VGTilingMode paint_pattern_tiling(struct vg_paint *paint)
}
VGint paint_bind_samplers(struct vg_paint *paint, struct pipe_sampler_state **samplers,
struct pipe_texture **textures)
struct pipe_resource **textures)
{
struct vg_context *ctx = vg_current_context();
......
......@@ -35,7 +35,7 @@
struct vg_paint;
struct vg_image;
struct pipe_sampler_state;
struct pipe_texture;
struct pipe_resource;
struct vg_paint *paint_create(struct vg_context *ctx);
void paint_destroy(struct vg_paint *paint);
......@@ -108,7 +108,7 @@ VGboolean paint_color_ramp_premultiplied(struct vg_paint *paint);
VGint paint_bind_samplers(struct vg_paint *paint, struct pipe_sampler_state **samplers,
struct pipe_texture **textures);
struct pipe_resource **textures);
VGint paint_constant_buffer_size(struct vg_paint *paint);
void paint_fill_constant_buffer(struct vg_paint *paint,
......
......@@ -58,7 +58,7 @@ struct polygon
VGint num_verts;
VGboolean dirty;
struct pipe_buffer *vbuf;
struct pipe_resource *vbuf;
struct pipe_screen *screen;
};
......@@ -110,7 +110,7 @@ struct polygon * polygon_create_from_data(float *data, int size)
void polygon_destroy(struct polygon *poly)
{
if (poly->vbuf)
pipe_buffer_reference(&poly->vbuf, NULL);
pipe_resource_reference(&poly->vbuf, NULL);
free(poly->data);
free(poly);
......@@ -272,13 +272,14 @@ static void draw_polygon(struct vg_context *ctx,
if (poly->vbuf == NULL || poly->dirty) {
if (poly->vbuf) {
pipe_buffer_reference(&poly->vbuf,
pipe_resource_reference(&poly->vbuf,
NULL);
}
poly->screen = pipe->screen;
poly->vbuf= pipe_user_buffer_create(poly->screen,
poly->data,
vert_size);
vert_size,
PIPE_BUFFER_USAGE_VERTEX);
poly->dirty = VG_FALSE;
}
......
......@@ -60,7 +60,7 @@ static void setup_shaders(struct renderer *ctx)
ctx->fs = util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_2D);
}
static struct pipe_buffer *
static struct pipe_resource *
setup_vertex_data(struct renderer *ctx,
float x0, float y0, float x1, float y1, float z)
{
......@@ -90,10 +90,11 @@ setup_vertex_data(struct renderer *ctx,
return pipe_user_buffer_create( ctx->pipe->screen,
ctx->vertices,
sizeof(ctx->vertices) );
sizeof(ctx->vertices),
PIPE_BUFFER_USAGE_VERTEX);
}
static struct pipe_buffer *
static struct pipe_resource *
setup_vertex_data_tex(struct renderer *ctx,
float x0, float y0, float x1, float y1,
float s0, float t0, float s1, float t1,
......@@ -125,11 +126,12 @@ setup_vertex_data_tex(struct renderer *ctx,
return pipe_user_buffer_create( ctx->pipe->screen,
ctx->vertices,
sizeof(ctx->vertices) );
sizeof(ctx->vertices),
PIPE_BUFFER_USAGE_VERTEX);
}
static struct pipe_buffer *
static struct pipe_resource *
setup_vertex_data_qtex(struct renderer *ctx,
float x0, float y0, float x1, float y1,
float x2, float y2, float x3, float y3,
......@@ -162,7 +164,8 @@ setup_vertex_data_qtex(struct renderer *ctx,
return pipe_user_buffer_create( ctx->pipe->screen,
ctx->vertices,
sizeof(ctx->vertices) );
sizeof(ctx->vertices),
PIPE_BUFFER_USAGE_VERTEX);
}
struct renderer * renderer_create(struct vg_context *owner)
......@@ -205,7 +208,7 @@ void renderer_draw_quad(struct renderer *r,
VGfloat x2, VGfloat y2,
VGfloat depth)
{
struct pipe_buffer *buf;
struct pipe_resource *buf;
buf = setup_vertex_data(r, x1, y1, x2, y2, depth);
......@@ -216,20 +219,20 @@ void renderer_draw_quad(struct renderer *r,
4, /* verts */
2); /* attribs/vert */
pipe_buffer_reference( &buf,
pipe_resource_reference( &buf,
NULL );
}
}
void renderer_draw_texture(struct renderer *r,
struct pipe_texture *tex,
struct pipe_resource *tex,
VGfloat x1offset, VGfloat y1offset,
VGfloat x2offset, VGfloat y2offset,
VGfloat x1, VGfloat y1,
VGfloat x2, VGfloat y2)
{
struct pipe_context *pipe = r->pipe;
struct pipe_buffer *buf;
struct pipe_resource *buf;
VGfloat s0, t0, s1, t1;
assert(tex->width0 != 0);
......@@ -255,7 +258,7 @@ void renderer_draw_texture(struct renderer *r,
4, /* verts */
2); /* attribs/vert */
pipe_buffer_reference( &buf,
pipe_resource_reference( &buf,
NULL );
}
......@@ -263,16 +266,16 @@ void renderer_draw_texture(struct renderer *r,
}
void renderer_copy_texture(struct renderer *ctx,
struct pipe_texture *src,
struct pipe_resource *src,
VGfloat sx1, VGfloat sy1,
VGfloat sx2, VGfloat sy2,
struct pipe_texture *dst,
struct pipe_resource *dst,
VGfloat dx1, VGfloat dy1,
VGfloat dx2, VGfloat dy2)
{
struct pipe_context *pipe = ctx->pipe;
struct pipe_screen *screen = pipe->screen;
struct pipe_buffer *buf;
struct pipe_resource *buf;
struct pipe_surface *dst_surf = screen->get_tex_surface(
screen, dst, 0, 0, 0,
PIPE_BUFFER_USAGE_GPU_WRITE);
......@@ -378,7 +381,7 @@ void renderer_copy_texture(struct renderer *ctx,
4, /* verts */
2); /* attribs/vert */
pipe_buffer_reference( &buf,
pipe_resource_reference( &buf,
NULL );
}
......@@ -405,8 +408,8 @@ void renderer_copy_surface(struct renderer *ctx,
{
struct pipe_context *pipe = ctx->pipe;
struct pipe_screen *screen = pipe->screen;
struct pipe_buffer *buf;
struct pipe_texture texTemp, *tex;
struct pipe_resource *buf;
struct pipe_resource texTemp, *tex;
struct pipe_surface *texSurf;
struct pipe_framebuffer_state fb;
struct st_framebuffer *stfb = ctx->owner->draw_buffer;
......@@ -453,7 +456,7 @@ void renderer_copy_surface(struct renderer *ctx,
texTemp.height0 = srcH;
texTemp.depth0 = 1;
tex = screen->texture_create(screen, &texTemp);
tex = screen->resource_create(screen, &texTemp);
if (!tex)
return;
......@@ -544,7 +547,7 @@ void renderer_copy_surface(struct renderer *ctx,
4, /* verts */
2); /* attribs/vert */
pipe_buffer_reference( &buf,
pipe_resource_reference( &buf,
NULL );
}
......@@ -558,11 +561,11 @@ void renderer_copy_surface(struct renderer *ctx,
cso_restore_vertex_shader(ctx->cso);
cso_restore_viewport(ctx->cso);
pipe_texture_reference(&tex, NULL);
pipe_resource_reference(&tex, NULL);
}
void renderer_texture_quad(struct renderer *r,
struct pipe_texture *tex,
struct pipe_resource *tex,
VGfloat x1offset, VGfloat y1offset,
VGfloat x2offset, VGfloat y2offset,
VGfloat x1, VGfloat y1,
......@@ -571,7 +574,7 @@ void renderer_texture_quad(struct renderer *r,
VGfloat x4, VGfloat y4)
{
struct pipe_context *pipe = r->pipe;
struct pipe_buffer *buf;
struct pipe_resource *buf;
VGfloat s0, t0, s1, t1;
assert(tex->width0 != 0);
......@@ -597,7 +600,7 @@ void renderer_texture_quad(struct renderer *r,
4, /* verts */
2); /* attribs/vert */
pipe_buffer_reference(&buf,
pipe_resource_reference(&buf,
NULL);
}
......