Discussion:
[PATCH 1/2] radv: remove useless checks in radv_set_{color, depth}_clear_regs()
Add Reply
Samuel Pitoiset
2017-12-06 16:49:36 UTC
Reply
Permalink
Raw Message
Already checked by the respective callers.

Signed-off-by: Samuel Pitoiset <***@gmail.com>
---
src/amd/vulkan/radv_cmd_buffer.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 95c2915c97..621f0bad0b 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -1300,8 +1300,7 @@ radv_set_depth_clear_regs(struct radv_cmd_buffer *cmd_buffer,
va += image->offset + image->clear_value_offset;
unsigned reg_offset = 0, reg_count = 0;

- if (!image->surface.htile_size)
- return;
+ assert(image->surface.htile_size);

if (aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
++reg_count;
@@ -1400,8 +1399,7 @@ radv_set_color_clear_regs(struct radv_cmd_buffer *cmd_buffer,
uint64_t va = radv_buffer_get_va(image->bo);
va += image->offset + image->clear_value_offset;

- if (!image->cmask.size && !image->surface.dcc_size)
- return;
+ assert(image->cmask.size || image->surface.dcc_size);

radeon_emit(cmd_buffer->cs, PKT3(PKT3_WRITE_DATA, 4, 0));
radeon_emit(cmd_buffer->cs, S_370_DST_SEL(V_370_MEM_ASYNC) |
--
2.15.1
Samuel Pitoiset
2017-12-06 16:49:37 UTC
Reply
Permalink
Raw Message
emit_fast_color_clear() already checks that.

Signed-off-by: Samuel Pitoiset <***@gmail.com>
---
src/amd/vulkan/radv_cmd_buffer.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 621f0bad0b..68371dbbe7 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -1377,8 +1377,7 @@ radv_set_dcc_need_cmask_elim_pred(struct radv_cmd_buffer *cmd_buffer,
uint64_t va = radv_buffer_get_va(image->bo);
va += image->offset + image->dcc_pred_offset;

- if (!image->surface.dcc_size)
- return;
+ assert(image->surface.dcc_size);

radeon_emit(cmd_buffer->cs, PKT3(PKT3_WRITE_DATA, 4, 0));
radeon_emit(cmd_buffer->cs, S_370_DST_SEL(V_370_MEM_ASYNC) |
--
2.15.1
Loading...