summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_clear.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-06-21 23:54:20 -0400
committerMarek Olšák <[email protected]>2018-06-25 18:33:58 -0400
commitd4755ef3892635e6e252af21ef7faf934ddd3da1 (patch)
treeca62e24a09b24681762349700f2a32c406d41010 /src/gallium/drivers/radeonsi/si_clear.c
parent2a8d1039b67d7bbf739e8031a123cc0f3f7ee1b8 (diff)
radeonsi: remove redundant si_texture::cmask_size
cmask_buffer and surface.cmask_size can replace its role. Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_clear.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_clear.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/gallium/drivers/radeonsi/si_clear.c b/src/gallium/drivers/radeonsi/si_clear.c
index 83bb51a043a..5cbbc89b60e 100644
--- a/src/gallium/drivers/radeonsi/si_clear.c
+++ b/src/gallium/drivers/radeonsi/si_clear.c
@@ -37,14 +37,9 @@ enum {
static void si_alloc_separate_cmask(struct si_screen *sscreen,
struct si_texture *tex)
{
- if (tex->cmask_buffer)
+ if (tex->cmask_buffer || !tex->surface.cmask_size)
return;
- assert(tex->cmask_size == 0);
-
- if (!tex->surface.cmask_size)
- return;
-
tex->cmask_buffer =
si_aligned_buffer_create(&sscreen->b,
SI_RESOURCE_FLAG_UNMAPPABLE,
@@ -54,7 +49,6 @@ static void si_alloc_separate_cmask(struct si_screen *sscreen,
if (tex->cmask_buffer == NULL)
return;
- tex->cmask_size = tex->surface.cmask_size;
tex->cmask_base_address_reg = tex->cmask_buffer->gpu_address >> 8;
tex->cb_color_info |= S_028C70_FAST_CLEAR(1);
@@ -490,13 +484,13 @@ static void si_do_fast_color_clear(struct si_context *sctx,
continue;
/* DCC fast clear with MSAA should clear CMASK to 0xC. */
- if (tex->buffer.b.b.nr_samples >= 2 && tex->cmask_size) {
+ if (tex->buffer.b.b.nr_samples >= 2 && tex->cmask_buffer) {
/* TODO: This doesn't work with MSAA. */
if (eliminate_needed)
continue;
si_clear_buffer(sctx, &tex->cmask_buffer->b.b,
- tex->cmask_offset, tex->cmask_size,
+ tex->cmask_offset, tex->surface.cmask_size,
0xCCCCCCCC, SI_COHERENCY_CB_META);
need_decompress_pass = true;
}
@@ -522,13 +516,12 @@ static void si_do_fast_color_clear(struct si_context *sctx,
/* ensure CMASK is enabled */
si_alloc_separate_cmask(sctx->screen, tex);
- if (tex->cmask_size == 0) {
+ if (!tex->cmask_buffer)
continue;
- }
/* Do the fast clear. */
si_clear_buffer(sctx, &tex->cmask_buffer->b.b,
- tex->cmask_offset, tex->cmask_size, 0,
+ tex->cmask_offset, tex->surface.cmask_size, 0,
SI_COHERENCY_CB_META);
need_decompress_pass = true;
}