安静如鸡

  • Home
  • About Me
  • Contact Me
  • 东京女子篮球活动记录
一个博客
  1. 首页
  2. Tech
  3. 正文

【Unity小帖士】ShaderVariantCollection的Warmup

2024-04-11 0人点赞 0条评论

ShaderVariantCollection在warmup的时候第一次会有一个CreateGPU的进程在rendering pipeline里面。

但是这个进程第二次启动就没有发生了。

原因是Metal和Vulkan这类API引入了PSO(Pipeline State Objects),Shader在编译的时候会生成管线对象缓存在机器里。当第二次启动的时候直接读取机器的缓存对象,就不用再编译了。

关于PSO可以参考一下这个文章:https://zhuanlan.zhihu.com/p/55304721

https://blog.unity.com/engine-platform/games-focus-multiplatform-form-factor-player-reach

To improve runtime shader performance and memory management across all platforms, we started by improving shader warmup using asynchronous PSO creation. Using modern graphics APIs, shader runtime compilation is performed as part of the pipeline object creation, which can contribute to stutters and slowdowns when warming shaders. This optimization accelerates shader warmup on modern graphics APIs via multithreaded creation of pipeline objects in order to reduce runtime stutters and slowdowns.

标签: 暂无
最后更新:2024-04-11

Ellison

什么都懂点,什么都不精。属于混吃等死,享受生活,过一天算一天的享乐主义。喜欢电影,阅读,以及游戏和美食。

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2024 安静如鸡. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang