Hi there,
Got a few questions about Metal textures:
- When declaring a texture parameter as texture2d<float, access::sample>, what does the float means exactly? It's a the conversion that is applied from whatever internal type the texture has to floating point? They don't have to match. Is that correct?
- Are these things roughly equivalent then:
mediump Sampler2D <-> texture2d<half, access::sample>
- about texture sampling, with GL, I used to have the computation of varyings in vertex shader code to avoid dependent texture accesses in the fragment shader. The word was that dependent texture reads are no more a problem with A7+ archs. Is that cost close to zero or zero? Is there still an advantage of pre-computing coordinates in vertex shader, or not?
- How does this translate to Metal? Any advantage of using varyings?
- In GL, I was sometimes making use of texture2DProj() to sample a texture using homogenous coordinates (vec3). There does not seem to be a way to do that in Metal, so division by z (v.xy/v.z) is used instead, which in turn disables any advantage varyings might have. Is that the recommended approach for homogenous texture sampling? Other ways?