Hi there,
i think i have a beginners-problem while first time implementing a transform-feedback: The program does not return from calling glTransformFeedbackVaryings.
This is the code:
success = GL_FALSE; errHandle = vShNewHandle;
const GLchar* feedbackVaryings[] = { "cppReturn" };
[...]
vShNewHandle = glCreateShader (GL_VERTEX_SHADER);
tcShNewHandle = glCreateShader (GL_TESS_CONTROL_SHADER);
teShNewHandle = glCreateShader (GL_TESS_EVALUATION_SHADER);
gShNewHandle = glCreateShader (GL_GEOMETRY_SHADER);
fShNewHandle = glCreateShader (GL_FRAGMENT_SHADER);
prgNewHandle = glCreateProgram ();
clsRegEx hasCode ("[\
\\r][\ ]*void\\s*main\\s*\\("); // Regular expresseion to test if a shader-string contains "void main ("
if (hasCode.Matches(vShLnkC)) {
success = GL_FALSE; errHandle = vShNewHandle;
glShaderSource (vShNewHandle, 1, &vShLnkC, NULL); glCompileShader (vShNewHandle);
glGetShaderiv (vShNewHandle, GL_COMPILE_STATUS, &success); if (success != GL_TRUE) goto ex;
glAttachShader (prgNewHandle, vShNewHandle);
if (hasCode.Matches(fShLnkC)) {
[... - Tesselation-, geometry- & fragment-shader are compiled here if fragment-shader-string ('fShLnkC') contains a main-function]
else {
glTransformFeedbackVaryings (prgNewHandle, 1, feedbackVaryings, GL_INTERLEAVED_ATTRIBS);
}
}
Note, that the program works fine as long as a fragment-shader is given. If not, glTransformFeedbackVaryings is called and the program crashes.
Any idea what is wrong??
Best,
Frank