我想优化片段着色器的性能。目前,我的片段着色器是
fragment half4 fragmen_shader_texture(VertexOutTexture vIn [[stage_in]],
texture2d<half> texture [[texture(0)]]){
constexpr sampler defaultSampler;
half4 color = half4(texture.sample(defaultSampler, vIn.textureCoordinates));
return color;
}其任务是返回纹理颜色。无论如何,优化比这更多。
发布于 2018-09-28 18:41:40
没有优化片段着色器AFAICT的选项,它实际上只是对纹理进行采样。但是,根据您的情况,仍然可以通过以下方法进行优化:
https://stackoverflow.com/questions/52548674
复制相似问题