Merge branch 'Feat/Backend-Direct-GLES' into dev

This commit is contained in:
BZLZHH
2026-01-31 12:52:56 +08:00
4 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ project("MobileGL")
option(MOBILEGL_BUILD_TEST "Build MobileGL tests" ON )
option(MOBILEGL_BUILD_BENCHMARK "Build MobileGL benchmarks" ON )
option(MOBILEGL_FORCE_RELEASE_OPT "Enable Release optimization flags in Debug build" ON )
option(MOBILEGL_ENABLE_TRANCY "Enable trancy for profiling" OFF)
option(MOBILEGL_ENABLE_TRACY "Enable tracy for profiling" OFF)
if (ANDROID)
set(MOBILEGL_BUILD_TEST OFF CACHE BOOL "Build MobileGL tests" FORCE)
+10 -2
View File
@@ -386,6 +386,8 @@ namespace MobileGL {
}
void BufferSubData_State(GLenum target, GLintptr offset, GLsizeiptr size, const void* data) {
MGLOG_D("%s: target = %s, offset = %d, size = %d, data = %p", __func__,
MG_Util::ConvertGLEnumToString(target).c_str(), offset, size, data);
if (!data) {
MG_State::pGLContext->RecordError(
ErrorCode::NoError, // somehow OpenGL does not generate an error for this
@@ -488,7 +490,7 @@ namespace MobileGL {
auto& bindingSlot = MG_State::pGLContext->GetBufferBindingSlot(bufferTarget);
bindingSlot.Bind(bufferObject);
MGLOG_D("%s: bind buffer object %p -> %s", __func__, bufferObject.get(),
MGLOG_D("%s: bind buffer object %d -> %s", __func__, bufferObject->GetExternalIndex(),
MG_Util::ConvertGLEnumToString(target).c_str());
}
@@ -509,6 +511,8 @@ namespace MobileGL {
}
void BindBufferBase_State(GLenum target, GLuint pointIndex, GLuint buffer) {
MGLOG_D("%s: target = %s, pointIndex = %u, buffer = %u", __func__,
MG_Util::ConvertGLEnumToString(target).c_str(), pointIndex, buffer);
BufferTarget bufferTarget = MG_Util::ConvertGLEnumToBufferTarget(target);
if (!BufferImpl::ValidateBufferBindingPointTarget(bufferTarget)) return;
@@ -520,10 +524,14 @@ namespace MobileGL {
auto& point = MG_State::pGLContext->GetBufferBindingPoint(bufferTarget, pointIndex);
point.Bind(bufferObject);
point.ClearRange();
point.SetRange(Range1D(0, bufferObject->GetSize()));
MGLOG_D("%s: set range (0, %d)", __func__,
bufferObject->GetSize());
}
void BindBufferRange_State(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {
MGLOG_D("%s: target = %s, index = %u, buffer = %u, offset = %d, size = %d", __func__,
MG_Util::ConvertGLEnumToString(target).c_str(), index, buffer, offset, size);
BufferTarget bufferTarget = MG_Util::ConvertGLEnumToBufferTarget(target);
if (!BufferImpl::ValidateBufferBindingPointTarget(bufferTarget)) return;
+1 -1
View File
@@ -821,7 +821,7 @@ namespace MobileGL {
break;
case GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:
#if MOBILEGL_BACKEND == MOBILEGL_BACKEND_TYPE_DIRECT_GLES
*params = MG_External::GLES::g_glesCaps.uniformBufferOffsetAlignment; // TODO: get real value from backend
*params = MG_External::GLES::g_glesCaps.uniformBufferOffsetAlignment;
#else
*params = 256;
#endif
+1 -1
View File
@@ -92,7 +92,7 @@ If you want to try the project right now, youll need to build it yourself:
| `MOBILEGL_BUILD_TEST` | Build MobileGL tests (requires Clang) | ON |
| `MOBILEGL_BUILD_BENCHMARK` | Build MobileGL benchmarks (requires Clang) | ON |
| `MOBILEGL_FORCE_RELEASE_OPT` | Enable O3 and LTO in Debug build | ON |
| `MOBILEGL_ENABLE_TRANCY` | Enable Tracy profiler for performance analysis | OFF |
| `MOBILEGL_ENABLE_TRACY` | Enable Tracy profiler for performance analysis | OFF |
**Notes:**