Lines Matching defs:Clear
21 * \brief Depth and stencil clear tests.
66 struct Clear
68 Clear (void)
130 void generateClears (vector<Clear>& dst, deUint32 seed);
131 void renderGL (tcu::Surface& dst, const vector<Clear>& clears);
132 void renderReference (tcu::Surface& dst, const vector<Clear>& clears);
207 vector<Clear> clears;
227 void DepthStencilClearCase::generateClears (vector<Clear>& clears, deUint32 seed)
236 for (vector<Clear>::iterator clear = clears.begin(); clear != clears.end(); clear++)
245 clear->useScissor = true; // \todo [pyry] Should we randomize?
246 clear->scissor = tcu::IVec4(x, y, w, h);
249 clear->useScissor = false;
251 clear->clearDepth = rnd.getFloat(-0.2f, 1.2f);
252 clear->clearStencil = rnd.getUint32();
254 clear->depthMask = m_masked ? rnd.getBool() : true;
255 clear->stencilMask = m_masked ? rnd.getUint32() : 0xffffffffu;
261 case 0: clear->clearMask = GL_DEPTH_BUFFER_BIT; break;
262 case 1: clear->clearMask = GL_STENCIL_BUFFER_BIT; break;
263 case 2: clear->clearMask = GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT; break;
267 clear->clearMask = GL_DEPTH_BUFFER_BIT;
271 clear->clearMask = GL_STENCIL_BUFFER_BIT;
276 void DepthStencilClearCase::renderGL (tcu::Surface& dst, const vector<Clear>& clears)
283 // Clear with default values.
287 gl.clear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
291 for (vector<Clear>::const_iterator clear = clears.begin(); clear != clears.end(); clear++)
293 if (clear->useScissor)
296 gl.scissor(clear->scissor.x(), clear->scissor.y(), clear->scissor.z(), clear->scissor.w());
299 // Clear values.
300 gl.clearDepthf (clear->clearDepth);
301 gl.clearStencil (clear->clearStencil);
304 gl.depthMask (clear->depthMask ? GL_TRUE : GL_FALSE);
305 gl.stencilMask (clear->stencilMask);
307 // Execute clear.
308 gl.clear (clear->clearMask);
310 if (clear->useScissor)
397 void DepthStencilClearCase::renderReference (tcu::Surface& dst, const vector<Clear>& clears)
402 // Clear surface to red.
403 tcu::clear(dst.getAccess(), tcu::RGBA::red().toVec());
413 // Clear to default value.
418 for (vector<Clear>::const_iterator clear = clears.begin(); clear != clears.end(); clear++)
420 // Clear / mask test.
421 if ((clear->clearMask & GL_DEPTH_BUFFER_BIT) == 0 || !clear->depthMask)
424 tcu::IVec4 clearRect = clear->useScissor ? clear->scissor : tcu::IVec4(0, 0, dst.getWidth(), dst.getHeight());
431 rowAccess.setPixDepth(de::clamp(clear->clearDepth, 0.0f, 1.0f), x, 0);
457 // Clear to default value.
462 for (vector<Clear>::const_iterator clear = clears.begin(); clear != clears.end(); clear++)
464 // Clear / mask test.
465 if ((clear->clearMask & GL_STENCIL_BUFFER_BIT) == 0 || clear->stencilMask == 0)
468 tcu::IVec4 clearRect = clear->useScissor ? clear->scissor : tcu::IVec4(0, 0, dst.getWidth(), dst.getHeight());
477 deUint32 newVal = ((oldVal & ~clear->stencilMask) | (clear->clearStencil & clear->stencilMask)) & bufMask;
497 : TestCaseGroup(context, "depth_stencil_clear", "Depth and stencil clear tests")