升级水插件
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user