diff options
author | Marek Olšák <[email protected]> | 2012-07-15 00:02:42 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-07-17 21:22:14 +0200 |
commit | 018e3f75d69490598d61059ece56d379867f3995 (patch) | |
tree | b764ce9a5091bc4eae7c92a38d2072ebe9243f92 /src/gallium/drivers/r600/r600_texture.c | |
parent | 761131ce4591e5f55f38d13f2c4d2194bc9cb0fd (diff) |
r600g: fix all failing depth-stencil tests for evergreen
Diffstat (limited to 'src/gallium/drivers/r600/r600_texture.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_texture.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index d16c25294d7..cbb9e5a9f48 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -234,8 +234,16 @@ static void r600_texture_set_array_mode(struct pipe_screen *screen, static int r600_init_surface(struct radeon_surface *surface, const struct pipe_resource *ptex, - unsigned array_mode, bool is_transfer) + unsigned array_mode, + bool is_transfer, bool is_flushed_depth) { + const struct util_format_description *desc = + util_format_description(ptex->format); + bool is_depth, is_stencil; + + is_depth = util_format_has_depth(desc); + is_stencil = util_format_has_stencil(desc); + surface->npix_x = ptex->width0; surface->npix_y = ptex->height0; surface->npix_z = ptex->depth0; @@ -295,12 +303,14 @@ static int r600_init_surface(struct radeon_surface *surface, if (ptex->bind & PIPE_BIND_SCANOUT) { surface->flags |= RADEON_SURF_SCANOUT; } - if ((ptex->bind & PIPE_BIND_DEPTH_STENCIL) && - util_format_is_depth_and_stencil(ptex->format) && !is_transfer) { + + if (!is_transfer && !is_flushed_depth && is_depth) { surface->flags |= RADEON_SURF_ZBUFFER; - surface->flags |= RADEON_SURF_SBUFFER; - } + if (is_stencil) { + surface->flags |= RADEON_SURF_SBUFFER; + } + } return 0; } @@ -638,7 +648,8 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen, } r = r600_init_surface(&surface, templ, array_mode, - templ->flags & R600_RESOURCE_FLAG_TRANSFER); + templ->flags & R600_RESOURCE_FLAG_TRANSFER, + templ->flags & R600_RESOURCE_FLAG_FLUSHED_DEPTH); if (r) { return NULL; } @@ -719,7 +730,7 @@ struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen, else array_mode = 0; - r = r600_init_surface(&surface, templ, array_mode, 0); + r = r600_init_surface(&surface, templ, array_mode, false, false); if (r) { return NULL; } @@ -749,7 +760,7 @@ void r600_init_flushed_depth_texture(struct pipe_context *ctx, resource.nr_samples = texture->nr_samples; resource.usage = staging ? PIPE_USAGE_DYNAMIC : PIPE_USAGE_DEFAULT; resource.bind = texture->bind & ~PIPE_BIND_DEPTH_STENCIL; - resource.flags = texture->flags; + resource.flags = texture->flags | R600_RESOURCE_FLAG_FLUSHED_DEPTH; if (staging) resource.flags |= R600_RESOURCE_FLAG_TRANSFER; |