radv: Dirty all descriptors sets when changing the pipeline.
[mesa.git] / src / amd / vulkan / radv_meta.c
index fb83576fe649d48111b25fe381eb94513f473e00..263181a57f2f0b4b922255517ed099808c1227bf 100644 (file)
@@ -36,6 +36,7 @@ radv_meta_save_novertex(struct radv_meta_saved_state *state,
               uint32_t dynamic_mask)
 {
        state->old_pipeline = cmd_buffer->state.pipeline;
+       state->old_descriptor_set0 = cmd_buffer->state.descriptors[0];
 
        state->dynamic_mask = dynamic_mask;
        radv_dynamic_state_copy(&state->dynamic, &cmd_buffer->state.dynamic,
@@ -49,10 +50,10 @@ void
 radv_meta_restore(const struct radv_meta_saved_state *state,
                  struct radv_cmd_buffer *cmd_buffer)
 {
-       cmd_buffer->state.pipeline = state->old_pipeline;
+       radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer), VK_PIPELINE_BIND_POINT_GRAPHICS,
+                            radv_pipeline_to_handle(state->old_pipeline));
+       cmd_buffer->state.descriptors[0] = state->old_descriptor_set0;
        if (state->vertex_saved) {
-               cmd_buffer->state.descriptors[0] = state->old_descriptor_set0;
-               cmd_buffer->state.descriptors_dirty |= (1u << 0);
                memcpy(cmd_buffer->state.vertex_bindings, state->old_vertex_bindings,
                       sizeof(state->old_vertex_bindings));
                cmd_buffer->state.vb_dirty |= (1 << RADV_META_VERTEX_BINDING_COUNT) - 1;
@@ -113,7 +114,6 @@ radv_meta_restore_compute(const struct radv_meta_saved_compute_state *state,
                             radv_pipeline_to_handle(state->old_pipeline));
 
        cmd_buffer->state.descriptors[0] = state->old_descriptor_set0;
-       cmd_buffer->state.descriptors_dirty |= (1u << 0);
 
        if (push_constant_size) {
                memcpy(cmd_buffer->push_constants, state->push_constants, push_constant_size);
@@ -452,7 +452,7 @@ radv_meta_build_nir_vs_generate_vertices(void)
        nir_variable *v_position;
 
        nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_VERTEX, NULL);
-       b.shader->info->name = ralloc_strdup(b.shader, "meta_vs_gen_verts");
+       b.shader->info.name = ralloc_strdup(b.shader, "meta_vs_gen_verts");
 
        nir_ssa_def *outvec = radv_meta_gen_rect_vertices(&b);
 
@@ -471,7 +471,7 @@ radv_meta_build_nir_fs_noop(void)
        nir_builder b;
 
        nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_FRAGMENT, NULL);
-       b.shader->info->name = ralloc_asprintf(b.shader,
+       b.shader->info.name = ralloc_asprintf(b.shader,
                                               "meta_noop_fs");
 
        return b.shader;