Skip to content

Commit 41c55f0

Browse files
committed
Merge pull request #97811 from DarioSamo/2d-msaa-fix
Configure MSAA properly in canvas renderer's pipelines.
2 parents f6dbc04 + fa1aacb commit 41c55f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1446,6 +1446,9 @@ void RendererCanvasRenderRD::CanvasShaderData::_create_pipeline(PipelineKey p_pi
14461446

14471447
blend_state.attachments.push_back(attachment);
14481448

1449+
RD::PipelineMultisampleState multisample_state;
1450+
multisample_state.sample_count = RD::get_singleton()->framebuffer_format_get_texture_samples(p_pipeline_key.framebuffer_format_id, 0);
1451+
14491452
// Convert the specialization from the key to pipeline specialization constants.
14501453
Vector<RD::PipelineSpecializationConstant> specialization_constants;
14511454
RD::PipelineSpecializationConstant sc;
@@ -1457,7 +1460,7 @@ void RendererCanvasRenderRD::CanvasShaderData::_create_pipeline(PipelineKey p_pi
14571460
RID shader_rid = get_shader(p_pipeline_key.variant, p_pipeline_key.ubershader);
14581461
ERR_FAIL_COND(shader_rid.is_null());
14591462

1460-
RID pipeline = RD::get_singleton()->render_pipeline_create(shader_rid, p_pipeline_key.framebuffer_format_id, p_pipeline_key.vertex_format_id, p_pipeline_key.render_primitive, RD::PipelineRasterizationState(), RD::PipelineMultisampleState(), RD::PipelineDepthStencilState(), blend_state, dynamic_state_flags, 0, specialization_constants);
1463+
RID pipeline = RD::get_singleton()->render_pipeline_create(shader_rid, p_pipeline_key.framebuffer_format_id, p_pipeline_key.vertex_format_id, p_pipeline_key.render_primitive, RD::PipelineRasterizationState(), multisample_state, RD::PipelineDepthStencilState(), blend_state, dynamic_state_flags, 0, specialization_constants);
14611464
ERR_FAIL_COND(pipeline.is_null());
14621465

14631466
pipeline_hash_map.add_compiled_pipeline(p_pipeline_key.hash(), pipeline);

0 commit comments

Comments
 (0)