1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00
JUCE/modules
reuk 5eba9a6434
OpenGL: Clear bound texture after rendering transparency layer
A change introduced in 00836d1e94 meant
that GL renderers could sometimes assert in
StateHelpers::ActiveTextures::bindTexture() when ending a transparency
layer.

Specifically, the issue was provoked by adding the ScopedTextureBinding
in the constructor of OpenGLFrameBuffer. This reset the bound texture
after creating a new transparency layer.

I think the previous implementation worked by accident, not by design.
It so happens that when rendering multiple transparency layers within
the same frame (i.e. calling begin/end several times in that order,
*not* nesting the calls), the same texture ID will generally get reused.

From the graphics context's (GC's) perspective, we create a texture with
ID "2", then call bindTexture() to bind it, and the GC remembers that
this ID is bound. We draw the frame, and the texture gets destroyed. The
call to glDeleteTextures() will cause the default texture, "0", to be
bound if the texture being destroyed is bound at the point of
destruction. So, after the texture is destroyed, the GC's stored binding
no longer reflects reality, since texture "0" is now bound.

The next time we create a texture, that texture also gets created with
ID "2". Previously, we would leave this texture bound after
construction, but now we re-bind the previously-bound texture, "0". This
causes the assertion in bindTexture() to fire when we next attempt to
bind texture "2", since the actual bound texture is "0".

The solution added in this patch will bind texture "0" when the
transparency layer image is destroyed, in order to keep the GC's view of
the GL context consistent with the real state.
2025-08-14 14:13:09 +01:00
..
juce_analytics Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
juce_animation Bump version number to 8.0.8 2025-06-02 09:24:54 +01:00
juce_audio_basics Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
juce_audio_devices Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
juce_audio_formats Fix compilation when JUCE_USE_LAME_AUDIO_FORMAT=1 2025-06-17 10:13:52 +02:00
juce_audio_plugin_client AU Client: Improve AUChannelInfo reporting and add tests 2025-08-14 14:13:09 +01:00
juce_audio_processors AU Client: Improve AUChannelInfo reporting and add tests 2025-08-14 14:13:09 +01:00
juce_audio_utils Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
juce_box2d Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
juce_core String: Fix a bug in calculating the number of significant digits for exact powers of 10 2025-08-13 13:11:36 +01:00
juce_cryptography Bump version number to 8.0.8 2025-06-02 09:24:54 +01:00
juce_data_structures Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
juce_dsp Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
juce_events Android: Refactor lifecycle callbacks to reduce repetition in lifecycle listener registration 2025-07-29 15:04:15 +01:00
juce_graphics Graphics: Use unique_ptr instead of raw pointers in RenderingHelpers 2025-08-14 14:13:09 +01:00
juce_gui_basics Linux: Implement support for extra mouse buttons 2025-08-13 15:38:21 +01:00
juce_gui_extra Linux: Fix XEmbedComponent::setVisible 2025-07-30 11:18:39 +02:00
juce_javascript Bump version number to 8.0.8 2025-06-02 09:24:54 +01:00
juce_midi_ci Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
juce_opengl OpenGL: Clear bound texture after rendering transparency layer 2025-08-14 14:13:09 +01:00
juce_osc Bump version number to 8.0.8 2025-06-02 09:24:54 +01:00
juce_product_unlocking Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
juce_video Android: Refactor lifecycle callbacks to reduce repetition in lifecycle listener registration 2025-07-29 15:04:15 +01:00
CMakeLists.txt Javascript: Move javascript implementation into a separate module 2024-11-07 09:53:10 +00:00