remove layer usage to reduce vram consumption

This commit is contained in:
2026-10-03 20:26:00 +02:00
parent fc672924d1
commit dc99d6677c
20 changed files with 1455 additions and 114 deletions
+7 -2
View File
@@ -33,7 +33,7 @@ bool BlobMaterialShader::updateUniformData(
Q_UNUSED(oldMaterial);
auto* mat = static_cast<BlobMaterial*>(newMaterial);
QByteArray* buf = state.uniformData();
Q_ASSERT(buf->size() >= 1440);
Q_ASSERT(buf->size() >= 1472);
if (state.isMatrixDirty()) {
const QMatrix4x4 m = state.combinedMatrix();
@@ -56,7 +56,7 @@ bool BlobMaterialShader::updateUniformData(
// Rect count (offset 88)
memcpy(buf->data() + 88, &mat->m_rectCount, 4);
// My index (offset 92)
// My index (offset 92). -2 skips the ownership test in the shader.
memcpy(buf->data() + 92, &mat->m_myIndex, 4);
// Color as vec4 (offset 96, 16 bytes)
@@ -100,5 +100,10 @@ bool BlobMaterialShader::updateUniformData(
memcpy(buf->data() + base + 64, r.radius, 16);
}
// Shadow: after rectData, which ends at 1440. shadowColor is 16-byte aligned,
// so it lands at 1456.
memcpy(buf->data() + 1440, &mat->m_shadowRadius, 4);
memcpy(buf->data() + 1456, mat->m_shadowColor, 16);
return true;
}