Lines Matching refs:gl
48 using namespace glw; // GLint and other GL types
185 void verifyError (tcu::TestContext& testCtx, const glw::Functions& gl, GLenum expected)
187 deUint32 got = gl.getError();
298 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
306 gl.genRenderbuffers(1, &colorRboId);
307 gl.bindRenderbuffer(GL_RENDERBUFFER, colorRboId);
308 gl.renderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, m_targetSize, m_targetSize);
309 verifyError(m_testCtx, gl, GL_NO_ERROR);
311 gl.genRenderbuffers(1, &depthRboId);
312 gl.bindRenderbuffer(GL_RENDERBUFFER, depthRboId);
313 gl.renderbufferStorage(GL_RENDERBUFFER, m_internalFormat, m_targetSize, m_targetSize);
314 verifyError(m_testCtx, gl, GL_NO_ERROR);
316 gl.genFramebuffers(1, &fboId);
317 gl.bindFramebuffer(GL_FRAMEBUFFER, fboId);
318 gl.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorRboId);
319 gl.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRboId);
320 verifyError(m_testCtx, gl, GL_NO_ERROR);
322 fboComplete = gl.checkFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE;
327 gl.deleteFramebuffers(1, &fboId);
328 gl.deleteRenderbuffers(1, &depthRboId);
329 gl.deleteRenderbuffers(1, &colorRboId);
370 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
372 const GLint positionLoc = gl.getAttribLocation(program.getProgram(), "a_position");
373 const GLint colorLoc = gl.getAttribLocation(program.getProgram(), "a_color");
381 gl.clearColor (0, 0, 0, 1);
382 gl.clearDepthf (1.0f);
383 gl.clear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
384 gl.viewport (0, 0, m_targetSize, m_targetSize);
385 gl.useProgram (program.getProgram());
386 gl.enable (GL_DEPTH_TEST);
387 gl.depthFunc (GL_LEQUAL); // make test pass if polygon offset doesn't do anything. It has its own test case. This test is only for to detect always-on cases.
391 gl.enableVertexAttribArray (positionLoc);
392 gl.vertexAttribPointer (positionLoc, 4, GL_FLOAT, GL_FALSE, 0, triangle);
398 gl.polygonOffset (0, -2);
399 gl.disable (GL_POLYGON_OFFSET_FILL);
400 gl.vertexAttrib4f (colorLoc, 1.0f, 1.0f, 1.0f, 1.0f);
401 gl.drawArrays (GL_TRIANGLES, 0, 3);
407 gl.polygonOffset (0, -1);
408 gl.enable (GL_POLYGON_OFFSET_FILL);
409 gl.vertexAttrib4f (colorLoc, 1.0f, 0.0f, 0.0f, 1.0f);
410 gl.drawArrays (GL_TRIANGLES, 0, 3);
412 gl.disableVertexAttribArray (positionLoc);
413 gl.useProgram (0);
414 gl.finish ();
498 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
500 const GLint positionLoc = gl.getAttribLocation(program.getProgram(), "a_position");
501 const GLint colorLoc = gl.getAttribLocation(program.getProgram(), "a_color");
510 gl.clearColor (0, 0, 0, 1);
511 gl.clearDepthf (1.0f);
512 gl.clear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
513 gl.viewport (0, 0, m_targetSize, m_targetSize);
514 gl.useProgram (program.getProgram());
515 gl.enable (GL_DEPTH_TEST);
516 gl.enable (GL_POLYGON_OFFSET_FILL);
517 gl.enableVertexAttribArray (positionLoc);
518 gl.vertexAttrib4f (colorLoc, 0.0f, 1.0f, 0.0f, 1.0f);
534 gl.vertexAttribPointer (positionLoc, 4, GL_FLOAT, GL_FALSE, 0, triangle);
547 gl.depthFunc (GL_ALWAYS);
548 gl.polygonOffset (0, 0);
549 gl.colorMask (GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
550 gl.drawArrays (GL_TRIANGLES, 0, 3);
556 gl.depthFunc (GL_EQUAL);
557 gl.polygonOffset (0, offset);
558 gl.colorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
559 gl.drawArrays (GL_TRIANGLES, 0, 3);
564 gl.disableVertexAttribArray (positionLoc);
565 gl.useProgram (0);
566 gl.finish ();
617 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
619 const GLint positionLoc = gl.getAttribLocation(program.getProgram(), "a_position");
620 const GLint colorLoc = gl.getAttribLocation(program.getProgram(), "a_color");
628 gl.clearColor (0, 0, 0, 1);
629 gl.clearDepthf (1.0f);
630 gl.clear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
631 gl.viewport (0, 0, m_targetSize, m_targetSize);
632 gl.depthFunc (GL_LESS);
633 gl.useProgram (program.getProgram());
634 gl.enable (GL_DEPTH_TEST);
635 gl.enable (GL_POLYGON_OFFSET_FILL);
636 gl.enableVertexAttribArray (positionLoc);
643 gl.vertexAttribPointer (positionLoc, 4, GL_FLOAT, GL_FALSE, 0, triangleTopLeft);
647 gl.polygonOffset (0, 0);
648 gl.vertexAttrib4f (colorLoc, 1.0f, 1.0f, 1.0f, 1.0f);
649 gl.drawArrays (GL_TRIANGLES, 0, 3);
653 gl.polygonOffset (0, -1);
654 gl.vertexAttrib4f (colorLoc, 0.0f, 1.0f, 0.0f, 1.0f);
655 gl.drawArrays (GL_TRIANGLES, 0, 3);
660 gl.vertexAttribPointer (positionLoc, 4, GL_FLOAT, GL_FALSE, 0, triangleBottomRight);
664 gl.polygonOffset (0, 1);
665 gl.vertexAttrib4f (colorLoc, 1.0f, 1.0f, 1.0f, 1.0f);
666 gl.drawArrays (GL_TRIANGLES, 0, 3);
670 gl.polygonOffset (0, 0);
671 gl.vertexAttrib4f (colorLoc, 1.0f, 1.0f, 0.0f, 1.0f);
672 gl.drawArrays (GL_TRIANGLES, 0, 3);
675 gl.disableVertexAttribArray (positionLoc);
676 gl.useProgram (0);
677 gl.finish ();
767 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
769 const GLint positionLoc = gl.getAttribLocation(program.getProgram(), "a_position");
770 const GLint colorLoc = gl.getAttribLocation(program.getProgram(), "a_color");
778 gl.clearColor (0, 0, 0, 1);
779 gl.clearDepthf (1.0f);
780 gl.clear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
781 gl.viewport (0, 0, m_targetSize, m_targetSize);
782 gl.useProgram (program.getProgram());
783 gl.enable (GL_DEPTH_TEST);
784 gl.enable (GL_POLYGON_OFFSET_FILL);
785 gl.enableVertexAttribArray (positionLoc);
791 gl.vertexAttribPointer (positionLoc, 4, GL_FLOAT, GL_FALSE, 0, triangleBottomRight);
795 gl.depthFunc (GL_ALWAYS);
796 gl.polygonOffset (0, 8);
797 gl.vertexAttrib4f (colorLoc, 1.0f, 1.0f, 1.0f, 1.0f);
798 gl.drawArrays (GL_TRIANGLES, 0, 3);
802 gl.depthFunc (GL_GREATER);
803 gl.polygonOffset (0, 9);
804 gl.vertexAttrib4f (colorLoc, 1.0f, 0.0f, 0.0f, 1.0f);
805 gl.drawArrays (GL_TRIANGLES, 0, 3);
810 gl.vertexAttribPointer (positionLoc, 4, GL_FLOAT, GL_FALSE, 0, triangleTopLeft);
814 gl.depthFunc (GL_ALWAYS);
815 gl.polygonOffset (0, -8);
816 gl.vertexAttrib4f (colorLoc, 1.0f, 1.0f, 1.0f, 1.0f);
817 gl.drawArrays (GL_TRIANGLES, 0, 3);
821 gl.depthFunc (GL_LESS);
822 gl.polygonOffset (0, -9);
823 gl.vertexAttrib4f (colorLoc, 1.0f, 1.0f, 0.0f, 1.0f);
824 gl.drawArrays (GL_TRIANGLES, 0, 3);
827 gl.disableVertexAttribArray (positionLoc);
828 gl.useProgram (0);
829 gl.finish ();
880 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
882 const GLint positionLoc = gl.getAttribLocation(program.getProgram(), "a_position");
883 const GLint colorLoc = gl.getAttribLocation(program.getProgram(), "a_color");
891 gl.clearColor (0, 0, 0, 1);
892 gl.clearDepthf (1.0f);
893 gl.clear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
894 gl.viewport (0, 0, m_targetSize, m_targetSize);
895 gl.useProgram (program.getProgram());
896 gl.enable (GL_DEPTH_TEST);
897 gl.enable (GL_POLYGON_OFFSET_FILL);
898 gl.enableVertexAttribArray (positionLoc);
904 gl.vertexAttribPointer (positionLoc, 4, GL_FLOAT, GL_FALSE, 0, triangleTopLeft);
908 gl.depthFunc (GL_ALWAYS);
909 gl.polygonOffset (0, 0);
910 gl.vertexAttrib4f (colorLoc, 1.0f, 1.0f, 1.0f, 1.0f);
911 gl.drawArrays (GL_TRIANGLES, 0, 3);
915 gl.depthFunc (GL_LESS);
916 gl.polygonOffset (-1, 0);
917 gl.vertexAttrib4f (colorLoc, 0.0f, 1.0f, 0.0f, 1.0f);
918 gl.drawArrays (GL_TRIANGLES, 0, 3);
923 gl.vertexAttribPointer (positionLoc, 4, GL_FLOAT, GL_FALSE, 0, triangleBottomRight);
927 gl.depthFunc (GL_ALWAYS);
928 gl.polygonOffset (0, 0);
929 gl.vertexAttrib4f (colorLoc, 1.0f, 1.0f, 1.0f, 1.0f);
930 gl.drawArrays (GL_TRIANGLES, 0, 3);
934 gl.depthFunc (GL_GREATER);
935 gl.polygonOffset (1, 0);
936 gl.vertexAttrib4f (colorLoc, 0.0f, 1.0f, 0.0f, 1.0f);
937 gl.drawArrays (GL_TRIANGLES, 0, 3);
940 gl.disableVertexAttribArray (positionLoc);
941 gl.useProgram (0);
942 gl.finish ();
997 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
999 const GLint positionLoc = gl.getAttribLocation(program.getProgram(), "a_position");
1000 const GLint colorLoc = gl.getAttribLocation(program.getProgram(), "a_color");
1008 gl.clearColor (0, 0, 0, 1);
1009 gl.clearDepthf (1.0f);
1010 gl.clear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
1011 gl.viewport (0, 0, m_targetSize, m_targetSize);
1012 gl.useProgram (program.getProgram());
1013 gl.enable (GL_DEPTH_TEST);
1014 gl.enable (GL_POLYGON_OFFSET_FILL);
1015 gl.enableVertexAttribArray (positionLoc);
1020 gl.vertexAttribPointer (positionLoc, 4, GL_FLOAT, GL_FALSE, 0, triangle);
1024 gl.depthFunc (GL_ALWAYS);
1025 gl.polygonOffset (0, 0);
1026 gl.vertexAttrib4f (colorLoc, 1.0f, 0.0f, 0.0f, 1.0f);
1027 gl.drawArrays (GL_TRIANGLES, 0, 3);
1031 gl.depthFunc (GL_EQUAL);
1032 gl.polygonOffset (4, 0); // triangle slope == 0
1033 gl.vertexAttrib4f (colorLoc, 0.0f, 0.0f, 0.0f, 1.0f);
1034 gl.drawArrays (GL_TRIANGLES, 0, 3);
1037 gl.disableVertexAttribArray (positionLoc);
1038 gl.useProgram (0);
1039 gl.finish ();
1119 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1121 const GLint positionLoc = gl.getAttribLocation(program.getProgram(), "a_position");
1122 const GLint colorLoc = gl.getAttribLocation(program.getProgram(), "a_color");
1130 gl.clearColor (0, 0, 0, 1);
1131 gl.clear (GL_COLOR_BUFFER_BIT);
1132 gl.viewport (0, 0, m_targetSize, m_targetSize);
1133 gl.useProgram (program.getProgram());
1134 gl.enable (GL_DEPTH_TEST);
1135 gl.enable (GL_POLYGON_OFFSET_FILL);
1136 gl.enableVertexAttribArray (positionLoc);
1145 gl.clearDepthf (1.0f); // far
1146 gl.clear (GL_DEPTH_BUFFER_BIT);
1148 gl.vertexAttribPointer (positionLoc, 4, GL_FLOAT, GL_FALSE, 0, triangles[0]);
1152 gl.polygonOffset (10, 0); // clamps any depth on the triangle to 1
1153 gl.depthFunc (GL_NOTEQUAL);
1154 gl.vertexAttrib4f (colorLoc, 1.0f, 0.0f, 0.0f, 1.0f);
1155 gl.drawArrays (GL_TRIANGLES, 0, 3);
1161 gl.clearDepthf (0.0f); // far
1162 gl.clear (GL_DEPTH_BUFFER_BIT);
1164 gl.vertexAttribPointer (positionLoc, 4, GL_FLOAT, GL_FALSE, 0, triangles[1]);
1168 gl.polygonOffset (-10, 0); // clamps depth to 0
1169 gl.depthFunc (GL_NOTEQUAL);
1170 gl.vertexAttrib4f (colorLoc, 0.0f, 1.0f, 0.0f, 1.0f);
1171 gl.drawArrays (GL_TRIANGLES, 0, 3);
1174 gl.disableVertexAttribArray (positionLoc);
1175 gl.useProgram (0);
1176 gl.finish ();