Home | History | Annotate | Download | only in egl

Lines Matching refs:gl

119 deUint32 createGLES2Program (const glw::Functions& gl, TestLog& log)
147 program = gl.createProgram();
148 vertexShader = gl.createShader(GL_VERTEX_SHADER);
149 fragmentShader = gl.createShader(GL_FRAGMENT_SHADER);
151 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to create shaders and program");
153 gl.shaderSource(vertexShader, 1, &vertexShaderSource, DE_NULL);
154 gl.compileShader(vertexShader);
155 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to setup vertex shader");
157 gl.shaderSource(fragmentShader, 1, &fragmentShaderSource, DE_NULL);
158 gl.compileShader(fragmentShader);
159 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to setup fragment shader");
164 gl.getShaderiv(vertexShader, GL_COMPILE_STATUS, &vertexCompileStatus);
165 gl.getShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &infoLogLength);
169 gl.getShaderInfoLog(vertexShader, (glw::GLsizei)vertexInfoLog.length(), &infoLogLength, &(vertexInfoLog[0]));
170 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to get vertex shader compile info");
178 gl.getShaderiv(fragmentShader, GL_COMPILE_STATUS, &fragmentCompileStatus);
179 gl.getShaderiv(fragmentShader, GL_INFO_LOG_LENGTH, &infoLogLength);
183 gl.getShaderInfoLog(fragmentShader, (glw::GLsizei)fragmentInfoLog.length(), &infoLogLength, &(fragmentInfoLog[0]));
184 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to get fragment shader compile info");
189 gl.attachShader(program, vertexShader);
190 gl.attachShader(program, fragmentShader);
191 gl.linkProgram(program);
192 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to setup program");
197 gl.getProgramiv(program, GL_LINK_STATUS, &linkStatus);
198 gl.getProgramiv(program, GL_INFO_LOG_LENGTH, &infoLogLength);
202 gl.getProgramInfoLog(program, (glw::GLsizei)programInfoLog.length(), &infoLogLength, &(programInfoLog[0]));
203 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to get program link info");
219 gl.deleteShader(vertexShader);
220 gl.deleteShader(fragmentShader);
221 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to delete shaders");
228 gl.deleteProgram(program);
231 gl.deleteShader(vertexShader);
234 gl.deleteShader(fragmentShader);
292 glw::Functions gl;
300 m_eglTestCtx.getGLFunctions(gl, glu::ApiType::es(2,0));
327 program = createGLES2Program(gl, m_testCtx.getLog());
329 gl.useProgram(program);
330 posLocation = gl.getAttribLocation(program, "a_pos");
331 gl.enableVertexAttribArray(posLocation);
332 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to setup shader program for rendering");
335 gl.clearColor(1.0f, 1.0f, 1.0f, 1.0f);
336 gl.clear(GL_COLOR_BUFFER_BIT);
337 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to clear surface");
340 gl.finish();
341 GLU_EXPECT_NO_ERROR(gl.getError(), "glFinish() failed");
353 gl.clearColor(0.0f, 0.0f, 0.0f, 1.0f);
354 gl.clear(GL_COLOR_BUFFER_BIT);
355 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to clear surface");
358 gl.finish();
359 GLU_EXPECT_NO_ERROR(gl.getError(), "glFinish() failed");
370 gl.clearColor(0.7f, 1.0f, 0.3f, 1.0f);
371 gl.clear(GL_COLOR_BUFFER_BIT);
372 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to clear surface");
374 gl.vertexAttribPointer(posLocation, 2, GL_FLOAT, GL_FALSE, 0, positions1);
375 gl.drawArrays(GL_TRIANGLES, 0, 6);
376 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to render");
379 gl.finish();
380 GLU_EXPECT_NO_ERROR(gl.getError(), "glFinish() failed");
385 gl.clearColor(0.7f, 0.7f, 1.0f, 1.0f);
386 gl.clear(GL_COLOR_BUFFER_BIT);
387 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to clear surface");
389 gl.vertexAttribPointer(posLocation, 2, GL_FLOAT, GL_FALSE, 0, positions2);
390 gl.drawArrays(GL_TRIANGLES, 0, 6);
391 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to render");
393 gl.finish();
394 GLU_EXPECT_NO_ERROR(gl.getError(), "glFinish() failed");
399 gl.finish();
400 GLU_EXPECT_NO_ERROR(gl.getError(), "glFinish() failed");
404 gl.disableVertexAttribArray(posLocation);
405 gl.useProgram(0);
406 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to release program state");
408 gl.deleteProgram(program);
410 GLU_EXPECT_NO_ERROR(gl.getError(), "glDeleteProgram()");
418 gl.deleteProgram(program);