Fix switching SRGB extension happen before binding of texture
Previously, texture parameter `_TEXTURE_SRGB_DECODE_EXT` was changed before the call of `glBindTexture`, which caused modification of previously bound texture instead of desired one. Now it's changed after `glBindTexture`.
This commit is contained in:
parent
042bfabd8f
commit
4ed6e4a70e
1 changed files with 24 additions and 24 deletions
|
@ -1243,7 +1243,13 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
|
||||||
if (t->render_target)
|
if (t->render_target)
|
||||||
t->render_target->used_in_frame = true;
|
t->render_target->used_in_frame = true;
|
||||||
|
|
||||||
if (storage->config.srgb_decode_supported) {
|
target = t->target;
|
||||||
|
tex = t->tex_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
glBindTexture(target, tex);
|
||||||
|
|
||||||
|
if (t && storage->config.srgb_decode_supported) {
|
||||||
//if SRGB decode extension is present, simply switch the texture to whathever is needed
|
//if SRGB decode extension is present, simply switch the texture to whathever is needed
|
||||||
bool must_srgb = false;
|
bool must_srgb = false;
|
||||||
|
|
||||||
|
@ -1267,12 +1273,6 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
target = t->target;
|
|
||||||
tex = t->tex_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
glBindTexture(target, tex);
|
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
state.current_main_tex = tex;
|
state.current_main_tex = tex;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue