{
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
&(struct anv_graphics_pipeline_create_info) {
.color_attachment_count = MAX_RTS,
.use_repclear = use_repclear,
- .disable_viewport = true,
.disable_vs = true,
.use_rectlist = true
},
.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
.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 });
},
});
- 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);
.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,