기본적으로 Unity의 런타임 셰이더 로딩 동작은 다음과 같습니다.
이 동작의 이점은 셰이더 배리언트에 대해 사전 GPU 메모리 사용 또는 로드 타임이 없다는 것입니다. 반면, 단점은 배리언트가 최초로 사용될 때 그래픽스 드라이버가 GPU에서 셰이더 프로그램을 만들고 추가 작업을 수행해야 하므로 확연한 지연이 있을 수 있다는 것입니다.
성능이 많이 소요되는 경우, Unity는 확연한 지연을 방지하기 위해 최초로 필요하기 전에 셰이더 배리언트의 GPU 표현을 생성하도록 그래픽스 드라이버에 요청할 수 있습니다. 이를 예열이라고 합니다.
경고: 예열 수행 방식을 선택하기 전에 그래픽스 API 지원에 대한 참고를 확인하십시오. DX12, Vulkan, Metal과 같은 최첨단 그래픽스 API에서는 버텍스 형식을 지정할 수 있는 실험적인 ShaderWarmup API만 완벽하게 지원됩니다. 다른 방법을 사용하면 작업 및 GPU 메모리만 낭비되고 지연은 해결하지 못할 수 있습니다.
다음 방법으로 예열을 수행할 수 있습니다.
참고:
GPU로 보낼 셰이더 배리언트 데이터의 표현을 만드는 Unity용 프로파일러 마커는 Shader.Parse
입니다. 셰이더 프로그램을 GPU에 업로드하고, 필요한 작업을 수행하기 위해 GPU를 기다리는 프로파일러 마커는 CreateGPUProgram
입니다.
Unity 프로파일러를 사용하는 방법은 애플리케이션 프로파일링을 참조하십시오.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.