turnip: remove unnecessary fb size check
authorJonathan Marek <jonathan@marek.ca>
Thu, 27 Feb 2020 16:20:59 +0000 (11:20 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Feb 2020 14:04:20 +0000 (14:04 +0000)
Framebuffer with 0 width or height is not valid.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>

src/freedreno/vulkan/tu_cmd_buffer.c

index f8e1ffe..a3d5a93 100644 (file)
@@ -1480,13 +1480,9 @@ tu6_sysmem_render_begin(struct tu_cmd_buffer *cmd, struct tu_cs *cs,
                         const struct VkRect2D *renderArea)
 {
    const struct tu_framebuffer *fb = cmd->state.framebuffer;
-   if (fb->width > 0 && fb->height > 0) {
-      tu6_emit_window_scissor(cmd, cs,
-                              0, 0, fb->width - 1, fb->height - 1);
-   } else {
-      tu6_emit_window_scissor(cmd, cs, 0, 0, 0, 0);
-   }
 
+   assert(fb->width > 0 && fb->height > 0);
+   tu6_emit_window_scissor(cmd, cs, 0, 0, fb->width - 1, fb->height - 1);
    tu6_emit_window_offset(cmd, cs, 0, 0);
 
    tu6_emit_bin_size(cs, 0, 0, 0xc00000); /* 0xc00000 = BYPASS? */