mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Fix] (MG_Impl/GLImpl, MG_State, MG_Backend/DirectGLES): eliminate packed_pixels SIGTRAPs - complete TexImage format/type/internalformat validation matrix (depth-stencil family, integer-ness, packed-type pairing, 3D depth rejection), fix inverted UpdateSubData assert with clamped copy, demote unimplemented readback asserts to logged no-ops
This commit is contained in:
@@ -31,11 +31,12 @@ namespace MobileGL {
|
||||
auto& targetData = m_data;
|
||||
MOBILEGL_ASSERT(level < targetData.size(), "UpdateSubData: level out of range");
|
||||
auto& levelData = targetData[level];
|
||||
MOBILEGL_ASSERT(levelData.size() <= input.size, "UpdateSubData: input data larger than allocated");
|
||||
MOBILEGL_ASSERT(input.size <= levelData.size(), "UpdateSubData: input data larger than allocated");
|
||||
|
||||
if (input.data && input.size > 0) {
|
||||
const Uint8* src = static_cast<const Uint8*>(input.data);
|
||||
Memcpy(levelData.data(), src, input.size);
|
||||
// Clamp so a size mismatch can never write past the allocation.
|
||||
Memcpy(levelData.data(), src, std::min(input.size, levelData.size()));
|
||||
m_isDirty[level] = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user