Lines Matching defs:context

98 	void shadeFragments (rr::FragmentPacket* packets, const int numPackets, const rr::FragmentShadingContext& context) const
106 rr::writeFragmentOutput(context, packetNdx, fragNdx, 0, color);
170 StencilCase (Context& context, const char* name, const char* description);
180 void executeOps (sglr::Context& context, const IVec4& cell, const vector<StencilOp>& ops);
181 void visualizeStencil (sglr::Context& context, int stencilBits, int stencilStep);
187 StencilCase::StencilCase (Context& context, const char* name, const char* description)
188 : TestCase (context, name, description)
205 void StencilCase::executeOps (sglr::Context& context, const IVec4& cell, const vector<StencilOp>& ops)
208 float x0 = 2.0f*((float)cell.x() / (float)context.getWidth())-1.0f;
209 float y0 = 2.0f*((float)cell.y() / (float)context.getHeight())-1.0f;
210 float x1 = x0 + 2.0f*((float)cell.z() / (float)context.getWidth());
211 float y1 = y0 + 2.0f*((float)cell.w() / (float)context.getHeight());
213 m_shader.setColor(context, m_shaderID, tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
222 context.enable(GL_SCISSOR_TEST);
223 context.scissor(cell.x(), cell.y(), cell.z(), cell.w());
224 context.clearDepthf(op.depth);
225 context.clear(GL_DEPTH_BUFFER_BIT);
226 context.disable(GL_SCISSOR_TEST);
230 context.enable(GL_SCISSOR_TEST);
231 context.scissor(cell.x(), cell.y(), cell.z(), cell.w());
232 context.clearStencil(op.stencil);
233 context.clear(GL_STENCIL_BUFFER_BIT);
234 context.disable(GL_SCISSOR_TEST);
238 context.enable(GL_DEPTH_TEST);
239 context.enable(GL_STENCIL_TEST);
240 context.depthFunc(op.depthTest);
241 context.stencilFunc(op.stencilTest, op.stencil, op.stencilMask);
242 context.stencilOp(op.sFail, op.dFail, op.dPass);
243 sglr::drawQuad(context, m_shaderID, Vec3(x0, y0, op.depth), Vec3(x1, y1, op.depth));
244 context.disable(GL_STENCIL_TEST);
245 context.disable(GL_DEPTH_TEST);
254 void StencilCase::visualizeStencil (sglr::Context& context, int stencilBits, int stencilStep)
259 context.enable(GL_STENCIL_TEST);
260 context.stencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
268 m_shader.setColor(context, m_shaderID, color);
269 context.stencilFunc(GL_EQUAL, value, 0xffffffffu);
270 sglr::drawQuad(context, m_shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(+1.0f, +1.0f, 0.0f));
322 // Execute for gles2 context
324 sglr::GLContext context(m_context.getRenderContext(), log, 0 /* don't log calls or program */, viewport);
326 m_shaderID = context.createProgram(&m_shader);
328 context.clearColor(1.0f, 0.0f, 0.0f, 1.0f);
329 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
332 executeOps(context, cells[ndx], ops[ndx]);
334 visualizeStencil(context, stencilBits, stencilStep);
336 gles2Error = context.getError();
337 context.readPixels(gles2Frame, 0, 0, width, height);
340 // Execute for reference context
343 sglr::ReferenceContext context (sglr::ReferenceContextLimits(m_context.getRenderContext()), buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer());
345 m_shaderID = context.createProgram(&m_shader);
347 context.clearColor(1.0f, 0.0f, 0.0f, 1.0f);
348 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
351 executeOps(context, cells[ndx], ops[ndx]);
353 visualizeStencil(context, stencilBits, stencilStep);
355 context.readPixels(refFrame, 0, 0, width, height);
378 StencilTests::StencilTests (Context& context)
379 : TestCaseGroup(context, "stencil", "Stencil Tests")
392 SimpleStencilCase (Context& context, const char* name, const char* description, GenStencilOpsFunc genOpsFunc)
393 : StencilCase (context, name, description)