mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +09:00
[Feat] (MG_State/TextureState): Stubs for unimplemented texture types.
This commit is contained in:
@@ -12,45 +12,39 @@ namespace MobileGL {
|
||||
return m_textureStorage.GetLevelCount();
|
||||
}
|
||||
|
||||
const IntVec3 TextureObject2DCube::GetMipmapTexelSize(TextureUploadTarget target,
|
||||
Uint mipmapLevel) const {
|
||||
const IntVec3 TextureObject2DCube::GetMipmapTexelSize(TextureUploadTarget target, Uint mipmapLevel) const {
|
||||
return m_textureStorage.GetTexelSize(GetIndexOfTextureUploadTarget(target), mipmapLevel);
|
||||
}
|
||||
|
||||
const SizeT TextureObject2DCube::GetMipmapByteSize(TextureUploadTarget target,
|
||||
Uint mipmapLevel) const {
|
||||
const SizeT TextureObject2DCube::GetMipmapByteSize(TextureUploadTarget target, Uint mipmapLevel) const {
|
||||
return m_textureStorage.GetByteSize(GetIndexOfTextureUploadTarget(target), mipmapLevel);
|
||||
}
|
||||
|
||||
void
|
||||
TextureObject2DCube::AllocateStorage(TextureUploadTarget uploadTarget, Uint mipmapLevel,
|
||||
MipmapInput input) {
|
||||
void TextureObject2DCube::AllocateStorage(TextureUploadTarget uploadTarget, Uint mipmapLevel,
|
||||
MipmapInput input) {
|
||||
m_textureStorage.AllocateLevel(GetIndexOfTextureUploadTarget(uploadTarget), mipmapLevel, input);
|
||||
}
|
||||
|
||||
void TextureObject2DCube::UpdateMipmapSubData(TextureUploadTarget uploadTarget,
|
||||
Uint mipmapLevel, DataPtr input) {
|
||||
void TextureObject2DCube::UpdateMipmapSubData(TextureUploadTarget uploadTarget, Uint mipmapLevel,
|
||||
DataPtr input) {
|
||||
m_textureStorage.UpdateSubData(GetIndexOfTextureUploadTarget(uploadTarget), mipmapLevel, input);
|
||||
}
|
||||
|
||||
void *
|
||||
TextureObject2DCube::MapMipmapData(TextureUploadTarget uploadTarget, Uint mipmapLevel) {
|
||||
void* TextureObject2DCube::MapMipmapData(TextureUploadTarget uploadTarget, Uint mipmapLevel) {
|
||||
return m_textureStorage.MapData(GetIndexOfTextureUploadTarget(uploadTarget), mipmapLevel);
|
||||
}
|
||||
|
||||
void TextureObject2DCube::MarkStorageDirty(TextureUploadTarget uploadTarget,
|
||||
Uint mipmapLevel, bool dirty) {
|
||||
void TextureObject2DCube::MarkStorageDirty(TextureUploadTarget uploadTarget, Uint mipmapLevel, bool dirty) {
|
||||
m_textureStorage.MarkDirty(GetIndexOfTextureUploadTarget(uploadTarget), mipmapLevel, dirty);
|
||||
}
|
||||
|
||||
bool TextureObject2DCube::IsStorageDirty(TextureUploadTarget uploadTarget,
|
||||
Uint mipmapLevel) const {
|
||||
bool TextureObject2DCube::IsStorageDirty(TextureUploadTarget uploadTarget, Uint mipmapLevel) const {
|
||||
return m_textureStorage.IsDirty(GetIndexOfTextureUploadTarget(uploadTarget), mipmapLevel);
|
||||
}
|
||||
|
||||
Uint
|
||||
TextureObject2DCube::GetIndexOfTextureUploadTarget(TextureUploadTarget target) const {
|
||||
MOBILEGL_ASSERT(TextureUploadTarget::CubeMapPositiveX <= target && target <= TextureUploadTarget::ProxyCubeMap,
|
||||
Uint TextureObject2DCube::GetIndexOfTextureUploadTarget(TextureUploadTarget target) const {
|
||||
MOBILEGL_ASSERT(TextureUploadTarget::CubeMapPositiveX <= target &&
|
||||
target <= TextureUploadTarget::ProxyCubeMap,
|
||||
"Invalid TextureUploadTarget!");
|
||||
return (Uint)target - (Uint)TextureUploadTarget::CubeMapPositiveX;
|
||||
}
|
||||
@@ -63,8 +57,7 @@ namespace MobileGL {
|
||||
}
|
||||
|
||||
Bool TextureObject2DCube::IsComplete() const {
|
||||
if (!TextureObjectBase::IsComplete())
|
||||
return false;
|
||||
if (!TextureObjectBase::IsComplete()) return false;
|
||||
|
||||
SizeT levelCount = m_textureStorage.GetLevelCount();
|
||||
if (levelCount == 0) {
|
||||
@@ -73,7 +66,7 @@ namespace MobileGL {
|
||||
|
||||
for (SizeT t = 0; t < 6; ++t) {
|
||||
for (SizeT i = 0; i < levelCount; ++i) {
|
||||
const auto &levelSize = m_textureStorage.GetTexelSize(t, i);
|
||||
const auto& levelSize = m_textureStorage.GetTexelSize(t, i);
|
||||
if (levelSize.x() <= 0 || levelSize.y() <= 0 || levelSize.z() <= 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -83,6 +76,6 @@ namespace MobileGL {
|
||||
// TODO: add more completeness checks based on texture type and mipmap levels
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace GLState
|
||||
} // namespace MG_State
|
||||
} // namespace MobileGL
|
||||
|
||||
Reference in New Issue
Block a user