summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/noop
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/noop')
-rw-r--r--src/gallium/drivers/noop/noop_pipe.c59
-rw-r--r--src/gallium/drivers/noop/noop_state.c32
2 files changed, 44 insertions, 47 deletions
diff --git a/src/gallium/drivers/noop/noop_pipe.c b/src/gallium/drivers/noop/noop_pipe.c
index fb5cdb4609..c9c463f470 100644
--- a/src/gallium/drivers/noop/noop_pipe.c
+++ b/src/gallium/drivers/noop/noop_pipe.c
@@ -83,7 +83,7 @@ struct noop_resource {
static unsigned noop_is_resource_referenced(struct pipe_context *pipe,
struct pipe_resource *resource,
- unsigned face, unsigned level)
+ unsigned level, int layer)
{
return PIPE_UNREFERENCED;
}
@@ -193,7 +193,7 @@ static struct pipe_resource *noop_user_buffer_create(struct pipe_screen *screen,
*/
static struct pipe_transfer *noop_get_transfer(struct pipe_context *context,
struct pipe_resource *resource,
- struct pipe_subresource sr,
+ unsigned level,
enum pipe_transfer_usage usage,
const struct pipe_box *box)
{
@@ -203,11 +203,11 @@ static struct pipe_transfer *noop_get_transfer(struct pipe_context *context,
if (transfer == NULL)
return NULL;
pipe_resource_reference(&transfer->resource, resource);
- transfer->sr = sr;
+ transfer->level = level;
transfer->usage = usage;
transfer->box = *box;
transfer->stride = 1;
- transfer->slice_stride = 1;
+ transfer->layer_stride = 1;
return transfer;
}
@@ -239,12 +239,12 @@ static void noop_transfer_destroy(struct pipe_context *pipe,
static void noop_transfer_inline_write(struct pipe_context *pipe,
struct pipe_resource *resource,
- struct pipe_subresource sr,
+ unsigned level,
unsigned usage,
const struct pipe_box *box,
const void *data,
unsigned stride,
- unsigned slice_stride)
+ unsigned layer_stride)
{
}
@@ -277,12 +277,11 @@ static void noop_clear_depth_stencil(struct pipe_context *ctx,
static void noop_resource_copy_region(struct pipe_context *ctx,
struct pipe_resource *dst,
- struct pipe_subresource subdst,
+ unsigned dst_level,
unsigned dstx, unsigned dsty, unsigned dstz,
struct pipe_resource *src,
- struct pipe_subresource subsrc,
- unsigned srcx, unsigned srcy, unsigned srcz,
- unsigned width, unsigned height)
+ unsigned src_level,
+ const struct pipe_box *src_box)
{
}
@@ -332,46 +331,14 @@ static struct pipe_context *noop_create_context(struct pipe_screen *screen, void
return ctx;
}
-/*
- * texture
- */
-static struct pipe_surface *noop_get_tex_surface(struct pipe_screen *screen,
- struct pipe_resource *texture,
- unsigned face, unsigned level,
- unsigned zslice, unsigned flags)
-{
- struct pipe_surface *surface = CALLOC_STRUCT(pipe_surface);
-
- if (surface == NULL)
- return NULL;
- pipe_reference_init(&surface->reference, 1);
- pipe_resource_reference(&surface->texture, texture);
- surface->format = texture->format;
- surface->width = texture->width0;
- surface->height = texture->height0;
- surface->offset = 0;
- surface->usage = flags;
- surface->zslice = zslice;
- surface->texture = texture;
- surface->face = face;
- surface->level = level;
-
- return surface;
-}
-
-static void noop_tex_surface_destroy(struct pipe_surface *surface)
-{
- pipe_resource_reference(&surface->texture, NULL);
- FREE(surface);
-}
-
/*
* pipe_screen
*/
static void noop_flush_frontbuffer(struct pipe_screen *_screen,
- struct pipe_surface *surface,
- void *context_private)
+ struct pipe_resource *resource,
+ unsigned level, unsigned layer,
+ void *context_private)
{
}
@@ -537,8 +504,6 @@ struct pipe_screen *noop_screen_create(struct sw_winsys *winsys)
screen->get_paramf = noop_get_paramf;
screen->is_format_supported = noop_is_format_supported;
screen->context_create = noop_create_context;
- screen->get_tex_surface = noop_get_tex_surface;
- screen->tex_surface_destroy = noop_tex_surface_destroy;
screen->resource_create = noop_resource_create;
screen->resource_from_handle = noop_resource_from_handle;
screen->resource_get_handle = noop_resource_get_handle;
diff --git a/src/gallium/drivers/noop/noop_state.c b/src/gallium/drivers/noop/noop_state.c
index 048ed42a9b..5c62fc12d8 100644
--- a/src/gallium/drivers/noop/noop_state.c
+++ b/src/gallium/drivers/noop/noop_state.c
@@ -101,6 +101,28 @@ static struct pipe_sampler_view *noop_create_sampler_view(struct pipe_context *c
return sampler_view;
}
+static struct pipe_surface *noop_create_surface(struct pipe_context *ctx,
+ struct pipe_resource *texture,
+ const struct pipe_surface *surf_tmpl)
+{
+ struct pipe_surface *surface = CALLOC_STRUCT(pipe_surface);
+
+ if (surface == NULL)
+ return NULL;
+ pipe_reference_init(&surface->reference, 1);
+ pipe_resource_reference(&surface->texture, texture);
+ surface->context = ctx;
+ surface->format = surf_tmpl->format;
+ surface->width = texture->width0;
+ surface->height = texture->height0;
+ surface->usage = surf_tmpl->usage;
+ surface->texture = texture;
+ surface->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
+ surface->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
+ surface->u.tex.level = surf_tmpl->u.tex.level;
+
+ return surface;
+}
static void noop_set_vs_sampler_view(struct pipe_context *ctx, unsigned count,
struct pipe_sampler_view **views)
{
@@ -163,6 +185,14 @@ static void noop_sampler_view_destroy(struct pipe_context *ctx,
FREE(state);
}
+
+static void noop_surface_destroy(struct pipe_context *ctx,
+ struct pipe_surface *surface)
+{
+ pipe_resource_reference(&surface->texture, NULL);
+ FREE(surface);
+}
+
static void noop_bind_state(struct pipe_context *ctx, void *state)
{
}
@@ -221,6 +251,7 @@ void noop_init_state_functions(struct pipe_context *ctx)
ctx->create_rasterizer_state = noop_create_rs_state;
ctx->create_sampler_state = noop_create_sampler_state;
ctx->create_sampler_view = noop_create_sampler_view;
+ ctx->create_surface = noop_create_surface;
ctx->create_vertex_elements_state = noop_create_vertex_elements;
ctx->create_vs_state = noop_create_shader_state;
ctx->bind_blend_state = noop_bind_state;
@@ -252,5 +283,6 @@ void noop_init_state_functions(struct pipe_context *ctx)
ctx->set_vertex_sampler_views = noop_set_vs_sampler_view;
ctx->set_viewport_state = noop_set_viewport_state;
ctx->sampler_view_destroy = noop_sampler_view_destroy;
+ ctx->surface_destroy = noop_surface_destroy;
ctx->draw_vbo = noop_draw_vbo;
}