radv: store the dynamic state mask into radv_dynamic_state
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 13 Sep 2017 10:10:00 +0000 (12:10 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 26 Oct 2017 07:37:03 +0000 (09:37 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_private.h

index ed0a726380b9df3d1a7b0de50877da4b8ec11a78..7e5da5485b3db00d882bf544f59f4271a54a17e8 100644 (file)
@@ -80,9 +80,10 @@ const struct radv_dynamic_state default_dynamic_state = {
 
 static void
 radv_dynamic_state_copy(struct radv_dynamic_state *dest,
-                       const struct radv_dynamic_state *src,
-                       uint32_t copy_mask)
+                       const struct radv_dynamic_state *src)
 {
+       uint32_t copy_mask = src->mask;
+
        /* Make sure to copy the number of viewports/scissors because they can
         * only be specified at pipeline creation time.
         */
@@ -2531,10 +2532,9 @@ void radv_CmdBindPipeline(
                cmd_buffer->push_constant_stages |= pipeline->active_stages;
 
                /* Apply the dynamic state from the pipeline */
-               cmd_buffer->state.dirty |= pipeline->dynamic_state_mask;
+               cmd_buffer->state.dirty |= pipeline->dynamic_state.mask;
                radv_dynamic_state_copy(&cmd_buffer->state.dynamic,
-                                       &pipeline->dynamic_state,
-                                       pipeline->dynamic_state_mask);
+                                       &pipeline->dynamic_state);
 
                if (pipeline->graphics.esgs_ring_size > cmd_buffer->esgs_ring_size_needed)
                        cmd_buffer->esgs_ring_size_needed = pipeline->graphics.esgs_ring_size;
index 2096c994a58b6da8c177c393b38156fc7d8278ae..c25642c9667531ca8b0bc421ce86a43d5d6a3857 100644 (file)
@@ -1137,7 +1137,7 @@ radv_pipeline_init_dynamic_state(struct radv_pipeline *pipeline,
                }
        }
 
-       pipeline->dynamic_state_mask = states;
+       pipeline->dynamic_state.mask = states;
 }
 
 static void calculate_gfx9_gs_info(const VkGraphicsPipelineCreateInfo *pCreateInfo,
index e80c47482c62c73de9576b0e42af34b1da051330..18e057dffbb276476c507cf87acfbdfad4a91f57 100644 (file)
@@ -733,6 +733,12 @@ struct radv_scissor_state {
 };
 
 struct radv_dynamic_state {
+       /**
+        * Bitmask of (1 << VK_DYNAMIC_STATE_*).
+        * Defines the set of saved dynamic state.
+        */
+       uint32_t mask;
+
        struct radv_viewport_state                        viewport;
 
        struct radv_scissor_state                         scissor;
@@ -1091,7 +1097,6 @@ struct radv_vertex_elements_info {
 
 struct radv_pipeline {
        struct radv_device *                          device;
-       uint32_t                                     dynamic_state_mask;
        struct radv_dynamic_state                     dynamic_state;
 
        struct radv_pipeline_layout *                 layout;