void radv_decompress_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
struct radv_image *image,
- VkImageSubresourceRange *subresourceRange);
+ 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);
+ 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);
static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
struct radv_image *image,
VkImageSubresourceRange *subresourceRange,
+ struct radv_sample_locations_state *sample_locs,
enum radv_depth_op op)
{
struct radv_meta_saved_state saved_state;
radv_meta_save(&saved_state, cmd_buffer,
RADV_META_SAVE_GRAPHICS_PIPELINE |
+ RADV_META_SAVE_SAMPLE_LOCATIONS |
RADV_META_SAVE_PASS);
switch (op) {
.extent = { width, height },
});
+ if (sample_locs) {
+ assert(image->flags & VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT);
+
+ /* Set the sample locations specified during explicit or
+ * automatic layout transitions, otherwise the depth decompress
+ * pass uses the default HW locations.
+ */
+ radv_CmdSetSampleLocationsEXT(cmd_buffer_h, &(VkSampleLocationsInfoEXT) {
+ .sampleLocationsPerPixel = sample_locs->per_pixel,
+ .sampleLocationGridSize = sample_locs->grid_size,
+ .sampleLocationsCount = sample_locs->count,
+ .pSampleLocations = sample_locs->locations,
+ });
+ }
+
for (uint32_t layer = 0; layer < radv_get_layerCount(image, subresourceRange); layer++) {
struct radv_image_view iview;
void radv_decompress_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
struct radv_image *image,
- VkImageSubresourceRange *subresourceRange)
+ VkImageSubresourceRange *subresourceRange,
+ struct radv_sample_locations_state *sample_locs)
{
assert(cmd_buffer->queue_family_index == RADV_QUEUE_GENERAL);
- radv_process_depth_image_inplace(cmd_buffer, image, subresourceRange, DEPTH_DECOMPRESS);
+ radv_process_depth_image_inplace(cmd_buffer, image, subresourceRange,
+ sample_locs, DEPTH_DECOMPRESS);
}
void radv_resummarize_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
struct radv_image *image,
- VkImageSubresourceRange *subresourceRange)
+ VkImageSubresourceRange *subresourceRange,
+ struct radv_sample_locations_state *sample_locs)
{
assert(cmd_buffer->queue_family_index == RADV_QUEUE_GENERAL);
- radv_process_depth_image_inplace(cmd_buffer, image, subresourceRange, DEPTH_RESUMMARIZE);
+ radv_process_depth_image_inplace(cmd_buffer, image, subresourceRange,
+ sample_locs, DEPTH_RESUMMARIZE);
}