radv: gather info about PS inputs in the shader info pass
[mesa.git] / src / amd / vulkan / radv_meta.h
index 5e0afd11a001709849f2beb26df1979186bffd2b..53c562b5df65f56993c52fffd1ece4d265a95fef 100644 (file)
@@ -39,6 +39,7 @@ enum radv_meta_save_flags {
        RADV_META_SAVE_DESCRIPTORS       = (1 << 2),
        RADV_META_SAVE_GRAPHICS_PIPELINE = (1 << 3),
        RADV_META_SAVE_COMPUTE_PIPELINE  = (1 << 4),
+       RADV_META_SAVE_SAMPLE_LOCATIONS  = (1 << 5),
 };
 
 struct radv_meta_saved_state {
@@ -48,6 +49,7 @@ struct radv_meta_saved_state {
        struct radv_pipeline *old_pipeline;
        struct radv_viewport_state viewport;
        struct radv_scissor_state scissor;
+       struct radv_sample_locations_state sample_location;
 
        char push_constants[128];
 
@@ -167,10 +169,12 @@ void radv_meta_clear_image_cs(struct radv_cmd_buffer *cmd_buffer,
 
 void radv_decompress_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
                                         struct radv_image *image,
-                                        VkImageSubresourceRange *subresourceRange);
+                                        const VkImageSubresourceRange *subresourceRange,
+                                        struct radv_sample_locations_state *sample_locs);
 void radv_resummarize_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
                                          struct radv_image *image,
-                                         VkImageSubresourceRange *subresourceRange);
+                                         const VkImageSubresourceRange *subresourceRange,
+                                         struct radv_sample_locations_state *sample_locs);
 void radv_fast_clear_flush_image_inplace(struct radv_cmd_buffer *cmd_buffer,
                                         struct radv_image *image,
                                         const VkImageSubresourceRange *subresourceRange);
@@ -183,8 +187,10 @@ void radv_expand_fmask_image_inplace(struct radv_cmd_buffer *cmd_buffer,
 
 void radv_meta_resolve_compute_image(struct radv_cmd_buffer *cmd_buffer,
                                     struct radv_image *src_image,
+                                    VkFormat src_format,
                                     VkImageLayout src_image_layout,
                                     struct radv_image *dest_image,
+                                    VkFormat dest_format,
                                     VkImageLayout dest_image_layout,
                                     uint32_t region_count,
                                     const VkImageResolve *regions);
@@ -206,11 +212,43 @@ void radv_decompress_resolve_src(struct radv_cmd_buffer *cmd_buffer,
                                 const VkImageResolve *regions);
 
 uint32_t radv_clear_cmask(struct radv_cmd_buffer *cmd_buffer,
-                         struct radv_image *image, uint32_t value);
+                         struct radv_image *image,
+                         const VkImageSubresourceRange *range, uint32_t value);
 uint32_t radv_clear_fmask(struct radv_cmd_buffer *cmd_buffer,
-                         struct radv_image *image, uint32_t value);
+                         struct radv_image *image,
+                         const VkImageSubresourceRange *range, uint32_t value);
 uint32_t radv_clear_dcc(struct radv_cmd_buffer *cmd_buffer,
-                       struct radv_image *image, uint32_t value);
+                       struct radv_image *image,
+                       const VkImageSubresourceRange *range, 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"