mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 12:18:30 +09:00
Rows in each backend section now sort FAIL -> WARN -> PASS -> INFO (stable within groups), with identity strings always last: the device strings renamed to 'Backend driver reported GL_*' and a new bottom group 'MobileGL reported GL_VENDOR/GL_VERSION/GL_RENDERER/GL_EXTENSIONS' showing exactly what MobileGL advertises to applications on that backend, assembled from the same sources as GL_Getter and the backend objects (extension-list construction extracted into shared helpers so POST cannot drift from the real advertisement). Rows probing the same subject are merged into single verdicts whose details keep every sub-fact and causal chain: the six EGL setup steps become one 'ES3 context' row, extension presence + functional probe become one 'Timer queries' row per backend (including the MOBILEGL_DISABLE_TIMERQUERY override explanation), and the Vulkan loader/instance, surface-extension pair, and physical-device/queue/API chains each collapse into one row. Capability rows previously dumped as INFO now carry verdicts: index type uint8 (WARN when absent - uint8 index buffers have no conversion fallback), VK_KHR_draw_indirect_count (WARN when absent - count draws degrade to CPU readback loops); buffer_storage/base_instance stay honest INFO when absent since no MobileGL path degrades. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
72 lines
3.5 KiB
C++
72 lines
3.5 KiB
C++
// MobileGL - MobileGL/MG_Backend/DirectGLES/BackendObject_DirectGLES.h
|
|
// Copyright (c) 2025-2026 MobileGL-Dev
|
|
// Licensed under the GNU Lesser General Public License v3.0:
|
|
// https://www.gnu.org/licenses/gpl-3.0.txt
|
|
// https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
// SPDX-License-Identifier: LGPL-3.0-only
|
|
// End of Source File Header
|
|
|
|
#pragma once
|
|
#include <Includes.h>
|
|
#include "../BackendObject.h"
|
|
#include <MG_Util/BackendLoaders/OpenGL/Loader.h>
|
|
|
|
namespace MobileGL::MG_Backend::DirectGLES {
|
|
class BackendObject_DirectGLES : public BackendObject {
|
|
public:
|
|
~BackendObject_DirectGLES() override;
|
|
|
|
void Initialize() override;
|
|
Bool InitCapabilities() override;
|
|
Bool InitWindowSurface() override;
|
|
Bool InitializeEGLDisplay(EGLDisplay dpy, EGLint* major, EGLint* minor) override;
|
|
Bool CreateEGLWindowSurface(EGLSurface surface, const WindowHandle& handle) override;
|
|
Bool CreateEGLPbufferSurface(EGLSurface surface, EGLint width, EGLint height) override;
|
|
Bool MakeEGLCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) override;
|
|
Bool SwapEGLBuffers(EGLDisplay dpy, EGLSurface draw) override;
|
|
void ReleaseEGLSurface(EGLSurface surface) override;
|
|
void ReleaseEGLResources() override;
|
|
|
|
const RendererInfo& GetRendererInfo() const override;
|
|
String GetBackendAPIVersionString() const override;
|
|
const GlobalBackendFunctionsTable& GetBackendFunctions() const override;
|
|
const DynamicBackendParameters& GetDynamicParameters() const override;
|
|
BackendType GetBackendType() const override;
|
|
|
|
const MG_External::GLESFunctionsTable& GetGLESFunctions() const;
|
|
const MG_External::EGLFunctionsTable& GetEGLFunctions() const;
|
|
|
|
private:
|
|
void UpdateDynamicBackendParameters();
|
|
Bool InitPbufferSurface(EGLint width, EGLint height) override;
|
|
void OnEGLSurfaceReleased(EGLSurface surface) override;
|
|
|
|
Bool m_initialized = false;
|
|
MG_External::EGLFunctionsTable m_EGLFunctions;
|
|
MG_External::GLESFunctionsTable m_GLESFunctions;
|
|
MG_External::GLESCapabilities m_GLESCapabilities;
|
|
DynamicBackendParameters m_dynamicParameters;
|
|
};
|
|
|
|
// Single-source-of-truth helpers shared with the driver POST
|
|
// (MG_Util/SelfTest/DriverPost.cpp), so the identity strings and extension list
|
|
// MobileGL reports to applications on this backend cannot drift from what the
|
|
// POST screen shows.
|
|
|
|
// Static identity of the Espryt renderer (renderer/backend names, target GL/GLSL
|
|
// versions, ExtraVendor). The Extensions vector inside is live backend state that
|
|
// is reconciled after capability init; callers that need the advertised list for
|
|
// a known capability set must use BuildAdvertisedExtensions instead.
|
|
const RendererInfo& GetRendererIdentity();
|
|
|
|
// The full OpenGL extension list Espryt advertises (glGetString(GL_EXTENSIONS))
|
|
// for a device whose timer queries are (or are not) usable. The
|
|
// MOBILEGL_DISABLE_TIMERQUERY escape hatch is applied inside.
|
|
Vector<GLExtension> BuildAdvertisedExtensions(Bool timerQueriesSupported);
|
|
|
|
// Format: <OpenGL ES Renderer>, OpenGL ES <Major>.<Minor> — the exact string an
|
|
// initialized backend returns from GetBackendAPIVersionString (and that ends up
|
|
// inside the application-visible GL_RENDERER string).
|
|
String FormatBackendAPIVersionString(const String& glesRendererString, Int glesMajor, Int glesMinor);
|
|
} // namespace MobileGL::MG_Backend::DirectGLES
|