Skip to content

Commit

Permalink
StandardStyle : Remove Selector test when changing blend mode
Browse files Browse the repository at this point in the history
This should no longer be necessary now that we ensure `GL_BLEND` is disabled for selection renders.
  • Loading branch information
murraystevenson committed Apr 3, 2024
1 parent 53fcf3b commit 43a9595
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/GafferUI/StandardStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,16 +1129,7 @@ void StandardStyle::renderImage( const Imath::Box2f &box, const IECoreGL::Textur
glPushAttrib( GL_COLOR_BUFFER_BIT );

// As the image is already pre-multiplied we need to change our blend mode.
if( !IECoreGL::Selector::currentSelector() )
{
// Some users have reported crashes that were traced back to this call
// when used on the GL_R32UI data type the `IDRender` selection mode
// uses. The `IDRender` buffer would get corrupted with values that
// didn't correspond to actual gadgets.
// Don't change it when rendering the selection pass since
// blending should not be applied to an integer buffer anyways.
glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA );
}
glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA );

glEnable( GL_TEXTURE_2D );
glActiveTexture( GL_TEXTURE0 );
Expand Down

0 comments on commit 43a9595

Please sign in to comment.