Shader.WarmupAllShaders 预加载所有着色器

static function WarmupAllShaders () : void

Description描述

Fully load all shaders to prevent future performance hiccups.

完全加载所有着色器,以防止将来性能打嗝。

Usually graphics drivers do not actually prepare shaders until they are first needed. However when some object is first rendered with a previously unused shader, there can be a hiccup because the driver is compiling/optimizing the shader. This can be quite noticeable on mobile platforms.

通常显卡驱动程序不实际预加载着色器,直到第一次需要。然而,当某些物体是第一次被渲染一个以前未使用的着色器,可能有打嗝(游戏画面停顿),因为显卡驱动程序正编译/优化着色器。在移动平台,这可能相当明显。

Calling this function will perform dummy one-invisible-triangle rendering with all permutations of all currently loaded shaders. This can take some time but helps to avoid hiccups in the future.

调用这个函数将执行虚拟one-invisible-triangle渲染,所有当前加载的着色器队列。这可能需要一些时间,但有助于避免在未来的打嗝。

Page last updated: 2011-9-18