mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-07 01:53:24 +09:00
[MGPipe] preserve explicit mip extents in the shared texture staging owner
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user