Lines Matching defs:ctx
130 static bool checkSupport(Context& ctx)
132 auto contextType = ctx.getRenderContext().getType();
135 ctx.getContextInfo().isExtensionSupported("GL_EXT_geometry_shader");
1827 void renderWithContext (sglr::Context& ctx, sglr::ShaderProgram& program, tcu::Surface& dstSurface);
1828 virtual void preRender (sglr::Context& ctx, GLuint programID);
1829 virtual void postRender (sglr::Context& ctx, GLuint programID);
2060 void GeometryShaderRenderTest::renderWithContext (sglr::Context& ctx, sglr::ShaderProgram& program, tcu::Surface& dstSurface)
2062 #define CHECK_GL_CTX_ERRORS() glu::checkError(ctx.getError(), DE_NULL, __FILE__, __LINE__)
2064 const GLuint programId = ctx.createProgram(&program);
2065 const GLint attrPosLoc = ctx.getAttribLocation(programId, "a_position");
2066 const GLint attrColLoc = ctx.getAttribLocation(programId, m_dataAttributeName);
2072 ctx.genVertexArrays(1, &vaoId);
2073 ctx.bindVertexArray(vaoId);
2077 ctx.genBuffers(1, &vertexPosBuf);
2078 ctx.bindBuffer(GL_ARRAY_BUFFER, vertexPosBuf);
2079 ctx.bufferData(GL_ARRAY_BUFFER, m_vertexPosData.size() * sizeof(tcu::Vec4), &m_vertexPosData[0], GL_STATIC_DRAW);
2080 ctx.vertexAttribPointer(attrPosLoc, 4, GL_FLOAT, GL_FALSE, 0, DE_NULL);
2081 ctx.enableVertexAttribArray(attrPosLoc);
2086 ctx.genBuffers(1, &vertexAttrBuf);
2087 ctx.bindBuffer(GL_ARRAY_BUFFER, vertexAttrBuf);
2088 ctx.bufferData(GL_ARRAY_BUFFER, m_vertexAttrData.size() * sizeof(tcu::Vec4), &m_vertexAttrData[0], GL_STATIC_DRAW);
2089 ctx.vertexAttribPointer(attrColLoc, 4, GL_FLOAT, GL_FALSE, 0, DE_NULL);
2090 ctx.enableVertexAttribArray(attrColLoc);
2093 ctx.vertexAttribDivisor(attrColLoc, m_vertexAttrDivisor);
2098 ctx.genBuffers(1, &elementArrayBuf);
2099 ctx.bindBuffer(GL_ELEMENT_ARRAY_BUFFER, elementArrayBuf);
2100 ctx.bufferData(GL_ELEMENT_ARRAY_BUFFER, m_indices.size() * sizeof(deUint16), &m_indices[0], GL_STATIC_DRAW);
2103 ctx.clearColor(0, 0, 0, 1);
2104 ctx.clear(GL_COLOR_BUFFER_BIT);
2106 ctx.viewport(0, 0, m_viewportSize.x(), m_viewportSize.y());
2109 ctx.useProgram(programId);
2112 preRender(ctx, programId);
2117 ctx.enable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
2122 ctx.drawElements(m_inputPrimitives, m_numDrawVertices, GL_UNSIGNED_SHORT, DE_NULL);
2124 ctx.drawArraysInstanced(m_inputPrimitives, 0, m_numDrawVertices, m_numDrawInstances);
2126 ctx.drawArrays(m_inputPrimitives, 0, m_numDrawVertices);
2132 ctx.disable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
2136 postRender(ctx, programId);
2139 ctx.useProgram(0);
2142 ctx.disableVertexAttribArray(attrPosLoc);
2144 ctx.disableVertexAttribArray(attrColLoc);
2147 ctx.deleteBuffers(1, &vertexPosBuf);
2149 ctx.deleteBuffers(1, &vertexAttrBuf);
2151 ctx.deleteBuffers(1, &elementArrayBuf);
2153 ctx.deleteVertexArrays(1, &vaoId);
2157 ctx.finish();
2158 ctx.readPixels(dstSurface, 0, 0, m_viewportSize.x(), m_viewportSize.y());
2163 void GeometryShaderRenderTest::preRender (sglr::Context& ctx, GLuint programID)
2165 DE_UNREF(ctx);
2169 void GeometryShaderRenderTest::postRender (sglr::Context& ctx, GLuint programID)
2171 DE_UNREF(ctx);
3756 void preRender (sglr::Context& ctx, GLuint programID);
3855 void VaryingOutputCountCase::preRender (sglr::Context& ctx, GLuint programID)
3859 const int location = ctx.getUniformLocation(programID, "u_emitCount");
3865 ctx.uniform4iv(location, 1, emitCount);
3876 const int location = ctx.getUniformLocation(programID, "u_sampler");
3881 ctx.uniform1i(location, 0);
3884 ctx.genTextures(1, &texID);
3885 ctx.bindTexture(GL_TEXTURE_2D, texID);
3886 ctx.texImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
3887 ctx.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
3888 ctx.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);