mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Perf] (MG_Backend/DirectGLES): drop redundant per-draw UBO binding-point sync; BindCurrentProgramWithResources already rebinds them
This commit is contained in:
@@ -291,10 +291,16 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SyncBufferBindingPoints(BufferTarget::Uniform, GL_UNIFORM_BUFFER);
|
// UBO binding points are (re)established per draw by BindCurrentProgramWithResources at
|
||||||
// Graphics shaders may also read SSBOs (e.g. Flywheel's indirect vertex shaders pull
|
// their compacted link-time points: CacheResourceLocations glUniformBlockBinding's the
|
||||||
// instance data from storage buffers), so keep those binding points in sync for draws
|
// transpiled ESSL blocks to points 0,1,2,... (layout(binding=N) is stripped from the
|
||||||
// and not just for compute dispatches.
|
// ESSL), so those compacted points are the only ones the shader reads. A frontend-indexed
|
||||||
|
// sync here would bind points the shader never reads and is unconditionally overwritten by
|
||||||
|
// the program rebind that always follows in PrepareForDraw - i.e. redundant for draws - so
|
||||||
|
// it is intentionally omitted (see SyncComputeBuffers for the compute path, which needs it).
|
||||||
|
// SSBOs are different: their block bindings are baked into the ESSL at compile time and
|
||||||
|
// BindCurrentProgramWithResources binds no SSBO points, so this is their sole draw-path
|
||||||
|
// binder (e.g. Flywheel's indirect vertex shaders pull instance data from storage buffers).
|
||||||
SyncBufferBindingPoints(BufferTarget::ShaderStorage, GL_SHADER_STORAGE_BUFFER);
|
SyncBufferBindingPoints(BufferTarget::ShaderStorage, GL_SHADER_STORAGE_BUFFER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user