X-Git-Url: https://git.cworth.org/git?p=apitrace;a=blobdiff_plain;f=helpers%2Fglsize.hpp;h=2da217f123a24ba3ce3058548f7886c9eb23640c;hp=c4fe9bf9c866b5aa19c0b4283a9acf3998c39102;hb=ae423964d8b9e4cae2a180e20879205aeeeca27f;hpb=6bb028d7223347f167c2a4e16f8bb0028c95ffe9 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. */