Commit 437ce98d authored by Keith Whitwell's avatar Keith Whitwell

st/python: begin conversion to pipe_resources, much more to do

parent 1b02e1ee
......@@ -128,7 +128,7 @@ st_context_destroy(struct st_context *st_ctx)
pipe_sampler_view_reference(&st_ctx->fragment_sampler_views[i], NULL);
for(i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; ++i)
pipe_sampler_view_reference(&st_ctx->vertex_sampler_views[i], NULL);
pipe_texture_reference(&st_ctx->default_texture, NULL);
pipe_resource_reference(&st_ctx->default_texture, NULL);
FREE(st_ctx);
......@@ -229,8 +229,7 @@ st_context_create(struct st_device *st_dev)
/* default textures */
{
struct pipe_screen *screen = st_dev->screen;
struct pipe_texture templat;
struct pipe_transfer *transfer;
struct pipe_resource templat;
struct pipe_sampler_view view_templ;
struct pipe_sampler_view *view;
unsigned i;
......@@ -243,26 +242,23 @@ st_context_create(struct st_device *st_dev)
templat.depth0 = 1;
templat.last_level = 0;
st_ctx->default_texture = screen->texture_create( screen, &templat );
st_ctx->default_texture = screen->resource_create( screen, &templat );
if(st_ctx->default_texture) {
transfer = screen->get_transfer(screen,
st_ctx->default_texture,
0, 0, 0,
PIPE_TRANSFER_WRITE,
0, 0,
st_ctx->default_texture->width0,
st_ctx->default_texture->height0);
if (transfer) {
uint32_t *map;
map = (uint32_t *) screen->transfer_map(screen, transfer);
if(map) {
*map = 0x00000000;
screen->transfer_unmap(screen, transfer);
}
screen->tex_transfer_destroy(transfer);
}
struct pipe_box box;
uint32_t zero = 0;
u_box_wh( 1, 1, &box );
st_ctx->pipe->transfer_inline_write(st_ctx->pipe,
st_ctx->default_texture,
u_subresource(0,0),
PIPE_TRANSFER_WRITE,
&box,
&zero,
sizeof zero,
0);
}
u_sampler_view_default_template(&view_templ,
st_ctx->default_texture,
st_ctx->default_texture->format);
......
......@@ -40,7 +40,7 @@ struct st_winsys;
struct st_surface
{
struct pipe_texture *texture;
struct pipe_resource *texture;
unsigned face;
unsigned level;
unsigned zslice;
......@@ -59,7 +59,7 @@ struct st_context
void *fs;
void *gs;
struct pipe_texture *default_texture;
struct pipe_resource *default_texture;
struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_VERTEX_SAMPLERS];
......@@ -85,7 +85,7 @@ struct st_device
static INLINE struct pipe_surface *
st_pipe_surface(struct st_surface *surface, unsigned usage)
{
struct pipe_texture *texture = surface->texture;
struct pipe_resource *texture = surface->texture;
struct pipe_screen *screen = texture->screen;
return screen->get_tex_surface(screen, texture, surface->face, surface->level, surface->zslice, usage);
}
......
......@@ -525,7 +525,7 @@ st_sample_pixel_block(enum pipe_format format,
void
st_sample_surface(struct st_surface *surface, float *rgba)
{
struct pipe_texture *texture = surface->texture;
struct pipe_resource *texture = surface->texture;
struct pipe_screen *screen = texture->screen;
unsigned width = u_minify(texture->width0, surface->level);
unsigned height = u_minify(texture->height0, surface->level);
......@@ -570,5 +570,5 @@ st_sample_surface(struct st_surface *surface, float *rgba)
screen->transfer_unmap(screen, transfer);
}
screen->tex_transfer_destroy(transfer);
screen->transfer_destroy(transfer);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment