if (!job->needs_flush)
goto done;
- /* The RCL setup would choke if the draw bounds cause no drawing, so
- * just drop the drawing if that's the case.
- */
- if (job->draw_max_x <= job->draw_min_x ||
- job->draw_max_y <= job->draw_min_y) {
- goto done;
- }
-
if (vc5->screen->devinfo.ver >= 41)
v3d41_emit_rcl(job);
else
uint32_t supertile_h_in_pixels = job->tile_height * supertile_h;
uint32_t min_x_supertile = job->draw_min_x / supertile_w_in_pixels;
uint32_t min_y_supertile = job->draw_min_y / supertile_h_in_pixels;
- uint32_t max_x_supertile = (job->draw_max_x - 1) / supertile_w_in_pixels;
- uint32_t max_y_supertile = (job->draw_max_y - 1) / supertile_h_in_pixels;
+
+ uint32_t max_x_supertile = 0;
+ uint32_t max_y_supertile = 0;
+ if (job->draw_max_x != 0 && job->draw_max_y != 0) {
+ max_x_supertile = (job->draw_max_x - 1) / supertile_w_in_pixels;
+ max_y_supertile = (job->draw_max_y - 1) / supertile_h_in_pixels;
+ }
for (int y = min_y_supertile; y <= max_y_supertile; y++) {
for (int x = min_x_supertile; x <= max_x_supertile; x++) {