Lines Matching refs:ctx

772 	void			renderTo					(sglr::Context& ctx, sglr::ShaderProgram& program, tcu::Surface& dst);
794 sglr::GLContext ctx (m_context.getRenderContext(), m_testCtx.getLog(), sglr::GLCONTEXT_LOG_CALLS | sglr::GLCONTEXT_LOG_PROGRAMS, tcu::IVec4(0, 0, renderTargetWidth, renderTargetHeight));
800 renderTo(ctx, program, surface);
811 void InstancedGridRenderTest::renderTo (sglr::Context& ctx, sglr::ShaderProgram& program, tcu::Surface& dst)
822 deUint32 programID = ctx.createProgram(&program);
823 deInt32 posLocation = ctx.getAttribLocation(programID, "a_position");
824 deInt32 offsetLocation = ctx.getAttribLocation(programID, "a_offset");
825 deInt32 colorLocation = ctx.getAttribLocation(programID, "a_color");
856 ctx.genVertexArrays(1, &vaoID);
857 ctx.bindVertexArray(vaoID);
859 ctx.genBuffers(1, &positionBuf);
860 ctx.bindBuffer(GL_ARRAY_BUFFER, positionBuf);
861 ctx.bufferData(GL_ARRAY_BUFFER, sizeof(vertexPositions), vertexPositions, GL_STATIC_DRAW);
862 ctx.vertexAttribPointer(posLocation, 4, GL_FLOAT, GL_FALSE, 0, DE_NULL);
863 ctx.vertexAttribDivisor(posLocation, 0);
864 ctx.enableVertexAttribArray(posLocation);
866 ctx.genBuffers(1, &offsetBuf);
867 ctx.bindBuffer(GL_ARRAY_BUFFER, offsetBuf);
868 ctx.bufferData(GL_ARRAY_BUFFER, offsets.size() * sizeof(tcu::Vec4), &offsets[0], GL_STATIC_DRAW);
869 ctx.vertexAttribPointer(offsetLocation, 4, GL_FLOAT, GL_FALSE, 0, DE_NULL);
870 ctx.vertexAttribDivisor(offsetLocation, 1);
871 ctx.enableVertexAttribArray(offsetLocation);
873 ctx.genBuffers(1, &colorBuf);
874 ctx.bindBuffer(GL_ARRAY_BUFFER, colorBuf);
875 ctx.bufferData(GL_ARRAY_BUFFER, colors.size() * sizeof(tcu::Vec4), &colors[0], GL_STATIC_DRAW);
876 ctx.vertexAttribPointer(colorLocation, 4, GL_FLOAT, GL_FALSE, 0, DE_NULL);
877 ctx.vertexAttribDivisor(colorLocation, 1);
878 ctx.enableVertexAttribArray(colorLocation);
882 ctx.genBuffers(1, &indexBuf);
883 ctx.bindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuf);
884 ctx.bufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW);
887 ctx.genBuffers(1, &drawIndirectBuf);
888 ctx.bindBuffer(GL_DRAW_INDIRECT_BUFFER, drawIndirectBuf);
899 ctx.bufferData(GL_DRAW_INDIRECT_BUFFER, sizeof(command), &command, GL_STATIC_DRAW);
909 ctx.bufferData(GL_DRAW_INDIRECT_BUFFER, sizeof(command), &command, GL_STATIC_DRAW);
912 ctx.clearColor(0, 0, 0, 1);
913 ctx.clear(GL_COLOR_BUFFER_BIT);
915 ctx.viewport(0, 0, dst.getWidth(), dst.getHeight());
917 ctx.useProgram(programID);
919 ctx.drawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, DE_NULL);
921 ctx.drawArraysIndirect(GL_TRIANGLES, DE_NULL);
922 ctx.useProgram(0);
924 glu::checkError(ctx.getError(), "", __FILE__, __LINE__);
926 ctx.deleteBuffers(1, &drawIndirectBuf);
928 ctx.deleteBuffers(1, &indexBuf);
929 ctx.deleteBuffers(1, &colorBuf);
930 ctx.deleteBuffers(1, &offsetBuf);
931 ctx.deleteBuffers(1, &positionBuf);
932 ctx.deleteVertexArrays(1, &vaoID);
933 ctx.deleteProgram(programID);
935 ctx.finish();
936 ctx.readPixels(dst, 0, 0, dst.getWidth(), dst.getHeight());
938 glu::checkError(ctx.getError(), "", __FILE__, __LINE__);