I noticed that the GL_TEXTURE_WRAP_* parameters of texture working different on AMD and NVIDIA platform when texture coordinates out of the texture’s size for texelFetch.
AMD applying wrapping rule, NVIDIA fetches zero value for any rule.
I didn’t find clarification in specification, so what behaviour is correct?
Both behaviors are correct, since it’s undefined behavior. According to the spec (emphasis added):
Unlike filtered texel accesses, texel fetches do not support LOD clamping or any texture wrap mode
[…]
Texel fetches with incorrect parameters or state occur under any the following conditions:
[…]
the texel coordinates (i; j; k) refer to a texel outside the defined extents of the specified level of detail, where any of: [texture coordinates are out of the width/height/depth]
[…]
In all the above cases, if the context was created with robust buffer access enabled (see section 10.3.6), the result of the texture fetch is zero, or a texture source color of (0; 0; 0; 1) in the case of a texel fetch from an incomplete texture. If robust buffer access is not enabled, the result of the texture fetch is undefined in each case.
Note that AMD’s behavior would be out of spec if the context was created with “robust buffer access”.
Thanks. I had hoped to use built-in wrapping, but in this case it is necessary to make it programmatically.
system
Closed
October 19, 2021, 7:16pm
4
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.