[Perf] (MG_Backend/DirectVulkan): skip the per-draw sampled-texture walk when the bound set is unchanged (texture-bind generation + program state version); CollectSampledTextures 5.0%->0.2%, fps 228->249

This commit is contained in:
2026-07-13 04:41:14 -04:00
parent 516d2a659e
commit f098983c9f
5 changed files with 60 additions and 3 deletions
+4
View File
@@ -102,6 +102,10 @@ namespace MobileGL {
const ImageTextureBinding& GetImageTextureBinding(Int unit) const;
void NoteTextureUnitTouched(Int unit) { m_textureState.NoteUnitTouched(unit); }
Int GetMaxTouchedTextureUnit() const { return m_textureState.GetMaxTouchedUnit(); }
// Monotonic counter bumped whenever a texture bind/unbind/delete changes which
// texture is bound at a unit; lets a backend skip re-resolving an unchanged
// per-draw sampled-texture set.
Uint64 GetTextureBindGeneration() const { return m_textureState.GetTextureBindGeneration(); }
Bool ValidateTextureName(Uint index) const;
Bool ValidateTextureObject(Uint index) const;
Int GetActiveTextureUnit() const;