Merge pull request #53369 from RandomShaper/fix_shader_state_3.x

[3.x] Reset scene conditionals assumed to be false
This commit is contained in:
Rémi Verschelde 2021-10-04 17:31:25 +02:00 committed by GitHub
commit 37847eb94d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -1924,8 +1924,6 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
state.current_depth_test = true; state.current_depth_test = true;
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
state.scene_shader.set_conditional(SceneShaderGLES3::USE_SKELETON, false);
state.current_blend_mode = -1; state.current_blend_mode = -1;
state.current_line_width = -1; state.current_line_width = -1;
state.current_depth_draw = -1; state.current_depth_draw = -1;
@ -1938,16 +1936,20 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
int current_blend_mode = -1; int current_blend_mode = -1;
uint32_t prev_shading = 0xFFFFFFFF; uint32_t prev_shading = 0xFFFFFFFF;
RasterizerStorageGLES3::Skeleton *prev_skeleton = nullptr;
state.scene_shader.set_conditional(SceneShaderGLES3::SHADELESS, true); //by default unshaded (easier to set) state.scene_shader.set_conditional(SceneShaderGLES3::SHADELESS, true); //by default unshaded (easier to set)
RasterizerStorageGLES3::Skeleton *prev_skeleton = nullptr;
state.scene_shader.set_conditional(SceneShaderGLES3::USE_SKELETON, false);
bool first = true; bool first = true;
bool prev_use_instancing = false; bool prev_use_instancing = false;
state.scene_shader.set_conditional(SceneShaderGLES3::USE_INSTANCING, false);
bool prev_octahedral_compression = false; bool prev_octahedral_compression = false;
state.scene_shader.set_conditional(SceneShaderGLES3::ENABLE_OCTAHEDRAL_COMPRESSION, false);
storage->info.render.draw_call_count += p_element_count; storage->info.render.draw_call_count += p_element_count;
bool prev_opaque_prepass = false; bool prev_opaque_prepass = false;
state.scene_shader.set_conditional(SceneShaderGLES3::USE_OPAQUE_PREPASS, false);
for (int i = 0; i < p_element_count; i++) { for (int i = 0; i < p_element_count; i++) {
RenderList::Element *e = p_elements[i]; RenderList::Element *e = p_elements[i];