Make USE_DRAW_PROCEDURAL variation only for vertex programs in UberPost shader by tomzig16 · Pull Request #6260 · Unity-Technologies/Graphics · GitHub
Skip to content

Make USE_DRAW_PROCEDURAL variation only for vertex programs in UberPost shader#6260

Merged
phi-lira merged 5 commits into
universal/stagingfrom
urp/variants-removal-from-fragm-shaders
Nov 18, 2021
Merged

Make USE_DRAW_PROCEDURAL variation only for vertex programs in UberPost shader#6260
phi-lira merged 5 commits into
universal/stagingfrom
urp/variants-removal-from-fragm-shaders

Conversation

@tomzig16

@tomzig16 tomzig16 commented Nov 9, 2021

Copy link
Copy Markdown
Contributor

Purpose of this PR

This PR fixes https://fogbugz.unity3d.com/f/cases/1377405/
UberPost has a lot of fragment shader variants that use _USE_DRAW_PROCEDURAL. In fact, removing this keyword (again, only in fragment shaders) with the URP template project reduced its number of variants from 1279 to 639 in 2020.3.18. The change reduces the shader's memory usage from ~12MB to ~6MB. So this PR simply makes _USE_DRAW_PROCEDURAL compile only for vertex shaders by changing its declaration in UberPost shader from #pragma multi_compile to #pragma multi_compile_vertex.


Testing status

Manually looked if results are visually correct and affected (before and after change) in URP Post Processing project + editor
Yamato tests on Post Processing and XR


Comments to reviewers

OSX Metal test fails on master branch with 137 error code.

@github-actions

github-actions Bot commented Nov 9, 2021

Copy link
Copy Markdown

@tomzig16 tomzig16 marked this pull request as ready for review November 18, 2021 12:52
@tomzig16 tomzig16 requested a review from a team as a code owner November 18, 2021 12:52
@tomzig16 tomzig16 requested review from a team and phi-lira November 18, 2021 12:52
@phi-lira phi-lira changed the base branch from master to universal/staging November 18, 2021 15:38
@phi-lira phi-lira merged commit d1a486a into universal/staging Nov 18, 2021
@phi-lira phi-lira deleted the urp/variants-removal-from-fragm-shaders branch November 18, 2021 15:59
This was referenced Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants