mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Perf] (DirectGLES): route the per-upload GL_PIXEL_UNPACK_BUFFER unbinds through the unpack binding cache - the six texture-upload sites re-issued glBindBuffer(UNPACK, 0) on every upload; with the resting-0 shadow they now no-op after the first
This commit is contained in:
@@ -1848,7 +1848,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
uploadData, levelByteSize, &glType, packedUploadData);
|
uploadData, levelByteSize, &glType, packedUploadData);
|
||||||
|
|
||||||
DebugImpl::ErrorLopper::Clear();
|
DebugImpl::ErrorLopper::Clear();
|
||||||
g_GLESFuncs.glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
BufferImpl::BindPixelUnpackBufferId(0); // no-op once the resting 0 state is pinned
|
||||||
const IntVec3 uploadSize =
|
const IntVec3 uploadSize =
|
||||||
GetBackendUploadSize(stateTextureObject->GetTarget(), levelTexelSize);
|
GetBackendUploadSize(stateTextureObject->GetTarget(), levelTexelSize);
|
||||||
switch (MapToBackendTextureTarget(stateTextureObject->GetTarget())) {
|
switch (MapToBackendTextureTarget(stateTextureObject->GetTarget())) {
|
||||||
@@ -1900,7 +1900,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
const auto& uploadTargets = textureMipmapObject->GetUploadTargets();
|
const auto& uploadTargets = textureMipmapObject->GetUploadTargets();
|
||||||
if (TextureImpl::IsMultisampleTextureTarget(targetInternal)) {
|
if (TextureImpl::IsMultisampleTextureTarget(targetInternal)) {
|
||||||
DebugImpl::ErrorLopper::Clear();
|
DebugImpl::ErrorLopper::Clear();
|
||||||
g_GLESFuncs.glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
BufferImpl::BindPixelUnpackBufferId(0); // no-op once the resting 0 state is pinned
|
||||||
switch (targetInternal) {
|
switch (targetInternal) {
|
||||||
case TextureTarget::Texture2DMultisample:
|
case TextureTarget::Texture2DMultisample:
|
||||||
g_GLESFuncs.glTexStorage2DMultisample(
|
g_GLESFuncs.glTexStorage2DMultisample(
|
||||||
@@ -1927,7 +1927,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
}
|
}
|
||||||
} else if (stateTextureObject->IsImmutable() || m_imageBindableStorageRequired) {
|
} else if (stateTextureObject->IsImmutable() || m_imageBindableStorageRequired) {
|
||||||
DebugImpl::ErrorLopper::Clear();
|
DebugImpl::ErrorLopper::Clear();
|
||||||
g_GLESFuncs.glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
BufferImpl::BindPixelUnpackBufferId(0); // no-op once the resting 0 state is pinned
|
||||||
const IntVec3 storageSize = GetBackendUploadSize(targetInternal, baseSize);
|
const IntVec3 storageSize = GetBackendUploadSize(targetInternal, baseSize);
|
||||||
switch (MapToBackendTextureTarget(targetInternal)) {
|
switch (MapToBackendTextureTarget(targetInternal)) {
|
||||||
case TextureTarget::Texture2D:
|
case TextureTarget::Texture2D:
|
||||||
@@ -1977,7 +1977,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
uploadData, levelByteSize, &glType, packedUploadData);
|
uploadData, levelByteSize, &glType, packedUploadData);
|
||||||
|
|
||||||
DebugImpl::ErrorLopper::Clear();
|
DebugImpl::ErrorLopper::Clear();
|
||||||
g_GLESFuncs.glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
BufferImpl::BindPixelUnpackBufferId(0); // no-op once the resting 0 state is pinned
|
||||||
const IntVec3 uploadSize =
|
const IntVec3 uploadSize =
|
||||||
GetBackendUploadSize(targetInternal, levelTexelSize);
|
GetBackendUploadSize(targetInternal, levelTexelSize);
|
||||||
switch (MapToBackendTextureTarget(targetInternal)) {
|
switch (MapToBackendTextureTarget(targetInternal)) {
|
||||||
@@ -2040,7 +2040,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
levelByteSize, pData, levelDirty ? "true" : "false");
|
levelByteSize, pData, levelDirty ? "true" : "false");
|
||||||
|
|
||||||
DebugImpl::ErrorLopper::Clear();
|
DebugImpl::ErrorLopper::Clear();
|
||||||
g_GLESFuncs.glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
BufferImpl::BindPixelUnpackBufferId(0); // no-op once the resting 0 state is pinned
|
||||||
auto textureTarget = stateTextureObject->GetTarget();
|
auto textureTarget = stateTextureObject->GetTarget();
|
||||||
const IntVec3 uploadSize = GetBackendUploadSize(textureTarget, levelTexelSize);
|
const IntVec3 uploadSize = GetBackendUploadSize(textureTarget, levelTexelSize);
|
||||||
switch (MapToBackendTextureTarget(textureTarget)) {
|
switch (MapToBackendTextureTarget(textureTarget)) {
|
||||||
@@ -2126,7 +2126,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
textureMipmapObject->GetMipmapTexelSize(uploadTarget, level).y(), byteSize);
|
textureMipmapObject->GetMipmapTexelSize(uploadTarget, level).y(), byteSize);
|
||||||
|
|
||||||
auto glUploadTarget = ConvertTextureUploadTargetToBackendGLEnum(uploadTarget);
|
auto glUploadTarget = ConvertTextureUploadTargetToBackendGLEnum(uploadTarget);
|
||||||
g_GLESFuncs.glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
BufferImpl::BindPixelUnpackBufferId(0); // no-op once the resting 0 state is pinned
|
||||||
DebugImpl::ErrorLopper::Loop(
|
DebugImpl::ErrorLopper::Loop(
|
||||||
[file = __FILE__, line = __LINE__, func = __func__](GLenum err) {
|
[file = __FILE__, line = __LINE__, func = __func__](GLenum err) {
|
||||||
MGLOG_D("%s(%s:%d) ES error: %s", func, file, line,
|
MGLOG_D("%s(%s:%d) ES error: %s", func, file, line,
|
||||||
|
|||||||
Reference in New Issue
Block a user