vc4: Move job-submit skip cases to vc4_job_submit().
[mesa.git] / src / gallium / drivers / ilo / ilo_blit.c
index ad304c7109a4382ef3b43e40496cdf0b1bcae978..e2ba6aa16b85f9f59af361e7305074b443f9c9b5 100644 (file)
@@ -64,6 +64,16 @@ ilo_clear(struct pipe_context *pipe,
           unsigned stencil)
 {
    struct ilo_context *ilo = ilo_context(pipe);
+   struct ilo_state_vector *vec = &ilo->state_vector;
+
+   if ((buffers & PIPE_CLEAR_DEPTHSTENCIL) && vec->fb.state.zsbuf) {
+      if (ilo_blitter_rectlist_clear_zs(ilo->blitter, vec->fb.state.zsbuf,
+               buffers & PIPE_CLEAR_DEPTHSTENCIL, depth, stencil))
+         buffers &= ~PIPE_CLEAR_DEPTHSTENCIL;
+
+      if (!buffers)
+         return;
+   }
 
    ilo_blitter_pipe_clear_fb(ilo->blitter, buffers, color, depth, stencil);
 }
@@ -73,7 +83,8 @@ ilo_clear_render_target(struct pipe_context *pipe,
                         struct pipe_surface *dst,
                         const union pipe_color_union *color,
                         unsigned dstx, unsigned dsty,
-                        unsigned width, unsigned height)
+                        unsigned width, unsigned height,
+                        bool render_condition_enabled)
 {
    struct ilo_context *ilo = ilo_context(pipe);
 
@@ -100,7 +111,8 @@ ilo_clear_depth_stencil(struct pipe_context *pipe,
                         double depth,
                         unsigned stencil,
                         unsigned dstx, unsigned dsty,
-                        unsigned width, unsigned height)
+                        unsigned width, unsigned height,
+                        bool render_condition_enabled)
 {
    struct ilo_context *ilo = ilo_context(pipe);
 
@@ -156,7 +168,7 @@ ilo_blit_resolve_slices_for_hiz(struct ilo_context *ilo,
    unsigned i;
 
    assert(tex->base.target != PIPE_BUFFER &&
-          ilo_texture_can_enable_hiz(tex, level, first_slice, num_slices));
+          ilo_image_can_enable_aux(&tex->image, level));
 
    if (resolve_flags & ILO_TEXTURE_RENDER_WRITE) {
       /*
@@ -180,8 +192,9 @@ ilo_blit_resolve_slices_for_hiz(struct ilo_context *ilo,
       assert(!(resolve_flags & (other_writers | any_reader)));
 
       if (!(resolve_flags & ILO_TEXTURE_CLEAR)) {
+         const uint32_t first_clear_value = ilo_texture_get_slice(tex,
+               level, first_slice)->clear_value;
          bool set_clear_value = false;
-         uint32_t first_clear_value;
 
          for (i = 0; i < num_slices; i++) {
             const struct ilo_texture_slice *slice =
@@ -190,12 +203,8 @@ ilo_blit_resolve_slices_for_hiz(struct ilo_context *ilo,
             if (slice->flags & other_writers) {
                ilo_blitter_rectlist_resolve_hiz(ilo->blitter,
                      res, level, first_slice + i);
-            }
-            else if (i == 0) {
-               first_clear_value = slice->clear_value;
-            }
-            else if (slice->clear_value != first_clear_value &&
-                     (slice->flags & ILO_TEXTURE_RENDER_WRITE)) {
+            } else if (slice->clear_value != first_clear_value &&
+                       (slice->flags & ILO_TEXTURE_RENDER_WRITE)) {
                ilo_blitter_rectlist_resolve_z(ilo->blitter,
                      res, level, first_slice + i);
                set_clear_value = true;