diff options
author | Marek Olšák <[email protected]> | 2012-12-08 14:53:55 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-12-12 13:09:53 +0100 |
commit | c1f704073b8992f3556c8e44a7fc496e250ba3ae (patch) | |
tree | 16e92257a438b68b728764c412828034fe784a1e /src/gallium | |
parent | 21b1ec69fc846c562f7d3685355315ce66b0f436 (diff) |
svga: stop using pipe_surface::usage
There are only 2 possible usages: render target and depth stencil.
Both can be derived from the surface format, so the flag is redundant.
And it's going away...
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/svga/svga_surface.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c index 6c4f06d4289..d3c228bf57d 100644 --- a/src/gallium/drivers/svga/svga_surface.c +++ b/src/gallium/drivers/svga/svga_surface.c @@ -191,9 +191,6 @@ svga_create_surface(struct pipe_context *pipe, struct svga_screen *ss = svga_screen(screen); struct svga_surface *s; unsigned face, zslice; - /* XXX surfaces should only be used for rendering purposes nowadays */ - boolean render = (surf_tmpl->usage & (PIPE_BIND_RENDER_TARGET | - PIPE_BIND_DEPTH_STENCIL)) ? TRUE : FALSE; boolean view = FALSE; SVGA3dSurfaceFlags flags; SVGA3dSurfaceFormat format; @@ -224,26 +221,21 @@ svga_create_surface(struct pipe_context *pipe, s->base.u.tex.first_layer = surf_tmpl->u.tex.first_layer; s->base.u.tex.last_layer = surf_tmpl->u.tex.last_layer; - if (!render) { - flags = SVGA3D_SURFACE_HINT_TEXTURE; - } else { - if (surf_tmpl->usage & PIPE_BIND_RENDER_TARGET) { - flags = SVGA3D_SURFACE_HINT_RENDERTARGET; - } - if (surf_tmpl->usage & PIPE_BIND_DEPTH_STENCIL) { - flags = SVGA3D_SURFACE_HINT_DEPTHSTENCIL; - } + if (util_format_is_depth_or_stencil(surf_tmpl->format)) { + flags = SVGA3D_SURFACE_HINT_DEPTHSTENCIL; + } + else { + flags = SVGA3D_SURFACE_HINT_RENDERTARGET; } - format = svga_translate_format(ss, surf_tmpl->format, surf_tmpl->usage); + format = svga_translate_format(ss, surf_tmpl->format, 0); assert(format != SVGA3D_FORMAT_INVALID); if (svga_screen(screen)->debug.force_surface_view) view = TRUE; /* Currently only used for compressed textures */ - if (render && - format != svga_translate_format(ss, surf_tmpl->format, surf_tmpl->usage)) { + if (format != svga_translate_format(ss, surf_tmpl->format, 0)) { view = TRUE; } |