nv50/ir: silence unsupported TGSI_PROPERTY_CS_FIXED_BLOCK_*
[mesa.git] / src / intel / vulkan / anv_meta_clear.c
index bce9446084457a1fec74393362a6bc86f0bfdd54..eb4e56984c35659388fdb5d423f4c5870fdf63ad 100644 (file)
@@ -44,12 +44,11 @@ meta_clear_begin(struct anv_meta_saved_state *saved_state,
 {
    anv_meta_save(saved_state, cmd_buffer,
                  (1 << VK_DYNAMIC_STATE_VIEWPORT) |
-                 (1 << VK_DYNAMIC_STATE_SCISSOR) |
                  (1 << VK_DYNAMIC_STATE_STENCIL_REFERENCE) |
                  (1 << VK_DYNAMIC_STATE_STENCIL_WRITE_MASK));
 
+   /* Avoid uploading more viewport states than necessary */
    cmd_buffer->state.dynamic.viewport.count = 0;
-   cmd_buffer->state.dynamic.scissor.count = 0;
 }
 
 static void
@@ -212,7 +211,6 @@ create_pipeline(struct anv_device *device,
       &(struct anv_graphics_pipeline_create_info) {
          .color_attachment_count = MAX_RTS,
          .use_repclear = use_repclear,
-         .disable_viewport = true,
          .disable_vs = true,
          .use_rectlist = true
       },
@@ -297,14 +295,15 @@ create_color_pipeline(struct anv_device *device,
       .pAttachments = blend_attachment_state
    };
 
-   /* Disable repclear because we do not want the compiler to replace the
-    * shader. We need the shader to write to the specified color attachment,
-    * but the repclear shader writes to all color attachments.
+   /* Use the repclear shader.  Since the NIR shader we are providing has
+    * exactly one output, that output will get compacted down to binding
+    * table entry 0.  The hard-coded repclear shader is then exactly what
+    * we want regardless of what attachment we are actually clearing.
     */
    return
       create_pipeline(device, samples, vs_nir, fs_nir, &vi_state, &ds_state,
                       &cb_state, &device->meta_state.alloc,
-                      /*use_repclear*/ false, pipeline);
+                      /*use_repclear*/ true, pipeline);
 }
 
 static void
@@ -395,26 +394,6 @@ emit_color_clear(struct anv_cmd_buffer *cmd_buffer,
       .offset = state.offset,
    };
 
-   ANV_CALL(CmdSetViewport)(cmd_buffer_h, 0, 1,
-      (VkViewport[]) {
-         {
-            .x = 0,
-            .y = 0,
-            .width = fb->width,
-            .height = fb->height,
-            .minDepth = 0.0,
-            .maxDepth = 1.0,
-         },
-      });
-
-   ANV_CALL(CmdSetScissor)(cmd_buffer_h, 0, 1,
-      (VkRect2D[]) {
-         {
-            .offset = { 0, 0 },
-            .extent = { fb->width, fb->height },
-         }
-      });
-
    ANV_CALL(CmdBindVertexBuffers)(cmd_buffer_h, 0, 1,
       (VkBuffer[]) { anv_buffer_to_handle(&vertex_buffer) },
       (VkDeviceSize[]) { 0 });
@@ -594,14 +573,6 @@ emit_depthstencil_clear(struct anv_cmd_buffer *cmd_buffer,
          },
       });
 
-   ANV_CALL(CmdSetScissor)(cmd_buffer_h, 0, 1,
-      (VkRect2D[]) {
-         {
-            .offset = { 0, 0 },
-            .extent = { fb->width, fb->height },
-         }
-      });
-
    if (aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
       ANV_CALL(CmdSetStencilReference)(cmd_buffer_h, VK_STENCIL_FACE_FRONT_BIT,
                                        clear_value.stencil);
@@ -812,7 +783,7 @@ anv_cmd_clear_image(struct anv_cmd_buffer *cmd_buffer,
                      .layerCount = 1
                   },
                },
-               cmd_buffer, 0, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+               cmd_buffer, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
 
             VkFramebuffer fb;
             anv_CreateFramebuffer(device_h,