Skip to content

Commit

Permalink
Merge pull request #37667 from clayjohn/GLES2-32-skeleton-rebind
Browse files Browse the repository at this point in the history
Avoid material rebind when using skeleton
  • Loading branch information
akien-mga authored Apr 7, 2020
2 parents df87601 + 4d32652 commit 02ed72c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions drivers/gles2/rasterizer_scene_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2451,16 +2451,16 @@ void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements,
RasterizerStorageGLES2::Skeleton *skeleton = storage->skeleton_owner.getornull(e->instance->skeleton);

if (skeleton != prev_skeleton) {

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);
} else {
state.scene_shader.set_conditional(SceneShaderGLES2::USE_SKELETON, false);
state.scene_shader.set_conditional(SceneShaderGLES2::USE_SKELETON_SOFTWARE, false);
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);
} else {
state.scene_shader.set_conditional(SceneShaderGLES2::USE_SKELETON, false);
state.scene_shader.set_conditional(SceneShaderGLES2::USE_SKELETON_SOFTWARE, false);
}
rebind = true;
}

rebind = true;
}

if (e->owner != prev_owner || e->geometry != prev_geometry || skeleton != prev_skeleton) {
Expand Down

0 comments on commit 02ed72c

Please sign in to comment.