mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-20 00:11:56 +09:00
[Fix] (Espryt): keep the invalid-image placeholder on ANGLE instead of probing an empty unit it faults on
This commit is contained in:
@@ -2125,24 +2125,30 @@ namespace MobileGL::MG_Util::BackendLoader {
|
||||
? "true (the subgroup emulation reads its scratch through atomic loads)"
|
||||
: "false");
|
||||
|
||||
caps.IsAngleRenderer = caps.GLESRendererString.find("ANGLE") != String::npos;
|
||||
|
||||
switch (MG_Config::Features.EsprytInvalidImagePlaceholder) {
|
||||
case MG_Config::QuirkOverride::ForceOn:
|
||||
caps.EmptyImageUnitsReadNonzero = true;
|
||||
caps.UseInvalidImagePlaceholder = true;
|
||||
break;
|
||||
case MG_Config::QuirkOverride::ForceOff:
|
||||
caps.EmptyImageUnitsReadNonzero = false;
|
||||
caps.UseInvalidImagePlaceholder = false;
|
||||
break;
|
||||
case MG_Config::QuirkOverride::Auto:
|
||||
default:
|
||||
caps.EmptyImageUnitsReadNonzero = SelfTest::EmptyImageUnitsReadNonzero(glesFuncs);
|
||||
// ANGLE dereferences a null texture when a dispatch or draw reaches an EMPTY image
|
||||
// unit the program uses, so the probe cannot be run there: its subject variant is
|
||||
// exactly that dispatch, and a crash is no verdict. ANGLE keeps the placeholder
|
||||
// without being asked.
|
||||
caps.UseInvalidImagePlaceholder =
|
||||
caps.IsAngleRenderer || SelfTest::EmptyImageUnitsReadNonzero(glesFuncs);
|
||||
break;
|
||||
}
|
||||
MGLOG_I(" Empty image units read nonzero: %s",
|
||||
caps.EmptyImageUnitsReadNonzero
|
||||
? "true (an invalid image unit is bound to a zeroed placeholder)"
|
||||
: "false");
|
||||
MGLOG_I(" Invalid image units bound to a placeholder: %s",
|
||||
!caps.UseInvalidImagePlaceholder ? "false (an invalid image unit stays empty)"
|
||||
: caps.IsAngleRenderer ? "true (ANGLE faults on a use of an empty image unit)"
|
||||
: "true (empty image units read nonzero)");
|
||||
|
||||
caps.IsAngleRenderer = caps.GLESRendererString.find("ANGLE") != String::npos;
|
||||
caps.IsAngleLlvmpipeRenderer =
|
||||
caps.IsAngleRenderer && caps.GLESRendererString.find("llvmpipe") != String::npos;
|
||||
caps.AvoidSamplerMipmapMinFilter =
|
||||
|
||||
@@ -1329,11 +1329,12 @@ namespace MobileGL {
|
||||
// Adreno). The subgroup emulation then reads its scratch through atomic loads.
|
||||
// Defaults FALSE: never assumed broken on an unmeasured driver.
|
||||
Bool SharedMemoryLoadsGoStale = false;
|
||||
// True when a load through an EMPTY image unit returns a nonzero texel
|
||||
// (SelfTest::EmptyImageUnitsReadNonzero - measured on Adreno: alpha 1). DirectGLES
|
||||
// then binds an invalid unit to a zeroed placeholder instead of leaving it empty.
|
||||
// Defaults FALSE: never assumed broken on an unmeasured driver.
|
||||
Bool EmptyImageUnitsReadNonzero = false;
|
||||
// True when DirectGLES binds an invalid image unit to a zeroed placeholder instead of
|
||||
// leaving it empty: on a driver whose load through an EMPTY unit returns a nonzero
|
||||
// texel (SelfTest::EmptyImageUnitsReadNonzero - measured on Adreno: alpha 1), and on
|
||||
// ANGLE, which faults on a dispatch or draw that reaches an empty unit and so cannot
|
||||
// be probed. Defaults FALSE: never assumed broken on an unmeasured driver.
|
||||
Bool UseInvalidImagePlaceholder = false;
|
||||
Int UniformBufferOffsetAlignment = 256;
|
||||
// Its storage-buffer counterpart, queried separately because it is a separate limit:
|
||||
// Adreno 830 answers 32 for GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT and 64 for
|
||||
|
||||
Reference in New Issue
Block a user