1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Properly handle wireframe mode in RendererRD pipeline cache

Makes wireframe get cached properly so that it doesn't keep being recreated.
Fixes #76237.
This commit is contained in:
Alex
2023-06-13 18:42:07 -05:00
committed by Rémi Verschelde
parent eb86dabee0
commit f74464b767
2 changed files with 3 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ RID PipelineCacheRD::_generate_version(RD::VertexFormatID p_vertex_format_id, RD
RD::PipelineMultisampleState multisample_state_version = multisample_state; RD::PipelineMultisampleState multisample_state_version = multisample_state;
multisample_state_version.sample_count = RD::get_singleton()->framebuffer_format_get_texture_samples(p_framebuffer_format_id, p_render_pass); multisample_state_version.sample_count = RD::get_singleton()->framebuffer_format_get_texture_samples(p_framebuffer_format_id, p_render_pass);
bool wireframe = p_wireframe || rasterization_state.wireframe; bool wireframe = p_wireframe;
RD::PipelineRasterizationState raster_state_version = rasterization_state; RD::PipelineRasterizationState raster_state_version = rasterization_state;
raster_state_version.wireframe = wireframe; raster_state_version.wireframe = wireframe;

View File

@@ -76,6 +76,8 @@ public:
#endif #endif
spin_lock.lock(); spin_lock.lock();
p_wireframe |= rasterization_state.wireframe;
RID result; RID result;
for (uint32_t i = 0; i < version_count; i++) { for (uint32_t i = 0; i < version_count; i++) {
if (versions[i].vertex_id == p_vertex_format_id && versions[i].framebuffer_id == p_framebuffer_format_id && versions[i].wireframe == p_wireframe && versions[i].render_pass == p_render_pass && versions[i].bool_specializations == p_bool_specializations) { if (versions[i].vertex_id == p_vertex_format_id && versions[i].framebuffer_id == p_framebuffer_format_id && versions[i].wireframe == p_wireframe && versions[i].render_pass == p_render_pass && versions[i].bool_specializations == p_bool_specializations) {