mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-20 16:31:57 +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;
|
if (bytes == nullptr || record.Blob.Size == 0) return;
|
||||||
const auto* stored = PipeTextureRecordForHandle(res);
|
const auto* stored = PipeTextureRecordForHandle(res);
|
||||||
if (stored == nullptr) return;
|
if (stored == nullptr) return;
|
||||||
const IntVec3 extent = record.LevelWidth && record.LevelHeight && record.LevelDepth
|
const IntVec3 extent = MG_Remote::Server::StagedTextureUploadExtent(stored->Desc, record);
|
||||||
? 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));
|
|
||||||
store.Adopt(MG_Remote::Server::StagedTextureStore::KeyForHandle(res),
|
store.Adopt(MG_Remote::Server::StagedTextureStore::KeyForHandle(res),
|
||||||
MG_Pipe::MGPipeSubDataUploadTargetOf(record.Target), record.Level, extent,
|
MG_Pipe::MGPipeSubDataUploadTargetOf(record.Target), record.Level, extent,
|
||||||
bytes, static_cast<SizeT>(record.Blob.Size));
|
bytes, static_cast<SizeT>(record.Blob.Size));
|
||||||
|
|||||||
@@ -1024,7 +1024,7 @@ namespace MobileGL::MG_Pipe {
|
|||||||
const auto& desc = stored.Desc;
|
const auto& desc = stored.Desc;
|
||||||
store.Adopt(MG_Remote::Server::StagedTextureStore::KeyForHandle(upload.Res),
|
store.Adopt(MG_Remote::Server::StagedTextureStore::KeyForHandle(upload.Res),
|
||||||
MGPipeSubDataUploadTargetOf(upload.Target), upload.Level,
|
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));
|
bytes, static_cast<SizeT>(upload.Blob.Size));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,6 +131,14 @@ namespace MobileGL::MG_Remote::Server {
|
|||||||
return extent;
|
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 {
|
class StagedTextureStore {
|
||||||
public:
|
public:
|
||||||
// `copies` is "this process is really split". False reproduces the monolith expression
|
// `copies` is "this process is really split". False reproduces the monolith expression
|
||||||
|
|||||||
Reference in New Issue
Block a user