[Improvement] (HeaderSystem): Optimize header system, highly improving performance.

This commit is contained in:
BZLZHH
2025-07-10 14:01:09 +08:00
parent 833679e58a
commit 59e0291f9e
56 changed files with 52 additions and 199 deletions
@@ -3,7 +3,6 @@
//
#pragma once
#include "../../../../Includes.h"
namespace MG_Diligent {
inline const int DILIGENT_BACKEND_TYPE = MG_Constants::Backend::BACKEND_DILIGENT_VULKAN;
@@ -2,10 +2,6 @@
// Created by Swung 0x48 on 2025-05-18.
//
#include "EGL_impl.h"
#undef MOBILEGL_GLSLTOOL_H
#undef MOBILEGL_PROGRAM_DEBUGTOOL_H
#include "../../../../Includes.h"
typedef Diligent::IEngineFactoryVk* (*Diligent_GetEngineFactoryVk_t)();
@@ -5,8 +5,6 @@
#ifndef MOBILEGL_DILIGENT_EGL_IMPL_H
#define MOBILEGL_DILIGENT_EGL_IMPL_H
#include "../../../../Includes.h"
#if BACKEND_TYPE == BACKEND_DILIGENT
namespace MG_Diligent {
@@ -2,7 +2,7 @@
// Created by BZLZHH on 2025/4/26.
//
#include "EGL_WRAP.h"
#include "../../../../Includes.h"
#if BACKEND_TYPE == BACKEND_GLES
@@ -5,8 +5,6 @@
#ifndef MOBILEGL_EGL_GLES_EGL_WRAP_H
#define MOBILEGL_EGL_GLES_EGL_WRAP_H
#include "../../../../Includes.h"
#if BACKEND_TYPE == BACKEND_GLES
+1 -1
View File
@@ -2,7 +2,7 @@
// Created by BZLZHH on 2025/3/30.
//
#include "EGL_EMU.h"
#include "../../../../Includes.h"
#if BACKEND_TYPE == BACKEND_VULKAN
@@ -5,8 +5,6 @@
#ifndef MOBILEGL_EGL_VK_EMU_H
#define MOBILEGL_EGL_VK_EMU_H
#include "../../../../Includes.h"
#if BACKEND_TYPE == BACKEND_VULKAN
struct EGLInternalConfig {
@@ -2,7 +2,7 @@
// Created by BZLZHH on 2025/3/15.
//
#include "GL_Buffer.h"
#include "../../../../Includes.h"
namespace MG_GL::GL {
Diligent::VALUE_TYPE ConvertGLIndexTypeToDiligent(GLenum type) {
@@ -5,8 +5,6 @@
#ifndef MOBILEGL_GL_BUFFER_H
#define MOBILEGL_GL_BUFFER_H
#include "../../../../Includes.h"
namespace MG_GL::GL {
void* MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
void FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
@@ -2,7 +2,7 @@
// Created by BZLZHH on 2025/3/15.
//
#include "GL_Common.h"
#include "../../../../Includes.h"
namespace MG_GL::GL {
void CreateRenderPassAndFramebuffer(GLuint framebuffer,
@@ -5,8 +5,6 @@
#ifndef MOBILEGL_GL_COMMON_H
#define MOBILEGL_GL_COMMON_H
#include "../../../../Includes.h"
namespace MG_GL::GL {
void ClearDepth(GLdouble depth);
void ClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
@@ -2,7 +2,7 @@
// Created by BZLZHH on 2025/3/15.
//
#include "GL_Drawing.h"
#include "../../../../Includes.h"
namespace MG_GL::GL {
// void CreateRenderPassAndFramebuffer(GLuint framebuffer,
@@ -4,7 +4,6 @@
#ifndef MOBILEGL_GL_DRAWING_H
#define MOBILEGL_GL_DRAWING_H
#include "../../../../Includes.h"
namespace MG_GL::GL {
bool IsSamplerType(GLenum type);
@@ -2,7 +2,7 @@
// Created by BZLZHH on 2025/3/15.
//
#include "GL_Framebuffer.h"
#include "../../../../Includes.h"
namespace MG_GL::GL {
void ReleaseFramebufferResources(MG_Diligent::GLFramebufferInfo& fbInfo) {
@@ -5,8 +5,6 @@
#ifndef MOBILEGL_GL_FRAMEBUFFER_H
#define MOBILEGL_GL_FRAMEBUFFER_H
#include "../../../../Includes.h"
namespace MG_GL::GL {
void UpdateDefaultFramebuffer();
@@ -2,7 +2,7 @@
// Created by BZLZHH on 2025/3/15.
//
#include "GLFuncsDefinitions.h"
#include "../../../../Includes.h"
#define DECLARE_GL_FUNCTION_STUB_HEAD(type,name,...) \
MG_EXPORT type gl##name(__VA_ARGS__) {
@@ -5,6 +5,4 @@
#ifndef MOBILEGL_GL_FUNCS_DEFINITIONS_H
#define MOBILEGL_GL_FUNCS_DEFINITIONS_H
#include "../../../../Includes.h"
#endif //MOBILEGL_GL_FUNCS_DEFINITIONS_H
@@ -2,7 +2,7 @@
// Created by BZLZHH on 2025/3/15.
//
#include "BackendInfo.h"
#include "../../../../Includes.h"
namespace MG_GL::Getter {
const std::string GetBackendName() {
@@ -5,8 +5,6 @@
#ifndef MOBILEGL_BACKENDINFO_H
#define MOBILEGL_BACKENDINFO_H
#include "../../../../Includes.h"
namespace MG_GL::Getter {
const std::string GetGPUName();
const std::string GetBackendName();
@@ -2,7 +2,7 @@
// Created by BZLZHH on 2025/3/15.
//
#include "GL_Getter.h"
#include "../../../../Includes.h"
namespace MG_GL::GL {
static std::string rendererString;
@@ -5,8 +5,6 @@
#ifndef MOBILEGL_GL_GETTER_H
#define MOBILEGL_GL_GETTER_H
#include "../../../../Includes.h"
namespace MG_GL::GL {
const GLubyte* GetString(GLenum name);
const GLubyte* GetStringi(GLenum name, GLuint index);
@@ -2,9 +2,6 @@
// Created by BZLZHH on 2025/3/15.
//
#include "GL_Program.h"
#undef MOBILEGL_GLSLTOOL_H
#include "../../../../Includes.h"
namespace MG_GL::GL {
@@ -5,8 +5,6 @@
#ifndef MOBILEGL_GL_PROGRAM_H
#define MOBILEGL_GL_PROGRAM_H
#include "../../../../Includes.h"
namespace MG_GL::GL {
Diligent::VALUE_TYPE ConvertGLTypeToDiligent(GLenum type);
@@ -2,7 +2,7 @@
// Created by BZLZHH on 2025/3/15.
//
#include "GL_Texture.h"
#include "../../../../Includes.h"
namespace MG_GL::GL {
@@ -5,8 +5,6 @@
#ifndef MOBILEGL_GL_TEXTURE_H
#define MOBILEGL_GL_TEXTURE_H
#include "../../../../Includes.h"
namespace MG_GL::GL {
void ActiveTexture(GLenum texture);
void BindTexture(GLenum target, GLuint texture);
@@ -2,7 +2,7 @@
// Created by BZLZHH on 2025/3/15.
//
#include "GL_VertexArray.h"
#include "../../../../Includes.h"
namespace MG_GL::GL {
void GenVertexArrays(GLsizei n, GLuint* arrays) {
@@ -5,8 +5,6 @@
#ifndef MOBILEGL_GL_VERTEXARRAY_H
#define MOBILEGL_GL_VERTEXARRAY_H
#include "../../../../Includes.h"
namespace MG_GL::GL {
void GenVertexArrays(GLsizei n, GLuint* arrays);
void BindVertexArray(GLuint array);
@@ -2,7 +2,7 @@
// Created by Swung 0x48 on 2025/6/20.
//
#include "GLXFuncsDefinitions.h"
#include "../../../../Includes.h"
MG_EXPORT void* glXGetProcAddress(const char *name) {
return MG_GL::GLX::GetProcAddress(name);
@@ -5,6 +5,4 @@
#ifndef MOBILEGL_GLX_FUNCS_DEFINITIONS_H
#define MOBILEGL_GLX_FUNCS_DEFINITIONS_H
#include "../../../../Includes.h"
#endif //MOBILEGL_GLX_FUNCS_DEFINITIONS_H