不幸的是,使用 MaterialPropertyBlock
会完全禁用 SRP 批处理器。 相反,当使用 SRP 批处理器时,您应该只设置材质(或渲染器)属性,这些应该由 SRP 批处理器在可能的情况下自动批处理(当着色器在 CBUFFER_START
/ CBUFFER_END
部分中具有这些属性并且一些其他限制允许 批处理)。
Unfortunately using MaterialPropertyBlock
disables the use of the SRP batcher entirely. Instead when using SRP batcher, you should just set Material (or Renderer) properties instead, these should be batched by the SRP batcher automatically when possible (when the shader has these properties in CBUFFER_START
/ CBUFFER_END
sections and some other limitations allow batching).