Home | History | Annotate | Download | only in egl

Lines Matching refs:gl

88 deUint32 createGLES2Program (const glw::Functions& gl, TestLog& log)
117 program = gl.createProgram();
118 vertexShader = gl.createShader(GL_VERTEX_SHADER);
119 fragmentShader = gl.createShader(GL_FRAGMENT_SHADER);
121 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to create shaders and program");
123 gl.shaderSource(vertexShader, 1, &vertexShaderSource, DE_NULL);
124 gl.compileShader(vertexShader);
125 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to setup vertex shader");
127 gl.shaderSource(fragmentShader, 1, &fragmentShaderSource, DE_NULL);
128 gl.compileShader(fragmentShader);
129 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to setup fragment shader");
134 gl.getShaderiv(vertexShader, GL_COMPILE_STATUS, &vertexCompileStatus);
135 gl.getShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &infoLogLength);
139 gl.getShaderInfoLog(vertexShader, (glw::GLsizei)vertexInfoLog.length(), &infoLogLength, &(vertexInfoLog[0]));
140 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to get vertex shader compile info");
148 gl.getShaderiv(fragmentShader, GL_COMPILE_STATUS, &fragmentCompileStatus);
149 gl.getShaderiv(fragmentShader, GL_INFO_LOG_LENGTH, &infoLogLength);
153 gl.getShaderInfoLog(fragmentShader, (glw::GLsizei)fragmentInfoLog.length(), &infoLogLength, &(fragmentInfoLog[0]));
154 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to get fragment shader compile info");
159 gl.attachShader(program, vertexShader);
160 gl.attachShader(program, fragmentShader);
161 gl.linkProgram(program);
162 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to setup program");
167 gl.getProgramiv(program, GL_LINK_STATUS, &linkStatus);
168 gl.getProgramiv(program, GL_INFO_LOG_LENGTH, &infoLogLength);
172 gl.getProgramInfoLog(program, (glw::GLsizei)programInfoLog.length(), &infoLogLength, &(programInfoLog[0]));
173 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to get program link info");
189 gl.deleteShader(vertexShader);
190 gl.deleteShader(fragmentShader);
191 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to delete shaders");
198 gl.deleteProgram(program);
201 gl.deleteShader(vertexShader);
204 gl.deleteShader(fragmentShader);
212 void clear (const glw::Functions& gl, const tcu::Vec4& color)
214 gl.clearColor(color.x(), color.y(), color.z(), color.w());
215 gl.clear(GL_COLOR_BUFFER_BIT);
216 GLU_EXPECT_NO_ERROR(gl.getError(), "Color clear failed");
219 void render (const glw::Functions& gl, deUint32 program, const tcu::Vec4& color)
235 gl.useProgram(program);
236 posLocation = gl.getAttribLocation(program, "a_pos");
237 gl.enableVertexAttribArray(posLocation);
238 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to setup shader program for rendering");
240 colorLocation = gl.getUniformLocation(program, "u_color");
241 gl.uniform4fv(colorLocation, 1, color.getPtr());
243 gl.vertexAttribPointer(posLocation, 2, GL_FLOAT, GL_FALSE, 0, positions);
244 gl.drawArrays(GL_TRIANGLES, 0, 6);
245 GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to render");
323 bool testNativeWindow (TestLog& log, eglu::NativeDisplay& nativeDisplay, eglu::NativeWindow& nativeWindow, EGLDisplay display, EGLContext context, EGLConfig config, const glw::Functions& gl, bool renderColor, int waitFrames, size_t colorCount, const tcu::Vec4* colors)
336 program = createGLES2Program(gl, log);
341 render(gl, program, colors[colorNdx]);
343 clear(gl, colors[colorNdx]);
359 gl.deleteProgram(program);
366 bool testNativePixmap (TestLog& log, eglu::NativeDisplay& nativeDisplay, eglu::NativePixmap& nativePixmap, EGLDisplay display, EGLContext context, EGLConfig config, const glw::Functions& gl, bool renderColor, size_t colorCount, const tcu::Vec4* colors)
379 program = createGLES2Program(gl, log);
384 render(gl, program, colors[colorNdx]);
386 clear(gl, colors[colorNdx]);
400 gl.deleteProgram(program);
407 bool testNativePixmapCopy (TestLog& log, const Library& egl, eglu::NativePixmap& nativePixmap, EGLDisplay display, EGLContext context, EGLConfig config, const glw::Functions& gl, bool renderColor, size_t colorCount, const tcu::Vec4* colors)
419 program = createGLES2Program(gl, log);
424 render(gl, program, colors[colorNdx]);
426 clear(gl, colors[colorNdx]);
441 gl.deleteProgram(program);
526 glw::Functions gl;
528 m_eglTestCtx.initGLFunctions(&gl, glu::ApiType::es(2,0));
536 if (!testNativeWindow(m_testCtx.getLog(), m_eglTestCtx.getNativeDisplay(), *nativeWindow, display, *context, config, gl, m_render, waitFrames, DE_LENGTH_OF_ARRAY(colors), colors))
545 if (!testNativePixmap(m_testCtx.getLog(), m_eglTestCtx.getNativeDisplay(), *nativePixmap, display, *context, config, gl, m_render, DE_LENGTH_OF_ARRAY(colors), colors))
554 if (!testNativePixmapCopy(m_testCtx.getLog(), egl, *nativePixmap, display, *context, config, gl, m_render, DE_LENGTH_OF_ARRAY(colors), colors))