diff options
author | Marek Olšák <[email protected]> | 2017-01-31 00:56:34 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-03-30 14:44:33 +0200 |
commit | 405bacd820027a239caca203cf6602da70dc5bbc (patch) | |
tree | 2ff7fb3815d5815e7870dcbb4bfb98455fd82742 /src/gallium/drivers/radeon | |
parent | 354285afa08f48d0aab232820698aacc54e347f7 (diff) |
radeonsi/gfx9: fix MIP0_WIDTH & MIP0_HEIGHT for compressed texture blits
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.h | 5 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_texture.c | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index a96f091fc96..6eaa87a26b1 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -275,6 +275,10 @@ struct r600_texture { struct r600_surface { struct pipe_surface base; + /* These can vary with block-compressed textures. */ + unsigned width0; + unsigned height0; + bool color_initialized; bool depth_initialized; @@ -804,6 +808,7 @@ void vi_dcc_disable_if_incompatible_format(struct r600_common_context *rctx, struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe, struct pipe_resource *texture, const struct pipe_surface *templ, + unsigned width0, unsigned height0, unsigned width, unsigned height); unsigned r600_translate_colorswap(enum pipe_format format, bool do_endian_swap); void vi_separate_dcc_start_query(struct pipe_context *ctx, diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index 5b1f941521b..f1b2cd96bcf 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -1862,6 +1862,7 @@ void vi_dcc_disable_if_incompatible_format(struct r600_common_context *rctx, struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe, struct pipe_resource *texture, const struct pipe_surface *templ, + unsigned width0, unsigned height0, unsigned width, unsigned height) { struct r600_common_context *rctx = (struct r600_common_context*)pipe; @@ -1881,6 +1882,9 @@ struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe, surface->base.height = height; surface->base.u = templ->u; + surface->width0 = width0; + surface->height0 = height0; + if (texture->target != PIPE_BUFFER) vi_dcc_disable_if_incompatible_format(rctx, texture, templ->u.tex.level, @@ -1917,7 +1921,9 @@ static struct pipe_surface *r600_create_surface(struct pipe_context *pipe, } } - return r600_create_surface_custom(pipe, tex, templ, width, height); + return r600_create_surface_custom(pipe, tex, templ, + tex->width0, tex->height0, + width, height); } static void r600_surface_destroy(struct pipe_context *pipe, |