memcpy(state->push_constants, cmd_buffer->push_constants,
MAX_PUSH_CONSTANTS_SIZE);
}
+
+ if (state->flags & RADV_META_SAVE_PASS) {
+ state->pass = cmd_buffer->state.pass;
+ state->subpass = cmd_buffer->state.subpass;
+ state->framebuffer = cmd_buffer->state.framebuffer;
+ state->attachments = cmd_buffer->state.attachments;
+ state->render_area = cmd_buffer->state.render_area;
+ }
}
void
cmd_buffer->push_constant_stages |= VK_SHADER_STAGE_ALL_GRAPHICS |
VK_SHADER_STAGE_COMPUTE_BIT;
}
-}
-
-void
-radv_meta_save_pass(struct radv_meta_saved_pass_state *state,
- const struct radv_cmd_buffer *cmd_buffer)
-{
- state->pass = cmd_buffer->state.pass;
- state->subpass = cmd_buffer->state.subpass;
- state->framebuffer = cmd_buffer->state.framebuffer;
- state->attachments = cmd_buffer->state.attachments;
- state->render_area = cmd_buffer->state.render_area;
-}
-void
-radv_meta_restore_pass(const struct radv_meta_saved_pass_state *state,
- struct radv_cmd_buffer *cmd_buffer)
-{
- cmd_buffer->state.pass = state->pass;
- cmd_buffer->state.subpass = state->subpass;
- cmd_buffer->state.framebuffer = state->framebuffer;
- cmd_buffer->state.attachments = state->attachments;
- cmd_buffer->state.render_area = state->render_area;
- if (state->subpass)
- radv_emit_framebuffer_state(cmd_buffer);
+ if (state->flags & RADV_META_SAVE_PASS) {
+ cmd_buffer->state.pass = state->pass;
+ cmd_buffer->state.subpass = state->subpass;
+ cmd_buffer->state.framebuffer = state->framebuffer;
+ cmd_buffer->state.attachments = state->attachments;
+ cmd_buffer->state.render_area = state->render_area;
+ if (state->subpass)
+ radv_emit_framebuffer_state(cmd_buffer);
+ }
}
void
struct radv_scissor_state scissor;
char push_constants[128];
-};
-struct radv_meta_saved_pass_state {
struct radv_render_pass *pass;
const struct radv_subpass *subpass;
struct radv_attachment_state *attachments;
void radv_meta_restore(const struct radv_meta_saved_state *state,
struct radv_cmd_buffer *cmd_buffer);
-void radv_meta_save_pass(struct radv_meta_saved_pass_state *state,
- const struct radv_cmd_buffer *cmd_buffer);
-
-void radv_meta_restore_pass(const struct radv_meta_saved_pass_state *state,
- struct radv_cmd_buffer *cmd_buffer);
-
void radv_meta_save_compute(struct radv_meta_saved_compute_state *state,
const struct radv_cmd_buffer *cmd_buffer,
unsigned push_constant_size);
enum radv_depth_op op)
{
struct radv_meta_saved_state saved_state;
- struct radv_meta_saved_pass_state saved_pass_state;
VkDevice device_h = radv_device_to_handle(cmd_buffer->device);
VkCommandBuffer cmd_buffer_h = radv_cmd_buffer_to_handle(cmd_buffer);
uint32_t width = radv_minify(image->info.width,
if (!image->surface.htile_size)
return;
- radv_meta_save_pass(&saved_pass_state, cmd_buffer);
radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer,
- RADV_META_SAVE_GRAPHICS_PIPELINE);
+ RADV_META_SAVE_GRAPHICS_PIPELINE |
+ RADV_META_SAVE_PASS);
switch (op) {
case DEPTH_DECOMPRESS:
&cmd_buffer->pool->alloc);
}
radv_meta_restore(&saved_state, cmd_buffer);
- radv_meta_restore_pass(&saved_pass_state, cmd_buffer);
}
void radv_decompress_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
const VkImageSubresourceRange *subresourceRange)
{
struct radv_meta_saved_state saved_state;
- struct radv_meta_saved_pass_state saved_pass_state;
VkDevice device_h = radv_device_to_handle(cmd_buffer->device);
VkCommandBuffer cmd_buffer_h = radv_cmd_buffer_to_handle(cmd_buffer);
uint32_t layer_count = radv_get_layerCount(image, subresourceRange);
VkPipeline pipeline;
assert(cmd_buffer->queue_family_index == RADV_QUEUE_GENERAL);
- radv_meta_save_pass(&saved_pass_state, cmd_buffer);
+
radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer,
- RADV_META_SAVE_GRAPHICS_PIPELINE);
+ RADV_META_SAVE_GRAPHICS_PIPELINE |
+ RADV_META_SAVE_PASS);
if (image->fmask.size > 0) {
pipeline = cmd_buffer->device->meta_state.fast_clear_flush.fmask_decompress_pipeline;
radv_emit_set_predication_state_from_image(cmd_buffer, image, false);
}
radv_meta_restore(&saved_state, cmd_buffer);
- radv_meta_restore_pass(&saved_pass_state, cmd_buffer);
}