升级水插件

This commit is contained in:
2026-01-08 22:30:55 +08:00
parent febff82d24
commit ca68084264
415 changed files with 18138 additions and 7134 deletions

View File

@@ -1,4 +1,4 @@
// Crest Water System
// Crest Water System
// Copyright © 2024 Wave Harmonic. All rights reserved.
// Potential improvements
@@ -43,6 +43,7 @@ namespace WaveHarmonic.Crest
int RequestCount { get; }
int QueryCount { get; }
void UpdateQueries(WaterRenderer water);
void SendReadBack(WaterRenderer water);
void CleanUp();
}
@@ -512,7 +513,20 @@ namespace WaveHarmonic.Crest
if (_SegmentRegistrarRingBuffer.Current._QueryCount > 0)
{
ExecuteQueries();
}
}
public void SendReadBack(WaterRenderer water)
{
#if UNITY_EDITOR
// Seems to be a terrible memory leak coming from creating async GPU readbacks.
// This was marked as resolved by Unity and confirmed fixed by forum posts.
// May be worth keeping. See issue #630 for more details.
if (!water._HeightQueries && !Application.isPlaying) return;
#endif
if (_SegmentRegistrarRingBuffer.Current._QueryCount > 0)
{
// Remove oldest requests if we have hit the limit
while (_Requests.Count >= k_MaximumRequests)
{