radv: emit framebuffer state from primary if secondary doesn't inherit it
[mesa.git] / src / amd / vulkan / radv_meta.h
index d58b08514fe1b39862a970da9ae945b925eab3a9..5880064ff30ed307db72ec0d1725b98fb42f6d75 100644 (file)
@@ -218,10 +218,39 @@ uint32_t radv_clear_fmask(struct radv_cmd_buffer *cmd_buffer,
 uint32_t radv_clear_dcc(struct radv_cmd_buffer *cmd_buffer,
                        struct radv_image *image,
                        const VkImageSubresourceRange *range, uint32_t value);
+uint32_t radv_dcc_clear_level(struct radv_cmd_buffer *cmd_buffer,
+                             const struct radv_image *image,
+                             uint32_t level, uint32_t value);
 uint32_t radv_clear_htile(struct radv_cmd_buffer *cmd_buffer,
                          struct radv_image *image,
                          const VkImageSubresourceRange *range, uint32_t value);
 
+/**
+ * Return whether the bound pipeline is the FMASK decompress pass.
+ */
+static inline bool
+radv_is_fmask_decompress_pipeline(struct radv_cmd_buffer *cmd_buffer)
+{
+       struct radv_meta_state *meta_state = &cmd_buffer->device->meta_state;
+       struct radv_pipeline *pipeline = cmd_buffer->state.pipeline;
+
+       return radv_pipeline_to_handle(pipeline) ==
+              meta_state->fast_clear_flush.fmask_decompress_pipeline;
+}
+
+/**
+ * Return whether the bound pipeline is the DCC decompress pass.
+ */
+static inline bool
+radv_is_dcc_decompress_pipeline(struct radv_cmd_buffer *cmd_buffer)
+{
+       struct radv_meta_state *meta_state = &cmd_buffer->device->meta_state;
+       struct radv_pipeline *pipeline = cmd_buffer->state.pipeline;
+
+       return radv_pipeline_to_handle(pipeline) ==
+              meta_state->fast_clear_flush.dcc_decompress_pipeline;
+}
+
 /* common nir builder helpers */
 #include "nir/nir_builder.h"