mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Chore] (MG_Backend/DirectGLES): fix param order in GenerateTextureFormatInfo
This commit is contained in:
@@ -774,7 +774,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
|
|
||||||
GLenum format = GL_DEPTH_COMPONENT;
|
GLenum format = GL_DEPTH_COMPONENT;
|
||||||
GLenum type = GL_UNSIGNED_INT;
|
GLenum type = GL_UNSIGNED_INT;
|
||||||
TextureImpl::GenerateTextureFormatInfo(mglInternalFormat, &internalformat, &format, &type);
|
TextureImpl::GenerateTextureFormatInfo(mglInternalFormat, &internalformat, &type, &format);
|
||||||
TexturePixelDataType texturePixelDataType = MG_Util::ConvertGLEnumToTexturePixelDataType(type);
|
TexturePixelDataType texturePixelDataType = MG_Util::ConvertGLEnumToTexturePixelDataType(type);
|
||||||
|
|
||||||
bool isDepthFormat =
|
bool isDepthFormat =
|
||||||
|
|||||||
@@ -367,8 +367,8 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
|
|
||||||
// Regenerate all mipmap levels
|
// Regenerate all mipmap levels
|
||||||
GLenum glInternalFormat, glType, glFormat;
|
GLenum glInternalFormat, glType, glFormat;
|
||||||
TextureImpl::GenerateTextureFormatInfo(textureMipmapObject->GetFormat(), &glInternalFormat, &glType,
|
TextureImpl::GenerateTextureFormatInfo(textureMipmapObject->GetFormat(), &glInternalFormat,
|
||||||
&glFormat);
|
&glFormat, &glType);
|
||||||
|
|
||||||
const auto& uploadTargets = textureMipmapObject->GetUploadTargets();
|
const auto& uploadTargets = textureMipmapObject->GetUploadTargets();
|
||||||
for (auto uploadTarget : uploadTargets) {
|
for (auto uploadTarget : uploadTargets) {
|
||||||
@@ -422,8 +422,8 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
{ // Update all dirty mipmap levels
|
{ // Update all dirty mipmap levels
|
||||||
const auto mipmapCount = textureMipmapObject->GetMipmapLevelCount();
|
const auto mipmapCount = textureMipmapObject->GetMipmapLevelCount();
|
||||||
GLenum glInternalFormat, glType, glFormat;
|
GLenum glInternalFormat, glType, glFormat;
|
||||||
TextureImpl::GenerateTextureFormatInfo(textureMipmapObject->GetFormat(), &glInternalFormat, &glType,
|
TextureImpl::GenerateTextureFormatInfo(textureMipmapObject->GetFormat(), &glInternalFormat,
|
||||||
&glFormat);
|
&glFormat, &glType);
|
||||||
const auto& uploadTargets = textureMipmapObject->GetUploadTargets();
|
const auto& uploadTargets = textureMipmapObject->GetUploadTargets();
|
||||||
for (auto uploadTarget : uploadTargets) {
|
for (auto uploadTarget : uploadTargets) {
|
||||||
for (SizeT level = 0; level < mipmapCount; ++level) {
|
for (SizeT level = 0; level < mipmapCount; ++level) {
|
||||||
@@ -490,8 +490,8 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
auto backendId = backendBufferObject->GetBackendBufferId();
|
auto backendId = backendBufferObject->GetBackendBufferId();
|
||||||
|
|
||||||
GLenum glInternalFormat, glType, glFormat;
|
GLenum glInternalFormat, glType, glFormat;
|
||||||
TextureImpl::GenerateTextureFormatInfo(textureBufferObject->GetFormat(), &glInternalFormat, &glType,
|
TextureImpl::GenerateTextureFormatInfo(textureBufferObject->GetFormat(), &glInternalFormat,
|
||||||
&glFormat);
|
&glFormat, &glType);
|
||||||
|
|
||||||
MG_External::GLES::glTexBuffer(GL_TEXTURE_BUFFER, glInternalFormat, backendId);
|
MG_External::GLES::glTexBuffer(GL_TEXTURE_BUFFER, glInternalFormat, backendId);
|
||||||
break;
|
break;
|
||||||
@@ -1088,7 +1088,8 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
Int width = static_cast<Int>(stateRBOObject->GetWidth());
|
Int width = static_cast<Int>(stateRBOObject->GetWidth());
|
||||||
Int height = static_cast<Int>(stateRBOObject->GetHeight());
|
Int height = static_cast<Int>(stateRBOObject->GetHeight());
|
||||||
GLenum glInternalFormat, glType, glFormat;
|
GLenum glInternalFormat, glType, glFormat;
|
||||||
TextureImpl::GenerateTextureFormatInfo(internalFormat, &glInternalFormat, &glType, &glFormat);
|
TextureImpl::GenerateTextureFormatInfo(internalFormat, &glInternalFormat,
|
||||||
|
&glFormat, &glType);
|
||||||
|
|
||||||
MG_External::GLES::glRenderbufferStorage(GL_RENDERBUFFER, glInternalFormat, static_cast<GLsizei>(width),
|
MG_External::GLES::glRenderbufferStorage(GL_RENDERBUFFER, glInternalFormat, static_cast<GLsizei>(width),
|
||||||
static_cast<GLsizei>(height));
|
static_cast<GLsizei>(height));
|
||||||
|
|||||||
@@ -67,13 +67,14 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
MG_External::GLES::glBindTexture(m_target, m_previousBinding);
|
MG_External::GLES::glBindTexture(m_target, m_previousBinding);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenerateTextureFormatInfo(TextureInternalFormat internalFormat, GLenum* outInternalFormat, GLenum* outType,
|
void GenerateTextureFormatInfo(TextureInternalFormat internalFormat, GLenum* outInternalFormat,
|
||||||
GLenum* outFormat) {
|
GLenum* outFormat, GLenum* outType) {
|
||||||
#ifdef TRACY_ENABLE
|
#ifdef TRACY_ENABLE
|
||||||
ZoneScopedC(TRACY_ZONECOLOR_BACKEND);
|
ZoneScopedC(TRACY_ZONECOLOR_BACKEND);
|
||||||
#endif
|
#endif
|
||||||
MG_Util::TextureFormatProcessor::NormalizePixelFormat(MG_Util::ConvertTextureInternalFormatToGLEnum(internalFormat), outInternalFormat,
|
MG_Util::TextureFormatProcessor::NormalizePixelFormat(
|
||||||
outFormat, outType);
|
MG_Util::ConvertTextureInternalFormatToGLEnum(internalFormat), outInternalFormat,
|
||||||
|
outFormat, outType);
|
||||||
}
|
}
|
||||||
} // namespace TextureImpl
|
} // namespace TextureImpl
|
||||||
|
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
GLint m_previousBinding = 0;
|
GLint m_previousBinding = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void GenerateTextureFormatInfo(TextureInternalFormat internalFormat, GLenum* outInternalFormat, GLenum* outType,
|
void GenerateTextureFormatInfo(TextureInternalFormat internalFormat, GLenum* outInternalFormat,
|
||||||
GLenum* outFormat);
|
GLenum* outFormat, GLenum* outType);
|
||||||
} // namespace TextureImpl
|
} // namespace TextureImpl
|
||||||
|
|
||||||
namespace FramebufferImpl {
|
namespace FramebufferImpl {
|
||||||
|
|||||||
Reference in New Issue
Block a user