diff options
author | Marek Olšák <[email protected]> | 2012-12-08 15:37:17 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-12-12 13:09:54 +0100 |
commit | 25409c6da8163d9acb386511aef0c11577c7aadb (patch) | |
tree | da38c5f59a9703c6feb89d9fac3a6c615a3bebc0 /src/gallium/auxiliary/util | |
parent | c1f704073b8992f3556c8e44a7fc496e250ba3ae (diff) |
gallium: remove pipe_surface::usage
Not really used by anybody now.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_blitter.c | 7 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_debug.c | 3 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_dump_state.c | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_gen_mipmap.c | 5 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_inlines.h | 9 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_surface.c | 7 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_surface.h | 3 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_surfaces.c | 4 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_surfaces.h | 6 |
9 files changed, 13 insertions, 33 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index e7baf3af767..49f01dec1ba 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -1083,12 +1083,6 @@ void util_blitter_default_dst_texture(struct pipe_surface *dst_templ, const struct pipe_box *srcbox) { memset(dst_templ, 0, sizeof(*dst_templ)); - dst_templ->format = dst->format; - if (util_format_is_depth_or_stencil(dst->format)) { - dst_templ->usage = PIPE_BIND_DEPTH_STENCIL; - } else { - dst_templ->usage = PIPE_BIND_RENDER_TARGET; - } dst_templ->format = util_format_linear(dst->format); dst_templ->u.tex.level = dstlevel; dst_templ->u.tex.first_layer = dstz; @@ -1743,7 +1737,6 @@ void util_blitter_custom_resolve_color(struct blitter_context *blitter, surf_tmpl.u.tex.level = dst_level; surf_tmpl.u.tex.first_layer = dst_layer; surf_tmpl.u.tex.last_layer = dst_layer; - surf_tmpl.usage = PIPE_BIND_RENDER_TARGET; dstsurf = pipe->create_surface(pipe, dst, &surf_tmpl); diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index ee97b7adb81..ce472b0204e 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -537,8 +537,7 @@ void debug_dump_texture(struct pipe_context *pipe, return; /* XXX for now, just dump image for layer=0, level=0 */ - memset(&surf_tmpl, 0, sizeof(surf_tmpl)); - u_surface_default_template(&surf_tmpl, texture, 0 /* no bind flag - not a surface */); + u_surface_default_template(&surf_tmpl, texture); surface = pipe->create_surface(pipe, texture, &surf_tmpl); if (surface) { debug_dump_surface(pipe, prefix, surface); diff --git a/src/gallium/auxiliary/util/u_dump_state.c b/src/gallium/auxiliary/util/u_dump_state.c index f5d8b437399..09faffe73f3 100644 --- a/src/gallium/auxiliary/util/u_dump_state.c +++ b/src/gallium/auxiliary/util/u_dump_state.c @@ -661,8 +661,6 @@ util_dump_surface(FILE *stream, const struct pipe_surface *state) util_dump_member(stream, uint, state, width); util_dump_member(stream, uint, state, height); - util_dump_member(stream, uint, state, usage); - util_dump_member(stream, ptr, state, texture); util_dump_member(stream, uint, state, u.tex.level); util_dump_member(stream, uint, state, u.tex.first_layer); diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 90588a022df..e1f18f39c05 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -1617,10 +1617,7 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, } else layer = face; - memset(&surf_templ, 0, sizeof(surf_templ)); - u_surface_default_template(&surf_templ, pt, - is_depth ? PIPE_BIND_DEPTH_STENCIL : - PIPE_BIND_RENDER_TARGET); + u_surface_default_template(&surf_templ, pt); surf_templ.u.tex.level = dstLevel; surf_templ.u.tex.first_layer = layer; surf_templ.u.tex.last_layer = layer; diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index 469f95461fa..582aacdca1e 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -188,14 +188,12 @@ pipe_so_target_reference(struct pipe_stream_output_target **ptr, static INLINE void pipe_surface_reset(struct pipe_context *ctx, struct pipe_surface* ps, - struct pipe_resource *pt, unsigned level, unsigned layer, - unsigned flags) + struct pipe_resource *pt, unsigned level, unsigned layer) { pipe_resource_reference(&ps->texture, pt); ps->format = pt->format; ps->width = u_minify(pt->width0, level); ps->height = u_minify(pt->height0, level); - ps->usage = flags; ps->u.tex.level = level; ps->u.tex.first_layer = ps->u.tex.last_layer = layer; ps->context = ctx; @@ -203,12 +201,11 @@ pipe_surface_reset(struct pipe_context *ctx, struct pipe_surface* ps, static INLINE void pipe_surface_init(struct pipe_context *ctx, struct pipe_surface* ps, - struct pipe_resource *pt, unsigned level, unsigned layer, - unsigned flags) + struct pipe_resource *pt, unsigned level, unsigned layer) { ps->texture = 0; pipe_reference_init(&ps->reference, 1); - pipe_surface_reset(ctx, ps, pt, level, layer, flags); + pipe_surface_reset(ctx, ps, pt, level, layer); } /* Return true if the surfaces are equal. */ diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c index bef002902ad..5e771c95095 100644 --- a/src/gallium/auxiliary/util/u_surface.c +++ b/src/gallium/auxiliary/util/u_surface.c @@ -49,14 +49,11 @@ */ void u_surface_default_template(struct pipe_surface *surf, - const struct pipe_resource *texture, - unsigned bind) + const struct pipe_resource *texture) { memset(surf, 0, sizeof(*surf)); surf->format = texture->format; - /* XXX should filter out all non-rt/ds bind flags ? */ - surf->usage = bind; } /** @@ -110,7 +107,7 @@ util_create_rgba_texture(struct pipe_context *pipe, return FALSE; /* create surface */ - u_surface_default_template(&surf_templ, *textureOut, bind); + u_surface_default_template(&surf_templ, *textureOut); return TRUE; } diff --git a/src/gallium/auxiliary/util/u_surface.h b/src/gallium/auxiliary/util/u_surface.h index a39f677bdfc..fe950c818e3 100644 --- a/src/gallium/auxiliary/util/u_surface.h +++ b/src/gallium/auxiliary/util/u_surface.h @@ -42,8 +42,7 @@ extern "C" { extern void u_surface_default_template(struct pipe_surface *view, - const struct pipe_resource *texture, - unsigned bind); + const struct pipe_resource *texture); extern boolean util_create_rgba_texture(struct pipe_context *ctx, diff --git a/src/gallium/auxiliary/util/u_surfaces.c b/src/gallium/auxiliary/util/u_surfaces.c index b0cfec2a826..c2f2b74c939 100644 --- a/src/gallium/auxiliary/util/u_surfaces.c +++ b/src/gallium/auxiliary/util/u_surfaces.c @@ -32,7 +32,7 @@ boolean util_surfaces_do_get(struct util_surfaces *us, unsigned surface_struct_size, struct pipe_context *ctx, struct pipe_resource *pt, - unsigned level, unsigned layer, unsigned flags, + unsigned level, unsigned layer, struct pipe_surface **res) { struct pipe_surface *ps; @@ -65,7 +65,7 @@ util_surfaces_do_get(struct util_surfaces *us, unsigned surface_struct_size, return FALSE; } - pipe_surface_init(ctx, ps, pt, level, layer, flags); + pipe_surface_init(ctx, ps, pt, level, layer); if(pt->target == PIPE_TEXTURE_3D || pt->target == PIPE_TEXTURE_CUBE) cso_hash_insert(us->u.hash, (layer << 8) | level, ps); diff --git a/src/gallium/auxiliary/util/u_surfaces.h b/src/gallium/auxiliary/util/u_surfaces.h index 9581feda7c8..1605215cb88 100644 --- a/src/gallium/auxiliary/util/u_surfaces.h +++ b/src/gallium/auxiliary/util/u_surfaces.h @@ -46,14 +46,14 @@ struct util_surfaces boolean util_surfaces_do_get(struct util_surfaces *us, unsigned surface_struct_size, struct pipe_context *ctx, struct pipe_resource *pt, - unsigned level, unsigned layer, unsigned flags, + unsigned level, unsigned layer, struct pipe_surface **res); /* fast inline path for the very common case */ static INLINE boolean util_surfaces_get(struct util_surfaces *us, unsigned surface_struct_size, struct pipe_context *ctx, struct pipe_resource *pt, - unsigned level, unsigned layer, unsigned flags, + unsigned level, unsigned layer, struct pipe_surface **res) { if(likely((pt->target == PIPE_TEXTURE_2D || pt->target == PIPE_TEXTURE_RECT) && us->u.array)) @@ -67,7 +67,7 @@ util_surfaces_get(struct util_surfaces *us, unsigned surface_struct_size, } } - return util_surfaces_do_get(us, surface_struct_size, ctx, pt, level, layer, flags, res); + return util_surfaces_do_get(us, surface_struct_size, ctx, pt, level, layer, res); } static INLINE struct pipe_surface * |