mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-07 19:58:32 +09:00
[Fix] (SelfTest): read the probe-saved texture bindings off the same unit the restore puts them back on
This commit is contained in:
@@ -154,6 +154,12 @@ namespace MobileGL::MG_Util::SelfTest {
|
|||||||
state.depthTest = gl.glIsEnabled(GL_DEPTH_TEST);
|
state.depthTest = gl.glIsEnabled(GL_DEPTH_TEST);
|
||||||
state.blend = gl.glIsEnabled(GL_BLEND);
|
state.blend = gl.glIsEnabled(GL_BLEND);
|
||||||
gl.glGetIntegerv(GL_ACTIVE_TEXTURE, &state.activeTexture);
|
gl.glGetIntegerv(GL_ACTIVE_TEXTURE, &state.activeTexture);
|
||||||
|
// Unit 0 is selected BEFORE the per-unit bindings are read, because Restore puts them
|
||||||
|
// back on unit 0 unconditionally. Reading them off whatever unit happened to be
|
||||||
|
// active and writing them to unit 0 would corrupt unit 0's binding for whoever runs
|
||||||
|
// next - harmless while every probe ran from the POST screen with nothing else using
|
||||||
|
// the context, and not harmless now that one of them runs from a live draw path.
|
||||||
|
if (gl.glActiveTexture != nullptr) gl.glActiveTexture(GL_TEXTURE0);
|
||||||
gl.glGetIntegerv(GL_TEXTURE_BINDING_2D, &state.texture2D);
|
gl.glGetIntegerv(GL_TEXTURE_BINDING_2D, &state.texture2D);
|
||||||
gl.glGetIntegerv(GL_TEXTURE_BINDING_2D_MULTISAMPLE, &state.texture2DMultisample);
|
gl.glGetIntegerv(GL_TEXTURE_BINDING_2D_MULTISAMPLE, &state.texture2DMultisample);
|
||||||
gl.glGetIntegerv(GL_TEXTURE_BINDING_2D_ARRAY, &state.texture2DArray);
|
gl.glGetIntegerv(GL_TEXTURE_BINDING_2D_ARRAY, &state.texture2DArray);
|
||||||
|
|||||||
Reference in New Issue
Block a user