radv: Remove unnecessary null check.

Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking subpass suggests that it may be null,
but it has already been dereferenced on all paths leading to the check.

Fixes: 779e09639b ("radv: configure DB_Z_INFO.NUM_SAMPLES correctly on GFX11")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17100>
This commit is contained in:
Vinson Lee 2022-06-16 16:03:20 -07:00 committed by Marge Bot
parent 9cf3608952
commit 2b87073133

View file

@ -2626,7 +2626,7 @@ radv_emit_framebuffer_state(struct radv_cmd_buffer *cmd_buffer)
* VRS and occlusion queries if depth and stencil are not bound.
*/
if (cmd_buffer->device->physical_device->rad_info.gfx_level == GFX11)
num_samples = subpass ? util_logbase2(subpass->max_sample_count) : 0;
num_samples = util_logbase2(subpass->max_sample_count);
if (cmd_buffer->device->physical_device->rad_info.gfx_level == GFX9)
radeon_set_context_reg_seq(cmd_buffer->cs, R_028038_DB_Z_INFO, 2);