aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta_decompress.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-11-22 19:10:15 +0100
committerSamuel Pitoiset <[email protected]>2018-11-29 10:18:55 +0100
commitcc7deb749c17fa50b9fbca118a37457ff31af7d8 (patch)
tree63b7e5b048afc7bf5a0160c090b5c89c1c1f5c18 /src/amd/vulkan/radv_meta_decompress.c
parent6d4f65deeae2a80e7872c8f7684e908f70f72319 (diff)
radv: drop few useless state changes when doing color/depth decompressions
Viewport/scissor don't need to be updated for array textures. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_decompress.c')
-rw-r--r--src/amd/vulkan/radv_meta_decompress.c47
1 files changed, 18 insertions, 29 deletions
diff --git a/src/amd/vulkan/radv_meta_decompress.c b/src/amd/vulkan/radv_meta_decompress.c
index b4f568ba2f8..fe8e114e91b 100644
--- a/src/amd/vulkan/radv_meta_decompress.c
+++ b/src/amd/vulkan/radv_meta_decompress.c
@@ -308,34 +308,6 @@ cleanup:
return res;
}
-static void
-emit_depth_decomp(struct radv_cmd_buffer *cmd_buffer,
- const VkExtent2D *depth_decomp_extent,
- VkPipeline pipeline_h)
-{
- VkCommandBuffer cmd_buffer_h = radv_cmd_buffer_to_handle(cmd_buffer);
-
- radv_CmdBindPipeline(cmd_buffer_h, VK_PIPELINE_BIND_POINT_GRAPHICS,
- pipeline_h);
-
- radv_CmdSetViewport(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkViewport) {
- .x = 0,
- .y = 0,
- .width = depth_decomp_extent->width,
- .height = depth_decomp_extent->height,
- .minDepth = 0.0f,
- .maxDepth = 1.0f
- });
-
- radv_CmdSetScissor(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkRect2D) {
- .offset = { 0, 0 },
- .extent = *depth_decomp_extent,
- });
-
- radv_CmdDraw(cmd_buffer_h, 3, 1, 0, 0);
-}
-
-
enum radv_depth_op {
DEPTH_DECOMPRESS,
DEPTH_RESUMMARIZE,
@@ -388,6 +360,23 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
unreachable("unknown operation");
}
+ radv_CmdBindPipeline(cmd_buffer_h, VK_PIPELINE_BIND_POINT_GRAPHICS,
+ pipeline_h);
+
+ radv_CmdSetViewport(cmd_buffer_h, 0, 1, &(VkViewport) {
+ .x = 0,
+ .y = 0,
+ .width = width,
+ .height = height,
+ .minDepth = 0.0f,
+ .maxDepth = 1.0f
+ });
+
+ radv_CmdSetScissor(cmd_buffer_h, 0, 1, &(VkRect2D) {
+ .offset = { 0, 0 },
+ .extent = { width, height },
+ });
+
for (uint32_t layer = 0; layer < radv_get_layerCount(image, subresourceRange); layer++) {
struct radv_image_view iview;
@@ -442,7 +431,7 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
},
VK_SUBPASS_CONTENTS_INLINE);
- emit_depth_decomp(cmd_buffer, &(VkExtent2D){width, height}, pipeline_h);
+ radv_CmdDraw(cmd_buffer_h, 3, 1, 0, 0);
radv_CmdEndRenderPass(cmd_buffer_h);
radv_DestroyFramebuffer(device_h, fb_h,