summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/auxiliary/postprocess/pp_init.c4
-rw-r--r--src/gallium/auxiliary/postprocess/pp_program.c1
-rw-r--r--src/gallium/auxiliary/postprocess/pp_run.c1
-rw-r--r--src/gallium/auxiliary/util/u_blitter.c7
-rw-r--r--src/gallium/auxiliary/util/u_debug.c3
-rw-r--r--src/gallium/auxiliary/util/u_dump_state.c2
-rw-r--r--src/gallium/auxiliary/util/u_gen_mipmap.c5
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h9
-rw-r--r--src/gallium/auxiliary/util/u_surface.c7
-rw-r--r--src/gallium/auxiliary/util/u_surface.h3
-rw-r--r--src/gallium/auxiliary/util/u_surfaces.c4
-rw-r--r--src/gallium/auxiliary/util/u_surfaces.h6
-rw-r--r--src/gallium/auxiliary/vl/vl_idct.c2
-rw-r--r--src/gallium/auxiliary/vl/vl_video_buffer.c1
-rw-r--r--src/gallium/drivers/i915/i915_surface.c1
-rw-r--r--src/gallium/drivers/llvmpipe/lp_texture.c1
-rw-r--r--src/gallium/drivers/noop/noop_state.c1
-rw-r--r--src/gallium/drivers/nouveau/nouveau_video.c1
-rw-r--r--src/gallium/drivers/nv30/nv30_miptree.c1
-rw-r--r--src/gallium/drivers/nv50/nv50_miptree.c1
-rw-r--r--src/gallium/drivers/nv50/nv50_resource.c1
-rw-r--r--src/gallium/drivers/nv50/nv50_surface.c1
-rw-r--r--src/gallium/drivers/nvc0/nvc0_surface.c1
-rw-r--r--src/gallium/drivers/r300/r300_texture.c1
-rw-r--r--src/gallium/drivers/r600/evergreen_compute_internal.c1
-rw-r--r--src/gallium/drivers/r600/r600_blit.c4
-rw-r--r--src/gallium/drivers/r600/r600_texture.c1
-rw-r--r--src/gallium/drivers/radeonsi/r600_blit.c2
-rw-r--r--src/gallium/drivers/radeonsi/r600_texture.c1
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c1
-rw-r--r--src/gallium/drivers/svga/svga_surface.c1
-rw-r--r--src/gallium/drivers/trace/tr_dump_state.c2
-rw-r--r--src/gallium/include/pipe/p_state.h1
-rw-r--r--src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp1
-rw-r--r--src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h2
-rw-r--r--src/gallium/state_trackers/vdpau/output.c1
-rw-r--r--src/gallium/state_trackers/vdpau/presentation.c1
-rw-r--r--src/gallium/state_trackers/vega/image.c10
-rw-r--r--src/gallium/state_trackers/vega/mask.c6
-rw-r--r--src/gallium/state_trackers/vega/renderer.c3
-rw-r--r--src/gallium/state_trackers/vega/vg_context.c8
-rw-r--r--src/gallium/state_trackers/vega/vg_manager.c4
-rw-r--r--src/gallium/state_trackers/xa/xa_context.c3
-rw-r--r--src/gallium/state_trackers/xorg/xorg_exa.c4
-rw-r--r--src/gallium/state_trackers/xvmc/surface.c1
-rw-r--r--src/gallium/tests/graw/clear.c1
-rw-r--r--src/gallium/tests/graw/fs-test.c1
-rw-r--r--src/gallium/tests/graw/graw_util.h2
-rw-r--r--src/gallium/tests/graw/gs-test.c1
-rw-r--r--src/gallium/tests/graw/quad-sample.c1
-rw-r--r--src/gallium/tests/graw/shader-leak.c1
-rw-r--r--src/gallium/tests/graw/tri-gs.c1
-rw-r--r--src/gallium/tests/graw/tri-instanced.c1
-rw-r--r--src/gallium/tests/graw/vs-test.c1
-rw-r--r--src/gallium/tests/trivial/quad-tex.c1
-rw-r--r--src/gallium/tests/trivial/tri.c1
-rw-r--r--src/mesa/state_tracker/st_atom_framebuffer.c1
-rw-r--r--src/mesa/state_tracker/st_cb_eglimage.c8
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c3
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c1
-rw-r--r--src/mesa/state_tracker/st_manager.c8
-rw-r--r--src/mesa/state_tracker/st_manager.h3
62 files changed, 33 insertions, 126 deletions
diff --git a/src/gallium/auxiliary/postprocess/pp_init.c b/src/gallium/auxiliary/postprocess/pp_init.c
index e059be6e9bc..d9552736f00 100644
--- a/src/gallium/auxiliary/postprocess/pp_init.c
+++ b/src/gallium/auxiliary/postprocess/pp_init.c
@@ -213,7 +213,7 @@ pp_init_fbos(struct pp_queue_t *ppq, unsigned int w,
tmp_res.depth0 = 1;
tmp_res.array_size = 1;
tmp_res.last_level = 0;
- tmp_res.bind = p->surf.usage = PIPE_BIND_RENDER_TARGET;
+ tmp_res.bind = PIPE_BIND_RENDER_TARGET;
if (!p->screen->is_format_supported(p->screen, tmp_res.format,
tmp_res.target, 1, tmp_res.bind))
@@ -237,7 +237,7 @@ pp_init_fbos(struct pp_queue_t *ppq, unsigned int w,
goto error;
}
- tmp_res.bind = p->surf.usage = PIPE_BIND_DEPTH_STENCIL;
+ tmp_res.bind = PIPE_BIND_DEPTH_STENCIL;
tmp_res.format = p->surf.format = PIPE_FORMAT_S8_UINT_Z24_UNORM;
diff --git a/src/gallium/auxiliary/postprocess/pp_program.c b/src/gallium/auxiliary/postprocess/pp_program.c
index c25078df6f1..7044e3453df 100644
--- a/src/gallium/auxiliary/postprocess/pp_program.c
+++ b/src/gallium/auxiliary/postprocess/pp_program.c
@@ -133,7 +133,6 @@ pp_init_prog(struct pp_queue_t *ppq, struct pipe_context *pipe,
p->framebuffer.nr_cbufs = 1;
- p->surf.usage = PIPE_BIND_RENDER_TARGET;
p->surf.format = PIPE_FORMAT_B8G8R8A8_UNORM;
return p;
diff --git a/src/gallium/auxiliary/postprocess/pp_run.c b/src/gallium/auxiliary/postprocess/pp_run.c
index 112458f384e..0bed547bd44 100644
--- a/src/gallium/auxiliary/postprocess/pp_run.c
+++ b/src/gallium/auxiliary/postprocess/pp_run.c
@@ -166,7 +166,6 @@ void
pp_filter_setup_out(struct program *p, struct pipe_resource *out)
{
p->surf.format = out->format;
- p->surf.usage = PIPE_BIND_RENDER_TARGET;
p->framebuffer.cbufs[0] = p->pipe->create_surface(p->pipe, out, &p->surf);
}
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 *
diff --git a/src/gallium/auxiliary/vl/vl_idct.c b/src/gallium/auxiliary/vl/vl_idct.c
index 5adc72f7db6..a0c243f809a 100644
--- a/src/gallium/auxiliary/vl/vl_idct.c
+++ b/src/gallium/auxiliary/vl/vl_idct.c
@@ -603,7 +603,6 @@ init_source(struct vl_idct *idct, struct vl_idct_buffer *buffer)
surf_templ.format = tex->format;
surf_templ.u.tex.first_layer = 0;
surf_templ.u.tex.last_layer = 0;
- surf_templ.usage = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
buffer->fb_state_mismatch.cbufs[0] = idct->pipe->create_surface(idct->pipe, tex, &surf_templ);
buffer->viewport_mismatch.scale[0] = tex->width0;
@@ -643,7 +642,6 @@ init_intermediate(struct vl_idct *idct, struct vl_idct_buffer *buffer)
surf_templ.format = tex->format;
surf_templ.u.tex.first_layer = i;
surf_templ.u.tex.last_layer = i;
- surf_templ.usage = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
buffer->fb_state.cbufs[i] = idct->pipe->create_surface(
idct->pipe, tex, &surf_templ);
diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c
index 82d7386e644..511485f75d6 100644
--- a/src/gallium/auxiliary/vl/vl_video_buffer.c
+++ b/src/gallium/auxiliary/vl/vl_video_buffer.c
@@ -368,7 +368,6 @@ vl_video_buffer_surfaces(struct pipe_video_buffer *buffer)
if (!buf->surfaces[surf]) {
memset(&surf_templ, 0, sizeof(surf_templ));
surf_templ.format = vl_video_buffer_surface_format(buf->resources[j]->format);
- surf_templ.usage = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
surf_templ.u.tex.first_layer = surf_templ.u.tex.last_layer = i;
buf->surfaces[surf] = pipe->create_surface(pipe, buf->resources[j], &surf_templ);
if (!buf->surfaces[surf])
diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c
index 08a6f343922..b8eef89ecd4 100644
--- a/src/gallium/drivers/i915/i915_surface.c
+++ b/src/gallium/drivers/i915/i915_surface.c
@@ -332,7 +332,6 @@ i915_create_surface(struct pipe_context *ctx,
ps->u.tex.level = surf_tmpl->u.tex.level;
ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
ps->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
- ps->usage = surf_tmpl->usage;
ps->context = ctx;
}
return ps;
diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c
index 31ea7dca50e..2e9c6bfe1ca 100644
--- a/src/gallium/drivers/llvmpipe/lp_texture.c
+++ b/src/gallium/drivers/llvmpipe/lp_texture.c
@@ -602,7 +602,6 @@ llvmpipe_create_surface(struct pipe_context *pipe,
ps->format = surf_tmpl->format;
ps->width = u_minify(pt->width0, surf_tmpl->u.tex.level);
ps->height = u_minify(pt->height0, surf_tmpl->u.tex.level);
- ps->usage = surf_tmpl->usage;
ps->u.tex.level = surf_tmpl->u.tex.level;
ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
diff --git a/src/gallium/drivers/noop/noop_state.c b/src/gallium/drivers/noop/noop_state.c
index 16ce9b457d9..f56ff597c6c 100644
--- a/src/gallium/drivers/noop/noop_state.c
+++ b/src/gallium/drivers/noop/noop_state.c
@@ -116,7 +116,6 @@ static struct pipe_surface *noop_create_surface(struct pipe_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;
diff --git a/src/gallium/drivers/nouveau/nouveau_video.c b/src/gallium/drivers/nouveau/nouveau_video.c
index bd8f0961bc4..eeaabab4aea 100644
--- a/src/gallium/drivers/nouveau/nouveau_video.c
+++ b/src/gallium/drivers/nouveau/nouveau_video.c
@@ -744,7 +744,6 @@ nouveau_video_buffer_surfaces(struct pipe_video_buffer *buffer)
if (!buf->surfaces[i]) {
memset(&surf_templ, 0, sizeof(surf_templ));
surf_templ.format = buf->resources[i]->format;
- surf_templ.usage = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
buf->surfaces[i] = pipe->create_surface(pipe, buf->resources[i], &surf_templ);
if (!buf->surfaces[i])
goto error;
diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c
index 5d941ab771e..d4dcacb8506 100644
--- a/src/gallium/drivers/nv30/nv30_miptree.c
+++ b/src/gallium/drivers/nv30/nv30_miptree.c
@@ -460,7 +460,6 @@ nv30_miptree_surface_new(struct pipe_context *pipe,
pipe_resource_reference(&ps->texture, pt);
ps->context = pipe;
ps->format = tmpl->format;
- ps->usage = tmpl->usage;
ps->u.tex.level = tmpl->u.tex.level;
ps->u.tex.first_layer = tmpl->u.tex.first_layer;
ps->u.tex.last_layer = tmpl->u.tex.last_layer;
diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c
index 568526c5933..fc9d7f360d0 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -378,7 +378,6 @@ nv50_surface_from_miptree(struct nv50_miptree *mt,
pipe_resource_reference(&ps->texture, &mt->base.base);
ps->format = templ->format;
- ps->usage = templ->usage;
ps->u.tex.level = templ->u.tex.level;
ps->u.tex.first_layer = templ->u.tex.first_layer;
ps->u.tex.last_layer = templ->u.tex.last_layer;
diff --git a/src/gallium/drivers/nv50/nv50_resource.c b/src/gallium/drivers/nv50/nv50_resource.c
index 42fefa61efc..d5c330decc4 100644
--- a/src/gallium/drivers/nv50/nv50_resource.c
+++ b/src/gallium/drivers/nv50/nv50_resource.c
@@ -43,7 +43,6 @@ nv50_surface_from_buffer(struct pipe_context *pipe,
pipe_resource_reference(&sf->base.texture, pbuf);
sf->base.format = templ->format;
- sf->base.usage = templ->usage;
sf->base.u.buf.first_element = templ->u.buf.first_element;
sf->base.u.buf.last_element = templ->u.buf.last_element;
diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c
index d9722a86b29..b02550f437b 100644
--- a/src/gallium/drivers/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nv50/nv50_surface.c
@@ -697,7 +697,6 @@ nv50_blit_set_dst(struct nv50_blitctx *ctx,
else
templ.format = format;
- templ.usage = PIPE_USAGE_STREAM;
templ.u.tex.level = level;
templ.u.tex.first_layer = templ.u.tex.last_layer = layer;
diff --git a/src/gallium/drivers/nvc0/nvc0_surface.c b/src/gallium/drivers/nvc0/nvc0_surface.c
index dbd4fa3b794..2f81cf5c61e 100644
--- a/src/gallium/drivers/nvc0/nvc0_surface.c
+++ b/src/gallium/drivers/nvc0/nvc0_surface.c
@@ -573,7 +573,6 @@ nvc0_blit_set_dst(struct nvc0_blitctx *ctx,
else
templ.format = format;
- templ.usage = PIPE_USAGE_STREAM;
templ.u.tex.level = level;
templ.u.tex.first_layer = templ.u.tex.last_layer = layer;
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index c16bb03e702..6197cf719ef 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -1109,7 +1109,6 @@ struct pipe_surface* r300_create_surface_custom(struct pipe_context * ctx,
surface->base.format = surf_tmpl->format;
surface->base.width = u_minify(width0_override, level);
surface->base.height = u_minify(height0_override, level);
- surface->base.usage = surf_tmpl->usage;
surface->base.u.tex.level = level;
surface->base.u.tex.first_layer = surf_tmpl->u.tex.first_layer;
surface->base.u.tex.last_layer = surf_tmpl->u.tex.last_layer;
diff --git a/src/gallium/drivers/r600/evergreen_compute_internal.c b/src/gallium/drivers/r600/evergreen_compute_internal.c
index 7bc7fb43f6c..cbf66228518 100644
--- a/src/gallium/drivers/r600/evergreen_compute_internal.c
+++ b/src/gallium/drivers/r600/evergreen_compute_internal.c
@@ -272,7 +272,6 @@ void evergreen_set_rat(
/* Create the RAT surface */
memset(&rat_templ, 0, sizeof(rat_templ));
- rat_templ.usage = RADEON_USAGE_READWRITE;
rat_templ.format = PIPE_FORMAT_R32_UINT;
rat_templ.u.tex.level = 0;
rat_templ.u.tex.first_layer = 0;
diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c
index e39f4bd9cd1..f702f7bd4f0 100644
--- a/src/gallium/drivers/r600/r600_blit.c
+++ b/src/gallium/drivers/r600/r600_blit.c
@@ -182,7 +182,6 @@ void r600_blit_decompress_depth(struct pipe_context *ctx,
surf_tmpl.u.tex.level = level;
surf_tmpl.u.tex.first_layer = layer;
surf_tmpl.u.tex.last_layer = layer;
- surf_tmpl.usage = PIPE_BIND_DEPTH_STENCIL;
zsurf = ctx->create_surface(ctx, &texture->resource.b.b, &surf_tmpl);
@@ -190,7 +189,6 @@ void r600_blit_decompress_depth(struct pipe_context *ctx,
surf_tmpl.u.tex.level = level;
surf_tmpl.u.tex.first_layer = layer;
surf_tmpl.u.tex.last_layer = layer;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
cbsurf = ctx->create_surface(ctx,
&flushed_depth_texture->resource.b.b, &surf_tmpl);
@@ -231,7 +229,6 @@ static void r600_blit_decompress_depth_in_place(struct r600_context *rctx,
rctx->db_misc_state.atom.dirty = true;
surf_tmpl.format = texture->resource.b.b.format;
- surf_tmpl.usage = PIPE_BIND_DEPTH_STENCIL;
for (level = first_level; level <= last_level; level++) {
if (!(texture->dirty_level_mask & (1 << level)))
@@ -348,7 +345,6 @@ static void r600_blit_decompress_color(struct pipe_context *ctx,
surf_tmpl.u.tex.level = level;
surf_tmpl.u.tex.first_layer = layer;
surf_tmpl.u.tex.last_layer = layer;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
cbsurf = ctx->create_surface(ctx, &rtex->resource.b.b, &surf_tmpl);
r600_blitter_begin(ctx, R600_DECOMPRESS);
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index d6d1b3daff6..efff2c36297 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -567,7 +567,6 @@ struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe,
surface->base.format = templ->format;
surface->base.width = width;
surface->base.height = height;
- surface->base.usage = templ->usage;
surface->base.u = templ->u;
return &surface->base;
}
diff --git a/src/gallium/drivers/radeonsi/r600_blit.c b/src/gallium/drivers/radeonsi/r600_blit.c
index 30736fcf8a7..40967d64ea5 100644
--- a/src/gallium/drivers/radeonsi/r600_blit.c
+++ b/src/gallium/drivers/radeonsi/r600_blit.c
@@ -133,12 +133,10 @@ void si_blit_uncompress_depth(struct pipe_context *ctx, struct r600_resource_tex
surf_tmpl.u.tex.level = level;
surf_tmpl.u.tex.first_layer = layer;
surf_tmpl.u.tex.last_layer = layer;
- surf_tmpl.usage = PIPE_BIND_DEPTH_STENCIL;
zsurf = ctx->create_surface(ctx, &texture->resource.b.b, &surf_tmpl);
surf_tmpl.format = texture->flushed_depth_texture->real_format;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
cbsurf = ctx->create_surface(ctx,
(struct pipe_resource*)texture->flushed_depth_texture, &surf_tmpl);
diff --git a/src/gallium/drivers/radeonsi/r600_texture.c b/src/gallium/drivers/radeonsi/r600_texture.c
index 676f4a9780a..fdfc8f3fa28 100644
--- a/src/gallium/drivers/radeonsi/r600_texture.c
+++ b/src/gallium/drivers/radeonsi/r600_texture.c
@@ -562,7 +562,6 @@ static struct pipe_surface *r600_create_surface(struct pipe_context *pipe,
surface->base.format = surf_tmpl->format;
surface->base.width = rtex->surface.level[level].npix_x;
surface->base.height = rtex->surface.level[level].npix_y;
- surface->base.usage = surf_tmpl->usage;
surface->base.texture = texture;
surface->base.u.tex.first_layer = surf_tmpl->u.tex.first_layer;
surface->base.u.tex.last_layer = surf_tmpl->u.tex.last_layer;
diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
index 9c31daa63f3..0d1481af23f 100644
--- a/src/gallium/drivers/softpipe/sp_texture.c
+++ b/src/gallium/drivers/softpipe/sp_texture.c
@@ -296,7 +296,6 @@ softpipe_create_surface(struct pipe_context *pipe,
ps->format = surf_tmpl->format;
ps->width = u_minify(pt->width0, level);
ps->height = u_minify(pt->height0, level);
- ps->usage = surf_tmpl->usage;
ps->u.tex.level = level;
ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c
index d3c228bf57d..f5619561269 100644
--- a/src/gallium/drivers/svga/svga_surface.c
+++ b/src/gallium/drivers/svga/svga_surface.c
@@ -216,7 +216,6 @@ svga_create_surface(struct pipe_context *pipe,
s->base.format = surf_tmpl->format;
s->base.width = u_minify(pt->width0, surf_tmpl->u.tex.level);
s->base.height = u_minify(pt->height0, surf_tmpl->u.tex.level);
- s->base.usage = surf_tmpl->usage;
s->base.u.tex.level = surf_tmpl->u.tex.level;
s->base.u.tex.first_layer = surf_tmpl->u.tex.first_layer;
s->base.u.tex.last_layer = surf_tmpl->u.tex.last_layer;
diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c
index 4cc25d24477..006082b7470 100644
--- a/src/gallium/drivers/trace/tr_dump_state.c
+++ b/src/gallium/drivers/trace/tr_dump_state.c
@@ -544,8 +544,6 @@ void trace_dump_surface_template(const struct pipe_surface *state,
trace_dump_member(uint, state, width);
trace_dump_member(uint, state, height);
- trace_dump_member(uint, state, usage);
-
trace_dump_member_begin("u");
trace_dump_struct_begin(""); /* anonymous */
if (target == PIPE_BUFFER) {
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index f84bfd79d6a..ab49cabb800 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -335,7 +335,6 @@ struct pipe_surface
unsigned width; /**< logical width in pixels */
unsigned height; /**< logical height in pixels */
- unsigned usage; /**< bitmask of PIPE_BIND_x */
unsigned writable:1; /**< writable shader resource */
union {
diff --git a/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp b/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp
index 54447814c5c..dc63fb90704 100644
--- a/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp
+++ b/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp
@@ -1167,7 +1167,6 @@ struct GalliumDXGISwapChain : public GalliumDXGIObject<IDXGISwapChain, GalliumDX
if(!formats_compatible || src->width0 != dst_w || src->height0 != dst_h) {
struct pipe_surface templat;
- templat.usage = PIPE_BIND_RENDER_TARGET;
templat.format = dst->format;
templat.u.tex.level = 0;
templat.u.tex.first_layer = 0;
diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
index 31e59bf38b1..2c06185594f 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
+++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
@@ -1226,7 +1226,6 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen
templat.format = (desc->Format == DXGI_FORMAT_UNKNOWN) ? resource->format : dxgi_to_pipe_format[desc->Format];
if(!templat.format)
return E_NOTIMPL;
- templat.usage = PIPE_BIND_RENDER_TARGET;
templat.texture = ((GalliumD3D11Resource<>*)iresource)->resource;
switch(desc->ViewDimension)
@@ -1316,7 +1315,6 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen
templat.format = (desc->Format == DXGI_FORMAT_UNKNOWN) ? resource->format : dxgi_to_pipe_format[desc->Format];
if(!templat.format)
return E_NOTIMPL;
- templat.usage = PIPE_BIND_DEPTH_STENCIL;
templat.texture = ((GalliumD3D11Resource<>*)iresource)->resource;
switch(desc->ViewDimension)
diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c
index dd3c1a834bb..a8351261199 100644
--- a/src/gallium/state_trackers/vdpau/output.c
+++ b/src/gallium/state_trackers/vdpau/output.c
@@ -100,7 +100,6 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
memset(&surf_templ, 0, sizeof(surf_templ));
surf_templ.format = res->format;
- surf_templ.usage = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
vlsurface->surface = pipe->create_surface(pipe, res, &surf_templ);
if (!vlsurface->surface) {
pipe_resource_reference(&res, NULL);
diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c
index 51a702eefde..349654d0625 100644
--- a/src/gallium/state_trackers/vdpau/presentation.c
+++ b/src/gallium/state_trackers/vdpau/presentation.c
@@ -236,7 +236,6 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
memset(&surf_templ, 0, sizeof(surf_templ));
surf_templ.format = tex->format;
- surf_templ.usage = PIPE_BIND_RENDER_TARGET;
surf_draw = pipe->create_surface(pipe, tex, &surf_templ);
surf->timestamp = (vlVdpTime)earliest_presentation_time;
diff --git a/src/gallium/state_trackers/vega/image.c b/src/gallium/state_trackers/vega/image.c
index 74a84e0a81d..4434550c629 100644
--- a/src/gallium/state_trackers/vega/image.c
+++ b/src/gallium/state_trackers/vega/image.c
@@ -139,7 +139,7 @@ static void vg_copy_texture(struct vg_context *ctx,
struct pipe_surface *surf, surf_tmpl;
/* get the destination surface */
- u_surface_default_template(&surf_tmpl, dst, PIPE_BIND_RENDER_TARGET);
+ u_surface_default_template(&surf_tmpl, dst);
surf = ctx->pipe->create_surface(ctx->pipe, dst, &surf_tmpl);
if (surf && renderer_copy_begin(ctx->renderer, surf, VG_TRUE, src)) {
renderer_copy(ctx->renderer,
@@ -570,9 +570,7 @@ void image_set_pixels(VGint dx, VGint dy,
struct pipe_surface *surf, surf_tmpl;
struct st_renderbuffer *strb = ctx->draw_buffer->strb;
- memset(&surf_tmpl, 0, sizeof(surf_tmpl));
- u_surface_default_template(&surf_tmpl, image_texture(src),
- 0 /* no bind flag - not a surface*/);
+ u_surface_default_template(&surf_tmpl, image_texture(src));
surf = pipe->create_surface(pipe, image_texture(src), &surf_tmpl);
vg_copy_surface(ctx, strb->surface, dx, dy,
@@ -593,9 +591,7 @@ void image_get_pixels(struct vg_image *dst, VGint dx, VGint dy,
/* flip the y coordinates */
/*dy = dst->height - dy - height;*/
- memset(&surf_tmpl, 0, sizeof(surf_tmpl));
- u_surface_default_template(&surf_tmpl, image_texture(dst),
- PIPE_BIND_RENDER_TARGET);
+ u_surface_default_template(&surf_tmpl, image_texture(dst));
surf = pipe->create_surface(pipe, image_texture(dst), &surf_tmpl);
vg_copy_surface(ctx, surf, dst->x + dx, dst->y + dy,
diff --git a/src/gallium/state_trackers/vega/mask.c b/src/gallium/state_trackers/vega/mask.c
index 89bff6ede1b..e46bbdd768a 100644
--- a/src/gallium/state_trackers/vega/mask.c
+++ b/src/gallium/state_trackers/vega/mask.c
@@ -398,8 +398,7 @@ void mask_copy(struct vg_mask_layer *layer,
struct pipe_surface *surf, surf_tmpl;
/* get the destination surface */
- u_surface_default_template(&surf_tmpl, layer->sampler_view->texture,
- PIPE_BIND_RENDER_TARGET);
+ u_surface_default_template(&surf_tmpl, layer->sampler_view->texture);
surf = ctx->pipe->create_surface(ctx->pipe, layer->sampler_view->texture,
&surf_tmpl);
if (surf && renderer_copy_begin(ctx->renderer, surf, VG_FALSE, src)) {
@@ -425,8 +424,7 @@ static void mask_layer_render_to(struct vg_mask_layer *layer,
struct pipe_sampler_view *view = vg_get_surface_mask(ctx);
struct matrix *mat = &ctx->state.vg.path_user_to_surface_matrix;
struct pipe_surface *surf, surf_tmpl;
- u_surface_default_template(&surf_tmpl, view->texture,
- PIPE_BIND_RENDER_TARGET);
+ u_surface_default_template(&surf_tmpl, view->texture);
surf = pipe->create_surface(pipe, view->texture, &surf_tmpl);
renderer_validate_for_mask_rendering(ctx->renderer, surf, mat);
diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c
index 9faf54f411d..11d3b5a0779 100644
--- a/src/gallium/state_trackers/vega/renderer.c
+++ b/src/gallium/state_trackers/vega/renderer.c
@@ -870,8 +870,7 @@ VGboolean renderer_filter_begin(struct renderer *renderer,
if (!renderer_can_support(renderer, dst, PIPE_BIND_RENDER_TARGET))
return VG_FALSE;
- u_surface_default_template(&surf_tmpl, dst,
- PIPE_BIND_RENDER_TARGET);
+ u_surface_default_template(&surf_tmpl, dst);
surf = renderer->pipe->create_surface(renderer->pipe, dst, &surf_tmpl);
if (!surf)
return VG_FALSE;
diff --git a/src/gallium/state_trackers/vega/vg_context.c b/src/gallium/state_trackers/vega/vg_context.c
index ca4ec7f82ba..c6361881683 100644
--- a/src/gallium/state_trackers/vega/vg_context.c
+++ b/src/gallium/state_trackers/vega/vg_context.c
@@ -377,9 +377,7 @@ vg_context_update_depth_stencil_rb(struct vg_context * ctx,
if (!dsrb->texture)
return TRUE;
- memset(&surf_tmpl, 0, sizeof(surf_tmpl));
- u_surface_default_template(&surf_tmpl, dsrb->texture,
- PIPE_BIND_DEPTH_STENCIL);
+ u_surface_default_template(&surf_tmpl, dsrb->texture);
dsrb->surface = pipe->create_surface(pipe,
dsrb->texture,
&surf_tmpl);
@@ -450,9 +448,7 @@ static void vg_prepare_blend_texture(struct vg_context *ctx,
vg_context_update_blend_texture_view(ctx, stfb->width, stfb->height);
- memset(&surf_tmpl, 0, sizeof(surf_tmpl));
- u_surface_default_template(&surf_tmpl, stfb->blend_texture_view->texture,
- PIPE_BIND_RENDER_TARGET);
+ u_surface_default_template(&surf_tmpl, stfb->blend_texture_view->texture);
surf = ctx->pipe->create_surface(ctx->pipe,
stfb->blend_texture_view->texture,
&surf_tmpl);
diff --git a/src/gallium/state_trackers/vega/vg_manager.c b/src/gallium/state_trackers/vega/vg_manager.c
index e9c4a832a58..c8531f8b53a 100644
--- a/src/gallium/state_trackers/vega/vg_manager.c
+++ b/src/gallium/state_trackers/vega/vg_manager.c
@@ -61,9 +61,7 @@ vg_context_update_color_rb(struct vg_context *ctx, struct pipe_resource *pt)
strb->texture = pt;
- memset(&surf_tmpl, 0, sizeof(surf_tmpl));
- u_surface_default_template(&surf_tmpl, strb->texture,
- PIPE_BIND_RENDER_TARGET);
+ u_surface_default_template(&surf_tmpl, strb->texture);
strb->surface = pipe->create_surface(pipe, strb->texture, &surf_tmpl);
if (!strb->surface) {
diff --git a/src/gallium/state_trackers/xa/xa_context.c b/src/gallium/state_trackers/xa/xa_context.c
index 93dae137ba1..7b7a90343df 100644
--- a/src/gallium/state_trackers/xa/xa_context.c
+++ b/src/gallium/state_trackers/xa/xa_context.c
@@ -182,8 +182,7 @@ xa_ctx_srf_create(struct xa_context *ctx, struct xa_surface *dst)
PIPE_BIND_RENDER_TARGET))
return -XA_ERR_INVAL;
- u_surface_default_template(&srf_templ, dst->tex,
- PIPE_BIND_RENDER_TARGET);
+ u_surface_default_template(&srf_templ, dst->tex);
ctx->srf = ctx->pipe->create_surface(ctx->pipe, dst->tex, &srf_templ);
if (!ctx->srf)
return -XA_ERR_NORES;
diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c
index c8f20acdec7..d78ab74aeef 100644
--- a/src/gallium/state_trackers/xorg/xorg_exa.c
+++ b/src/gallium/state_trackers/xorg/xorg_exa.c
@@ -1062,9 +1062,7 @@ struct pipe_surface *
xorg_gpu_surface(struct pipe_context *pipe, struct exa_pixmap_priv *priv)
{
struct pipe_surface surf_tmpl;
- memset(&surf_tmpl, 0, sizeof(surf_tmpl));
- u_surface_default_template(&surf_tmpl, priv->tex,
- PIPE_BIND_RENDER_TARGET);
+ u_surface_default_template(&surf_tmpl, priv->tex);
return pipe->create_surface(pipe, priv->tex, &surf_tmpl);
diff --git a/src/gallium/state_trackers/xvmc/surface.c b/src/gallium/state_trackers/xvmc/surface.c
index bec23a4a1be..fd3f26c5070 100644
--- a/src/gallium/state_trackers/xvmc/surface.c
+++ b/src/gallium/state_trackers/xvmc/surface.c
@@ -386,7 +386,6 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
memset(&surf_templ, 0, sizeof(surf_templ));
surf_templ.format = tex->format;
- surf_templ.usage = PIPE_BIND_RENDER_TARGET;
surf = pipe->create_surface(pipe, tex, &surf_templ);
if (!surf)
diff --git a/src/gallium/tests/graw/clear.c b/src/gallium/tests/graw/clear.c
index c6c645e8a46..0b78be80a8c 100644
--- a/src/gallium/tests/graw/clear.c
+++ b/src/gallium/tests/graw/clear.c
@@ -82,7 +82,6 @@ static void init( void )
exit(4);
surf_tmpl.format = templat.format;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
surf_tmpl.u.tex.level = 0;
surf_tmpl.u.tex.first_layer = 0;
surf_tmpl.u.tex.last_layer = 0;
diff --git a/src/gallium/tests/graw/fs-test.c b/src/gallium/tests/graw/fs-test.c
index 9cde75cff25..2c02f4f1297 100644
--- a/src/gallium/tests/graw/fs-test.c
+++ b/src/gallium/tests/graw/fs-test.c
@@ -421,7 +421,6 @@ static void init( void )
exit(4);
surf_tmpl.format = templat.format;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
surf_tmpl.u.tex.level = 0;
surf_tmpl.u.tex.first_layer = 0;
surf_tmpl.u.tex.last_layer = 0;
diff --git a/src/gallium/tests/graw/graw_util.h b/src/gallium/tests/graw/graw_util.h
index 86bb18d43e6..1ff7a3f01ff 100644
--- a/src/gallium/tests/graw/graw_util.h
+++ b/src/gallium/tests/graw/graw_util.h
@@ -87,7 +87,6 @@ graw_util_create_window(struct graw_info *info,
/* create color surface */
surface_temp.format = resource_temp.format;
- surface_temp.usage = PIPE_BIND_RENDER_TARGET;
surface_temp.u.tex.level = 0;
surface_temp.u.tex.first_layer = 0;
surface_temp.u.tex.last_layer = 0;
@@ -118,7 +117,6 @@ graw_util_create_window(struct graw_info *info,
/* create z surface */
surface_temp.format = resource_temp.format;
- surface_temp.usage = PIPE_BIND_DEPTH_STENCIL;
surface_temp.u.tex.level = 0;
surface_temp.u.tex.first_layer = 0;
surface_temp.u.tex.last_layer = 0;
diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c
index c43f54595bf..0bd5e29fdd5 100644
--- a/src/gallium/tests/graw/gs-test.c
+++ b/src/gallium/tests/graw/gs-test.c
@@ -528,7 +528,6 @@ static void init( void )
exit(4);
surf_tmpl.format = templat.format;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
surf_tmpl.u.tex.level = 0;
surf_tmpl.u.tex.first_layer = 0;
surf_tmpl.u.tex.last_layer = 0;
diff --git a/src/gallium/tests/graw/quad-sample.c b/src/gallium/tests/graw/quad-sample.c
index ab5f299f3e3..c9e7646e8e2 100644
--- a/src/gallium/tests/graw/quad-sample.c
+++ b/src/gallium/tests/graw/quad-sample.c
@@ -336,7 +336,6 @@ static void init( void )
exit(4);
surf_tmpl.format = templat.format;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
surf_tmpl.u.tex.level = 0;
surf_tmpl.u.tex.first_layer = 0;
surf_tmpl.u.tex.last_layer = 0;
diff --git a/src/gallium/tests/graw/shader-leak.c b/src/gallium/tests/graw/shader-leak.c
index be93771f577..b685fb98494 100644
--- a/src/gallium/tests/graw/shader-leak.c
+++ b/src/gallium/tests/graw/shader-leak.c
@@ -211,7 +211,6 @@ static void init( void )
}
surf_tmpl.format = templat.format;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
surf_tmpl.u.tex.level = 0;
surf_tmpl.u.tex.first_layer = 0;
surf_tmpl.u.tex.last_layer = 0;
diff --git a/src/gallium/tests/graw/tri-gs.c b/src/gallium/tests/graw/tri-gs.c
index 573bc8a83f4..8fdc28d58da 100644
--- a/src/gallium/tests/graw/tri-gs.c
+++ b/src/gallium/tests/graw/tri-gs.c
@@ -218,7 +218,6 @@ static void init( void )
exit(4);
surf_tmpl.format = templat.format;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
surf_tmpl.u.tex.level = 0;
surf_tmpl.u.tex.first_layer = 0;
surf_tmpl.u.tex.last_layer = 0;
diff --git a/src/gallium/tests/graw/tri-instanced.c b/src/gallium/tests/graw/tri-instanced.c
index 4e3a80b61dd..651518a14ed 100644
--- a/src/gallium/tests/graw/tri-instanced.c
+++ b/src/gallium/tests/graw/tri-instanced.c
@@ -269,7 +269,6 @@ static void init( void )
exit(4);
surf_tmpl.format = templat.format;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
surf_tmpl.u.tex.level = 0;
surf_tmpl.u.tex.first_layer = 0;
surf_tmpl.u.tex.last_layer = 0;
diff --git a/src/gallium/tests/graw/vs-test.c b/src/gallium/tests/graw/vs-test.c
index 0677f04f28f..e0358e6868f 100644
--- a/src/gallium/tests/graw/vs-test.c
+++ b/src/gallium/tests/graw/vs-test.c
@@ -415,7 +415,6 @@ static void init( void )
exit(4);
surf_tmpl.format = templat.format;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
surf_tmpl.u.tex.level = 0;
surf_tmpl.u.tex.first_layer = 0;
surf_tmpl.u.tex.last_layer = 0;
diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c
index feff902bbae..db99789280f 100644
--- a/src/gallium/tests/trivial/quad-tex.c
+++ b/src/gallium/tests/trivial/quad-tex.c
@@ -211,7 +211,6 @@ static void init_prog(struct program *p)
p->sampler.normalized_coords = 1;
surf_tmpl.format = PIPE_FORMAT_B8G8R8A8_UNORM; /* All drivers support this */
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
surf_tmpl.u.tex.level = 0;
surf_tmpl.u.tex.first_layer = 0;
surf_tmpl.u.tex.last_layer = 0;
diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c
index f9b4696abef..2c11f72da3a 100644
--- a/src/gallium/tests/trivial/tri.c
+++ b/src/gallium/tests/trivial/tri.c
@@ -156,7 +156,6 @@ static void init_prog(struct program *p)
p->rasterizer.depth_clip = 1;
surf_tmpl.format = PIPE_FORMAT_B8G8R8A8_UNORM;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
surf_tmpl.u.tex.level = 0;
surf_tmpl.u.tex.first_layer = 0;
surf_tmpl.u.tex.last_layer = 0;
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c
index a10dbfbd0ec..3df8691f4b9 100644
--- a/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -71,7 +71,6 @@ update_renderbuffer_surface(struct st_context *st,
struct pipe_surface surf_tmpl;
memset(&surf_tmpl, 0, sizeof(surf_tmpl));
surf_tmpl.format = format;
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
surf_tmpl.u.tex.level = level;
surf_tmpl.u.tex.first_layer = strb->rtt_face + strb->rtt_slice;
surf_tmpl.u.tex.last_layer = strb->rtt_face + strb->rtt_slice;
diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c
index 0679e7d44bd..8c78e5ef477 100644
--- a/src/mesa/state_tracker/st_cb_eglimage.c
+++ b/src/mesa/state_tracker/st_cb_eglimage.c
@@ -76,10 +76,8 @@ st_egl_image_target_renderbuffer_storage(struct gl_context *ctx,
struct st_context *st = st_context(ctx);
struct st_renderbuffer *strb = st_renderbuffer(rb);
struct pipe_surface *ps;
- unsigned usage;
- usage = PIPE_BIND_RENDER_TARGET;
- ps = st_manager_get_egl_image_surface(st, (void *) image_handle, usage);
+ ps = st_manager_get_egl_image_surface(st, (void *) image_handle);
if (ps) {
strb->Base.Width = ps->width;
strb->Base.Height = ps->height;
@@ -146,10 +144,8 @@ st_egl_image_target_texture_2d(struct gl_context *ctx, GLenum target,
{
struct st_context *st = st_context(ctx);
struct pipe_surface *ps;
- unsigned usage;
- usage = PIPE_BIND_SAMPLER_VIEW;
- ps = st_manager_get_egl_image_surface(st, (void *) image_handle, usage);
+ ps = st_manager_get_egl_image_surface(st, (void *) image_handle);
if (ps) {
st_bind_surface(ctx, target, texObj, texImage, ps);
pipe_surface_reference(&ps, NULL);
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index ae280bfa973..bf206b02552 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -206,7 +206,7 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx,
if (!strb->texture)
return FALSE;
- u_surface_default_template(&surf_tmpl, strb->texture, templ.bind);
+ u_surface_default_template(&surf_tmpl, strb->texture);
strb->surface = pipe->create_surface(pipe,
strb->texture,
&surf_tmpl);
@@ -444,7 +444,6 @@ st_render_texture(struct gl_context *ctx,
memset(&surf_tmpl, 0, sizeof(surf_tmpl));
surf_tmpl.format = ctx->Color.sRGBEnabled
? strb->texture->format : util_format_linear(strb->texture->format);
- surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
surf_tmpl.u.tex.level = strb->rtt_level;
surf_tmpl.u.tex.first_layer = strb->rtt_face + strb->rtt_slice;
surf_tmpl.u.tex.last_layer = strb->rtt_face + strb->rtt_slice;
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 131ecf2e170..bf13526d2ff 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1090,7 +1090,6 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims,
memset(&surf_tmpl, 0, sizeof(surf_tmpl));
surf_tmpl.format = util_format_linear(stImage->pt->format);
- surf_tmpl.usage = dst_usage;
surf_tmpl.u.tex.level = stImage->base.Level;
surf_tmpl.u.tex.first_layer = stImage->base.Face + destZ;
surf_tmpl.u.tex.last_layer = stImage->base.Face + destZ;
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index e97b3f38c05..e80f238753b 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -224,8 +224,7 @@ st_framebuffer_validate(struct st_framebuffer *stfb,
continue;
}
- u_surface_default_template(&surf_tmpl, textures[i],
- PIPE_BIND_RENDER_TARGET);
+ u_surface_default_template(&surf_tmpl, textures[i]);
ps = st->pipe->create_surface(st->pipe, textures[i], &surf_tmpl);
if (ps) {
pipe_surface_reference(&strb->surface, ps);
@@ -792,8 +791,7 @@ st_manager_flush_frontbuffer(struct st_context *st)
* FIXME: I think this should operate on resources, not surfaces
*/
struct pipe_surface *
-st_manager_get_egl_image_surface(struct st_context *st,
- void *eglimg, unsigned usage)
+st_manager_get_egl_image_surface(struct st_context *st, void *eglimg)
{
struct st_manager *smapi =
(struct st_manager *) st->iface.st_context_private;
@@ -807,7 +805,7 @@ st_manager_get_egl_image_surface(struct st_context *st,
if (!smapi->get_egl_image(smapi, eglimg, &stimg))
return NULL;
- u_surface_default_template(&surf_tmpl, stimg.texture, usage);
+ u_surface_default_template(&surf_tmpl, stimg.texture);
surf_tmpl.u.tex.level = stimg.level;
surf_tmpl.u.tex.first_layer = stimg.layer;
surf_tmpl.u.tex.last_layer = stimg.layer;
diff --git a/src/mesa/state_tracker/st_manager.h b/src/mesa/state_tracker/st_manager.h
index 6a94978390a..f729cff1fa4 100644
--- a/src/mesa/state_tracker/st_manager.h
+++ b/src/mesa/state_tracker/st_manager.h
@@ -36,8 +36,7 @@
struct st_context;
struct pipe_surface *
-st_manager_get_egl_image_surface(struct st_context *st,
- void *eglimg, unsigned usage);
+st_manager_get_egl_image_surface(struct st_context *st, void *eglimg);
void
st_manager_flush_frontbuffer(struct st_context *st);