[Fix] (DirectGLES): request the point-size extension a tessellation or geometry stage's ESSL needs

This commit is contained in:
2026-08-27 15:06:01 -04:00
parent 62695ee3c2
commit e42e7d00f5
5 changed files with 158 additions and 6 deletions
@@ -984,6 +984,20 @@ namespace MobileGL::MG_Util::BackendLoader {
if (std::strcmp(extension, "GL_OES_viewport_array") == 0) {
caps.SupportsViewportArray = true;
}
// EXT wins where both are advertised: it is the spelling the Android Extension
// Pack mandates, so it is the one a driver is most likely to have tested.
if (std::strcmp(extension, "GL_EXT_tessellation_point_size") == 0) {
caps.TessellationPointSizeSupport = MG_External::GLESCapabilities::PointSizeTier::ExtensionEXT;
} else if (std::strcmp(extension, "GL_OES_tessellation_point_size") == 0 &&
caps.TessellationPointSizeSupport == MG_External::GLESCapabilities::PointSizeTier::None) {
caps.TessellationPointSizeSupport = MG_External::GLESCapabilities::PointSizeTier::ExtensionOES;
}
if (std::strcmp(extension, "GL_EXT_geometry_point_size") == 0) {
caps.GeometryPointSizeSupport = MG_External::GLESCapabilities::PointSizeTier::ExtensionEXT;
} else if (std::strcmp(extension, "GL_OES_geometry_point_size") == 0 &&
caps.GeometryPointSizeSupport == MG_External::GLESCapabilities::PointSizeTier::None) {
caps.GeometryPointSizeSupport = MG_External::GLESCapabilities::PointSizeTier::ExtensionOES;
}
}
}
// The pointer check on top of the extension check makes each flag sufficient on its own
@@ -1055,6 +1069,19 @@ namespace MobileGL::MG_Util::BackendLoader {
MGLOG_I(" clip distances (EXT_clip_cull_distance): %s", caps.SupportsClipDistance ? "yes" : "no");
MGLOG_I(" viewport array (OES_viewport_array; gl_ViewportIndex collapses to viewport 0 when absent): %s",
caps.SupportsViewportArray ? "yes" : "no");
{
const auto pointSizeTierName = [](MG_External::GLESCapabilities::PointSizeTier tier) {
switch (tier) {
case MG_External::GLESCapabilities::PointSizeTier::ExtensionEXT: return "EXT";
case MG_External::GLESCapabilities::PointSizeTier::ExtensionOES: return "OES";
default: return "no";
}
};
MGLOG_I(" tessellation gl_PointSize (EXT/OES_tessellation_point_size): %s",
pointSizeTierName(caps.TessellationPointSizeSupport));
MGLOG_I(" geometry gl_PointSize (EXT/OES_geometry_point_size): %s",
pointSizeTierName(caps.GeometryPointSizeSupport));
}
// LOAD-BEARING STRING, not just a banner. android-plugin/trace-replay-ci.sh's
// is_angle_surface_lost() greps mobilegl.log for exactly "OpenGL ES capabilities:" to
@@ -1118,6 +1118,23 @@ namespace MobileGL {
ExtensionOES, // GL_OES_texture_buffer; ESSL below 320 must say GL_OES_texture_buffer
};
TextureBufferTier TextureBufferSupport = TextureBufferTier::None;
// Which spelling of per-vertex point size a NON-VERTEX stage has, if any. In desktop
// GL gl_PointSize is an ordinary gl_PerVertex member that any vertex-processing stage
// may write and any program may capture by name; in ESSL it does not EXIST in a
// tessellation or geometry stage until GL_EXT/OES_tessellation_point_size (resp.
// ..._geometry_point_size) is requested - not even at 320, where the stages
// themselves are core. SPIRV-Cross prints the identifier bare and asks for nothing,
// exactly as it does for gl_ViewportIndex, so the directive has to be inserted into
// the emitted source (RequestPointSizeExtension) and a driver with neither spelling
// cannot compile such a stage at all. Extension string only: these add no entry
// points, so there is no pointer to require.
enum class PointSizeTier : Uint8 {
None = 0, // neither spelling; the stage cannot name gl_PointSize
ExtensionEXT, // GL_EXT_tessellation_point_size / GL_EXT_geometry_point_size
ExtensionOES, // GL_OES_tessellation_point_size / GL_OES_geometry_point_size
};
PointSizeTier TessellationPointSizeSupport = PointSizeTier::None;
PointSizeTier GeometryPointSizeSupport = PointSizeTier::None;
// GL_MAX_TEXTURE_BUFFER_SIZE actually came back from the driver. False means the value
// below is MobileGL's own floor, not a driver answer: the pname is only legal once
// buffer textures exist, and querying it on a driver without them raises