X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=helpers%2Fglsize.hpp;h=2da217f123a24ba3ce3058548f7886c9eb23640c;hb=ae423964d8b9e4cae2a180e20879205aeeeca27f;hp=c4fe9bf9c866b5aa19c0b4283a9acf3998c39102;hpb=d7c738e13decf8a8a891008c51b437ccbe3434fb;p=apitrace diff --git a/helpers/glsize.hpp b/helpers/glsize.hpp index c4fe9bf..2da217f 100644 --- a/helpers/glsize.hpp +++ b/helpers/glsize.hpp @@ -815,6 +815,22 @@ _glClearBuffer_size(GLenum buffer) } } + +/** + * Helper function for determining the string lengths for glShaderSource and + * glShaderSourceARB, which is a tad too complex to inline in the specs. + */ +template +static inline size_t +_glShaderSource_length(const T * const * string, const GLint *length, GLsizei index) +{ + if (length != NULL && length[index] >= 0) { + return (size_t)length[index]; + } else { + return strlen(string[index]); + } +} + /* * attribute list, terminated by the given terminator. */