Merge pull request #37667 from clayjohn/GLES2-32-skeleton-rebind
Avoid material rebind when using skeleton
This commit is contained in:
commit
02ed72c373
|
@ -2451,7 +2451,7 @@ void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements,
|
|||
RasterizerStorageGLES2::Skeleton *skeleton = storage->skeleton_owner.getornull(e->instance->skeleton);
|
||||
|
||||
if (skeleton != prev_skeleton) {
|
||||
|
||||
if ((prev_skeleton == NULL) != (skeleton == NULL)) {
|
||||
if (skeleton) {
|
||||
state.scene_shader.set_conditional(SceneShaderGLES2::USE_SKELETON, true);
|
||||
state.scene_shader.set_conditional(SceneShaderGLES2::USE_SKELETON_SOFTWARE, storage->config.use_skeleton_software);
|
||||
|
@ -2459,9 +2459,9 @@ void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements,
|
|||
state.scene_shader.set_conditional(SceneShaderGLES2::USE_SKELETON, false);
|
||||
state.scene_shader.set_conditional(SceneShaderGLES2::USE_SKELETON_SOFTWARE, false);
|
||||
}
|
||||
|
||||
rebind = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (e->owner != prev_owner || e->geometry != prev_geometry || skeleton != prev_skeleton) {
|
||||
_setup_geometry(e, skeleton);
|
||||
|
|
Loading…
Reference in New Issue