diff --git a/CMakeLists.txt b/CMakeLists.txt index dffb06c1..2a6d3a95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/MobileGL/MG_Impl/GLImpl/Buffer/GL_Buffer.cpp b/MobileGL/MG_Impl/GLImpl/Buffer/GL_Buffer.cpp index 131a619c..3e06d5a6 100644 --- a/MobileGL/MG_Impl/GLImpl/Buffer/GL_Buffer.cpp +++ b/MobileGL/MG_Impl/GLImpl/Buffer/GL_Buffer.cpp @@ -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; diff --git a/MobileGL/MG_Impl/GLImpl/Getter/GL_Getter.cpp b/MobileGL/MG_Impl/GLImpl/Getter/GL_Getter.cpp index 913c02bf..6c15d1ad 100644 --- a/MobileGL/MG_Impl/GLImpl/Getter/GL_Getter.cpp +++ b/MobileGL/MG_Impl/GLImpl/Getter/GL_Getter.cpp @@ -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 diff --git a/README.md b/README.md index fdd0c25f..97446e1d 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ If you want to try the project right now, you’ll 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:**