【发布时间】:2019-08-29 06:55:23
【问题描述】:
假设我有一个深度/模板纹理,其格式为 MTLPixelFormatDepth32Float_Stencil8,我在渲染过程中用作附件,然后我想在后面的渲染过程中从该纹理中采样模板值。
Metal Shading Language Specification 没有提及任何关于此的内容,只是需要将深度纹理声明为 depth2d<T, access a = access::sample> 并且对于 depth2d 两者 T sample(sampler s, float2 coord, int2 offset = int2(0)) const 和 T read(uint2 coord, uint lod = 0) const 返回 T 其中 T很可能是float。
所以,我的问题是,我如何从这个纹理中读取或采样模板值?
【问题讨论】:
标签: metal