Skip to content

Cache SystemInfo format checks to avoid GC allocation#177

Merged
sakumanaoki merged 1 commit intomainfrom
bugfix/rt_format_gc
Nov 19, 2025
Merged

Cache SystemInfo format checks to avoid GC allocation#177
sakumanaoki merged 1 commit intomainfrom
bugfix/rt_format_gc

Conversation

@sakumanaoki
Copy link
Contributor

概要

#176 の対応になります。

指摘して頂いている通り、RTのFormatの取得処理でGCAllocが発生しており、毎フレーム発生してしまうので対応しました。
また、Unity6のRenderGraphでも同様のことが発生しており、同様に対応しました。

動作確認

Unity2022.3

対応前

GCAllocが発生しています。

2022Before

対応後

GCAllocが発生しなくなっています。

2022After

対応後の全体

全体通しても、GCAllocが発生しなくなっています。

2022Total

Unity6000.0 かつ、RenderGraph有効化

対応前

GCAllocが発生しています。

6000Before

対応後

GCAllocが発生しなくなっています。

6000After

対応後の全体

全体通しても、GCAllocが発生しなくなっています。

6000Total

確認したこと

  • Profiler上でGCAllocが発生しないこと
    • 2022.3, 6000.0(RenderGraph対応)で確認
  • テストが通ること

@CA-Tatami CA-Tatami self-requested a review November 19, 2025 05:09
@sakumanaoki sakumanaoki merged commit 40740be into main Nov 19, 2025
1 check passed
@sakumanaoki sakumanaoki deleted the bugfix/rt_format_gc branch November 19, 2025 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants