Lines Matching defs:context

101 	void shadeFragments (rr::FragmentPacket* packets, const int numPackets, const rr::FragmentShadingContext& context) const
109 rr::writeFragmentOutput(context, packetNdx, fragNdx, 0, color);
173 StencilCase (Context& context, const char* name, const char* description);
183 void executeOps (sglr::Context& context, const IVec4& cell, const vector<StencilOp>& ops);
184 void visualizeStencil (sglr::Context& context, int stencilBits, int stencilStep);
190 StencilCase::StencilCase (Context& context, const char* name, const char* description)
191 : TestCase (context, name, description)
208 void StencilCase::executeOps (sglr::Context& context, const IVec4& cell, const vector<StencilOp>& ops)
211 float x0 = 2.0f*((float)cell.x() / (float)context.getWidth())-1.0f;
212 float y0 = 2.0f*((float)cell.y() / (float)context.getHeight())-1.0f;
213 float x1 = x0 + 2.0f*((float)cell.z() / (float)context.getWidth());
214 float y1 = y0 + 2.0f*((float)cell.w() / (float)context.getHeight());
216 m_shader.setColor(context, m_shaderID, tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
225 context.enable(GL_SCISSOR_TEST);
226 context.scissor(cell.x(), cell.y(), cell.z(), cell.w());
227 context.clearDepthf(op.depth);
228 context.clear(GL_DEPTH_BUFFER_BIT);
229 context.disable(GL_SCISSOR_TEST);
233 context.enable(GL_SCISSOR_TEST);
234 context.scissor(cell.x(), cell.y(), cell.z(), cell.w());
235 context.clearStencil(op.stencil);
236 context.clear(GL_STENCIL_BUFFER_BIT);
237 context.disable(GL_SCISSOR_TEST);
241 context.enable(GL_DEPTH_TEST);
242 context.enable(GL_STENCIL_TEST);
243 context.depthFunc(op.depthTest);
244 context.stencilFunc(op.stencilTest, op.stencil, op.stencilMask);
245 context.stencilOp(op.sFail, op.dFail, op.dPass);
246 sglr::drawQuad(context, m_shaderID, Vec3(x0, y0, op.depth), Vec3(x1, y1, op.depth));
247 context.disable(GL_STENCIL_TEST);
248 context.disable(GL_DEPTH_TEST);
257 void StencilCase::visualizeStencil (sglr::Context& context, int stencilBits, int stencilStep)
262 context.enable(GL_STENCIL_TEST);
263 context.stencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
271 m_shader.setColor(context, m_shaderID, color);
272 context.stencilFunc(GL_EQUAL, value, 0xffffffffu);
273 sglr::drawQuad(context, m_shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(+1.0f, +1.0f, 0.0f));
325 // Execute for gles3 context
327 sglr::GLContext context(m_context.getRenderContext(), log, 0 /* don't log calls or program */, viewport);
329 m_shaderID = context.createProgram(&m_shader);
331 context.clearColor(1.0f, 0.0f, 0.0f, 1.0f);
332 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
335 executeOps(context, cells[ndx], ops[ndx]);
337 visualizeStencil(context, stencilBits, stencilStep);
339 gles2Error = context.getError();
340 context.readPixels(gles2Frame, 0, 0, width, height);
343 // Execute for reference context
346 sglr::ReferenceContext context (sglr::ReferenceContextLimits(m_context.getRenderContext()), buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer());
348 m_shaderID = context.createProgram(&m_shader);
350 context.clearColor(1.0f, 0.0f, 0.0f, 1.0f);
351 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
354 executeOps(context, cells[ndx], ops[ndx]);
356 visualizeStencil(context, stencilBits, stencilStep);
358 context.readPixels(refFrame, 0, 0, width, height);
381 StencilTests::StencilTests (Context& context)
382 : TestCaseGroup(context, "stencil", "Stencil Tests")
395 SimpleStencilCase (Context& context, const char* name, const char* description, GenStencilOpsFunc genOpsFunc)
396 : StencilCase (context, name, description)