radv: convert all GFX operations to the RADV_META_SAVE_XXX flags
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 3 Oct 2017 12:23:48 +0000 (14:23 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 6 Oct 2017 07:49:05 +0000 (09:49 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta_blit.c
src/amd/vulkan/radv_meta_clear.c
src/amd/vulkan/radv_meta_copy.c
src/amd/vulkan/radv_meta_decompress.c
src/amd/vulkan/radv_meta_fast_clear.c
src/amd/vulkan/radv_meta_resolve.c
src/amd/vulkan/radv_meta_resolve_fs.c

index 7a863fa905489738dc7b1ac70fcadce27d79e713..83424a50ccd942b62cbfae9c227c203d05404346 100644 (file)
@@ -510,7 +510,10 @@ void radv_CmdBlitImage(
        assert(src_image->info.samples == 1);
        assert(dest_image->info.samples == 1);
 
-       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0);
+       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer,
+                                                            RADV_META_SAVE_GRAPHICS_PIPELINE |
+                                                            RADV_META_SAVE_CONSTANTS |
+                                                            RADV_META_SAVE_DESCRIPTORS);
 
        for (unsigned r = 0; r < regionCount; r++) {
                const VkImageSubresourceLayers *src_res = &pRegions[r].srcSubresource;
index 435b104f3475c32e056af4ce8c7779d5258bf2f8..734d75a5f7534ea73773442d6ed63eb6b4a3b17e 100644 (file)
@@ -1145,7 +1145,10 @@ radv_cmd_buffer_clear_subpass(struct radv_cmd_buffer *cmd_buffer)
        if (!radv_subpass_needs_clear(cmd_buffer))
                return;
 
-       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0);
+       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer,
+                                                            RADV_META_SAVE_GRAPHICS_PIPELINE |
+                                                            RADV_META_SAVE_CONSTANTS);
+
 
        for (uint32_t i = 0; i < cmd_state->subpass->color_count; ++i) {
                uint32_t a = cmd_state->subpass->color_attachments[i].attachment;
@@ -1387,7 +1390,10 @@ void radv_CmdClearColorImage(
        if (cs)
                radv_meta_save_compute(&saved_state.compute, cmd_buffer, 16);
        else
-               radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state.gfx, cmd_buffer, ~0);
+               radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state.gfx, cmd_buffer,
+                                                                    RADV_META_SAVE_GRAPHICS_PIPELINE |
+                                                                    RADV_META_SAVE_CONSTANTS);
+
 
        radv_cmd_clear_image(cmd_buffer, image, imageLayout,
                             (const VkClearValue *) pColor,
@@ -1411,7 +1417,10 @@ void radv_CmdClearDepthStencilImage(
        RADV_FROM_HANDLE(radv_image, image, image_h);
        struct radv_meta_saved_state saved_state;
 
-       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0);
+       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer,
+                                                            RADV_META_SAVE_GRAPHICS_PIPELINE |
+                                                            RADV_META_SAVE_CONSTANTS);
+
 
        radv_cmd_clear_image(cmd_buffer, image, imageLayout,
                             (const VkClearValue *) pDepthStencil,
@@ -1435,7 +1444,10 @@ void radv_CmdClearAttachments(
        if (!cmd_buffer->state.subpass)
                return;
 
-       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0);
+       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer,
+                                                            RADV_META_SAVE_GRAPHICS_PIPELINE |
+                                                            RADV_META_SAVE_CONSTANTS);
+
 
        /* FINISHME: We can do better than this dumb loop. It thrashes too much
         * state.
index b5a14f6d9fbca32b0ef62d45043781b21997b22c..d7f521b7472fb0087e1e6414308d79204f19707c 100644 (file)
@@ -123,7 +123,10 @@ meta_copy_buffer_to_image(struct radv_cmd_buffer *cmd_buffer,
        if (cs)
                radv_meta_save_compute(&saved_state.compute, cmd_buffer, 12);
        else
-               radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state.gfx, cmd_buffer, ~0);
+               radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state.gfx, cmd_buffer,
+                                                                    RADV_META_SAVE_GRAPHICS_PIPELINE |
+                                                                    RADV_META_SAVE_CONSTANTS |
+                                                                    RADV_META_SAVE_DESCRIPTORS);
 
        for (unsigned r = 0; r < regionCount; r++) {
 
@@ -342,7 +345,11 @@ meta_copy_image(struct radv_cmd_buffer *cmd_buffer,
        if (cs)
                radv_meta_save_compute(&saved_state.compute, cmd_buffer, 16);
        else
-               radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state.gfx, cmd_buffer, ~0);
+               radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state.gfx, cmd_buffer,
+                                                                    RADV_META_SAVE_GRAPHICS_PIPELINE |
+                                                                    RADV_META_SAVE_CONSTANTS |
+                                                                    RADV_META_SAVE_DESCRIPTORS);
+
 
        for (unsigned r = 0; r < regionCount; r++) {
                assert(pRegions[r].srcSubresource.aspectMask ==
index e14ea908f8a031c3df0c441744ba129ed80982b2..2a5459da06e1016a5bd3e72e37485f53c7843c45 100644 (file)
@@ -317,7 +317,8 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
                return;
        radv_meta_save_pass(&saved_pass_state, cmd_buffer);
 
-       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0);
+       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer,
+                                                            RADV_META_SAVE_GRAPHICS_PIPELINE);
 
        switch (op) {
        case DEPTH_DECOMPRESS:
index 04f5d5fb7591fc0eb7ba074d3901284d64366ecc..b903135b6325ce6a83961ef9c2914500d1cfe384 100644 (file)
@@ -344,7 +344,8 @@ radv_fast_clear_flush_image_inplace(struct radv_cmd_buffer *cmd_buffer,
 
        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, ~0);
+       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer,
+                                                            RADV_META_SAVE_GRAPHICS_PIPELINE);
 
        if (image->fmask.size > 0) {
                pipeline = cmd_buffer->device->meta_state.fast_clear_flush.fmask_decompress_pipeline;
index 14013365e4be3c4edd08fb669cf5f359da7c12dc..0a9f2c5820bc9559a6b602fe309b74fe9235be13 100644 (file)
@@ -365,7 +365,8 @@ void radv_CmdResolveImage(
                return;
        }
 
-       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0);
+       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer,
+                                                            RADV_META_SAVE_GRAPHICS_PIPELINE);
 
        assert(src_image->info.samples > 1);
        if (src_image->info.samples <= 1) {
@@ -573,7 +574,8 @@ radv_cmd_buffer_resolve_subpass(struct radv_cmd_buffer *cmd_buffer)
                return;
        }
 
-       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0);
+       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer,
+                                                            RADV_META_SAVE_GRAPHICS_PIPELINE);
 
        for (uint32_t i = 0; i < subpass->color_count; ++i) {
                VkAttachmentReference src_att = subpass->color_attachments[i];
index 135b539c7a6fcb32f81efe89d264aa0b0cdfba40..152e2265420b965b963eb9357604c070452fe933 100644 (file)
@@ -468,7 +468,10 @@ void radv_meta_resolve_fragment_image(struct radv_cmd_buffer *cmd_buffer,
        }
 
        rp = device->meta_state.resolve_fragment.rc[samples_log2].render_pass[fs_key];
-       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0);
+       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer,
+                                                            RADV_META_SAVE_GRAPHICS_PIPELINE |
+                                                            RADV_META_SAVE_CONSTANTS |
+                                                            RADV_META_SAVE_DESCRIPTORS);
 
        for (uint32_t r = 0; r < region_count; ++r) {
                const VkImageResolve *region = &regions[r];
@@ -595,7 +598,11 @@ radv_cmd_buffer_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer)
        if (!subpass->has_resolve)
                return;
 
-       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer, ~0);
+       radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer,
+                                                            RADV_META_SAVE_GRAPHICS_PIPELINE |
+                                                            RADV_META_SAVE_CONSTANTS |
+                                                            RADV_META_SAVE_DESCRIPTORS);
+
 
        for (uint32_t i = 0; i < subpass->color_count; ++i) {
                VkAttachmentReference src_att = subpass->color_attachments[i];