Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 497
user3533019 Avatar asked Dec 16 '25 15:12

user3533019


1 Answers

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.

like image 54
Andon M. Coleman Avatar answered Dec 19 '25 06:12

Andon M. Coleman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!