[MGPipe] preserve explicit mip extents in the shared texture staging owner

This commit is contained in:
2026-09-20 13:02:56 -04:00
parent 2426abb814
commit ed01f4e31a
3 changed files with 10 additions and 7 deletions
+1 -6
View File
@@ -2723,12 +2723,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
if (bytes == nullptr || record.Blob.Size == 0) return;
const auto* stored = PipeTextureRecordForHandle(res);
if (stored == nullptr) return;
const IntVec3 extent = record.LevelWidth && record.LevelHeight && record.LevelDepth
? IntVec3{static_cast<Int>(record.LevelWidth), static_cast<Int>(record.LevelHeight),
static_cast<Int>(record.LevelDepth)}
: MG_Remote::Server::StagedTextureMipExtent(
stored->Desc.Target, stored->Desc.Width, stored->Desc.Height, stored->Desc.Depth,
static_cast<Uint32>(record.Level));
const IntVec3 extent = MG_Remote::Server::StagedTextureUploadExtent(stored->Desc, record);
store.Adopt(MG_Remote::Server::StagedTextureStore::KeyForHandle(res),
MG_Pipe::MGPipeSubDataUploadTargetOf(record.Target), record.Level, extent,
bytes, static_cast<SizeT>(record.Blob.Size));
+1 -1
View File
@@ -1024,7 +1024,7 @@ namespace MobileGL::MG_Pipe {
const auto& desc = stored.Desc;
store.Adopt(MG_Remote::Server::StagedTextureStore::KeyForHandle(upload.Res),
MGPipeSubDataUploadTargetOf(upload.Target), upload.Level,
MG_Remote::Server::StagedTextureMipExtent(desc.Target, desc.Width, desc.Height, desc.Depth, upload.Level),
MG_Remote::Server::StagedTextureUploadExtent(desc, upload),
bytes, static_cast<SizeT>(upload.Blob.Size));
}
@@ -131,6 +131,14 @@ namespace MobileGL::MG_Remote::Server {
return extent;
}
inline IntVec3 StagedTextureUploadExtent(const MG_Pipe::MGPResourceDesc& desc,
const MG_Pipe::MGPSubData& upload) {
if (upload.LevelWidth && upload.LevelHeight && upload.LevelDepth)
return {static_cast<Int>(upload.LevelWidth), static_cast<Int>(upload.LevelHeight),
static_cast<Int>(upload.LevelDepth)};
return StagedTextureMipExtent(desc.Target, desc.Width, desc.Height, desc.Depth, upload.Level);
}
class StagedTextureStore {
public:
// `copies` is "this process is really split". False reproduces the monolith expression