Skip to content

Conversation

tomzig16
Copy link
Contributor

@tomzig16 tomzig16 commented Nov 9, 2021

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
Copy link

github-actions bot commented Nov 9, 2021

Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed.
Link to Yamato: https://unity-ci.cds.internal.unity3d.com/project/902/
Search for your PR branch using the search bar at the top, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

URP
/jobDefinition/.yamato%252Fall-urp.yml%2523PR_URP_trunk
With changes to URP packages, you should also run
/jobDefinition/.yamato%2Fall-lightmapping.yml%23PR_Lightmapping_trunk

Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure.

@tomzig16 tomzig16 marked this pull request as ready for review November 18, 2021 12:52
@tomzig16 tomzig16 requested review from a team as code owners November 18, 2021 12:52
@tomzig16 tomzig16 requested a review from 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