user3533019
user3533019

Reputation: 303

difference between openGL ES and OpenGL function

I compared 2 functions openGL ES and openGL
gvec4 texelFetchOffset(gsampler2DArray sampler, ivec3 P, int lod, ivec2 offset); - from opengles gvec4 texelFetchOffset(gsampler2DArray sampler, ivec3 P, int lod, int offset); - from opengl. I found that about this functions was written the same informations in their specifications but they had the different last argument. Can you explain what it is argument and why in the first function it is vector and in the second it is int number?

Upvotes: 3

Views: 198

Answers (1)

Andon M. Coleman
Andon M. Coleman

Reputation: 43319

You are looking at the manual pages for these functions and as is often the case, there is an error in them.


Consider the manual page for the sampler2DArray overload of texelFetchOffset (...):

gvec4 texelFetchOffset (gsampler2DArray sampler,
                        ivec3 P,
                        int lod,
                        int offset);

Now, compare this to the actual GLSL specification:

GLSL 4.4.0 Specification - 8.9.2. Texel Lookup Functions - pp. 163:

gvec4 texelFetchOffset (gsampler2DArray sampler, ivec3 P, int lod, ivec2 offset)

If you look even more closely at all of the functions, the texelFetchOffset (...) function is supposed to have the same dimensionality for its offset as the input sampler. The manual page applies the rules for 1D lookups to all of them, probably an issue with the way it was parsed.


The bottom line is that the manual pages are full of mistakes that go uncorrected for years. Like Wikipedia, they are usually a so-so starting point for information, but the definitive source is always going to be the actual specifications published here.

Upvotes: 5

Related Questions