mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-10 21:28:32 +09:00
DirectGLES: gate the replicate blit's stencil pass on ES 3.1
Reading the stencil half of a packed depth/stencil texture goes through GL_DEPTH_STENCIL_TEXTURE_MODE, which is ES 3.1 state. On an older driver the pname would raise GL_INVALID_ENUM and the shader would go on sampling depth bits as if they were stencil, so decline the emulation instead.
This commit is contained in:
@@ -2597,8 +2597,13 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
if (!wantDepth && !wantStencil) {
|
if (!wantDepth && !wantStencil) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Reading the stencil back needs a stencil texture view, which is ES 3.1 state.
|
// Sampling the stencil half of a packed texture goes through
|
||||||
if (wantStencil && !g_GLESFuncs.glTexParameteri) {
|
// GL_DEPTH_STENCIL_TEXTURE_MODE, which is ES 3.1 state; on an older driver the pname
|
||||||
|
// would just raise GL_INVALID_ENUM and the shader would read depth bits as stencil.
|
||||||
|
const Bool supportsStencilTextureMode = g_GLESCapabilities.GLESVersion.Major > 3 ||
|
||||||
|
(g_GLESCapabilities.GLESVersion.Major == 3 &&
|
||||||
|
g_GLESCapabilities.GLESVersion.Minor >= 1);
|
||||||
|
if (wantStencil && !supportsStencilTextureMode) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user