1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.0 Module
3 * -------------------------------------------------
5 * Copyright 2014 The Android Open Source Project
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * \brief Buffer data upload tests.
22 *//*--------------------------------------------------------------------*/
24 #include "es3fBufferWriteTests.hpp"
25 #include "glsBufferTestUtil.hpp"
26 #include "tcuTestLog.hpp"
27 #include "gluStrUtil.hpp"
30 #include "deRandom.hpp"
31 #include "deStringUtil.hpp"
33 #include "glwEnums.hpp"
34 #include "glwFunctions.hpp"
52 using namespace gls::BufferTestUtil;
63 DataStoreSpec (deUint32 target_, deUint32 usage_, int size_)
75 struct DataStoreSpecVecBuilder
77 std::vector<DataStoreSpec>& list;
79 DataStoreSpecVecBuilder (std::vector<DataStoreSpec>& list_)
84 DataStoreSpecVecBuilder& operator<< (const DataStoreSpec& spec)
91 struct RangeVecBuilder
93 std::vector<tcu::IVec2>& list;
95 RangeVecBuilder (std::vector<tcu::IVec2>& list_)
100 RangeVecBuilder& operator<< (const tcu::IVec2& vec)
107 template<typename Iterator>
108 static bool isRangeListValid (Iterator begin, Iterator end)
113 tcu::IVec2 prev = *begin;
116 for (; begin != end; ++begin)
118 tcu::IVec2 cur = *begin;
119 if (cur.x() <= prev.x() || cur.x() <= prev.x()+prev.y())
128 inline bool rangesIntersect (const tcu::IVec2& a, const tcu::IVec2& b)
130 return de::inRange(a.x(), b.x(), b.x()+b.y()) || de::inRange(a.x()+a.y(), b.x(), b.x()+b.y()) ||
131 de::inRange(b.x(), a.x(), a.x()+a.y()) || de::inRange(b.x()+b.y(), a.x(), a.x()+a.y());
134 inline tcu::IVec2 unionRanges (const tcu::IVec2& a, const tcu::IVec2& b)
136 DE_ASSERT(rangesIntersect(a, b));
138 int start = de::min(a.x(), b.x());
139 int end = de::max(a.x()+a.y(), b.x()+b.y());
141 return tcu::IVec2(start, end-start);
144 //! Updates range list (start, len) with a new range.
145 std::vector<tcu::IVec2> addRangeToList (const std::vector<tcu::IVec2>& oldList, const tcu::IVec2& newRange)
147 DE_ASSERT(newRange.y() > 0);
149 std::vector<tcu::IVec2> newList;
150 std::vector<tcu::IVec2>::const_iterator oldListIter = oldList.begin();
152 // Append ranges that end before the new range.
153 for (; oldListIter != oldList.end() && oldListIter->x()+oldListIter->y() < newRange.x(); ++oldListIter)
154 newList.push_back(*oldListIter);
156 // Join any ranges that intersect new range
158 tcu::IVec2 curRange = newRange;
159 while (oldListIter != oldList.end() && rangesIntersect(curRange, *oldListIter))
161 curRange = unionRanges(curRange, *oldListIter);
165 newList.push_back(curRange);
168 // Append remaining ranges.
169 for (; oldListIter != oldList.end(); oldListIter++)
170 newList.push_back(*oldListIter);
172 DE_ASSERT(isRangeListValid(newList.begin(), newList.end()));
177 class BasicBufferDataCase : public BufferCase
180 BasicBufferDataCase (Context& context, const char* name, const char* desc, deUint32 target, deUint32 usage, int size, VerifyType verify)
181 : BufferCase (context.getTestContext(), context.getRenderContext(), name, desc)
189 IterateResult iterate (void)
191 const deUint32 dataSeed = deStringHash(getName()) ^ 0x125;
192 BufferVerifier verifier (m_renderCtx, m_testCtx.getLog(), m_verify);
193 ReferenceBuffer refBuf;
196 refBuf.setSize(m_size);
197 fillWithRandomBytes(refBuf.getPtr(), m_size, dataSeed);
199 deUint32 buf = genBuffer();
200 glBindBuffer(m_target, buf);
201 glBufferData(m_target, m_size, refBuf.getPtr(), m_usage);
205 isOk = verifier.verify(buf, refBuf.getPtr(), 0, m_size, m_target);
209 m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS : QP_TEST_RESULT_FAIL,
210 isOk ? "Pass" : "Buffer verification failed");
221 class RecreateBufferDataStoreCase : public BufferCase
224 RecreateBufferDataStoreCase (Context& context, const char* name, const char* desc, const DataStoreSpec* specs, int numSpecs, VerifyType verify)
225 : BufferCase(context.getTestContext(), context.getRenderContext(), name, desc)
226 , m_specs (specs, specs+numSpecs)
231 IterateResult iterate (void)
233 const deUint32 baseSeed = deStringHash(getName()) ^ 0xbeef;
234 BufferVerifier verifier (m_renderCtx, m_testCtx.getLog(), m_verify);
235 ReferenceBuffer refBuf;
236 const deUint32 buf = genBuffer();
238 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
240 for (vector<DataStoreSpec>::const_iterator spec = m_specs.begin(); spec != m_specs.end(); spec++)
244 refBuf.setSize(spec->size);
245 fillWithRandomBytes(refBuf.getPtr(), spec->size, baseSeed ^ deInt32Hash(spec->size+spec->target+spec->usage));
247 glBindBuffer(spec->target, buf);
248 glBufferData(spec->target, spec->size, refBuf.getPtr(), spec->usage);
252 iterOk = verifier.verify(buf, refBuf.getPtr(), 0, spec->size, spec->target);
256 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
266 std::vector<DataStoreSpec> m_specs;
270 class BasicBufferSubDataCase : public BufferCase
273 BasicBufferSubDataCase (Context& context, const char* name, const char* desc, deUint32 target, deUint32 usage, int size, int subDataOffs, int subDataSize, VerifyType verify)
274 : BufferCase (context.getTestContext(), context.getRenderContext(), name, desc)
278 , m_subDataOffs (subDataOffs)
279 , m_subDataSize (subDataSize)
282 DE_ASSERT(de::inBounds(subDataOffs, 0, size) && de::inRange(subDataOffs+subDataSize, 0, size));
285 IterateResult iterate (void)
287 const deUint32 dataSeed = deStringHash(getName());
288 BufferVerifier verifier (m_renderCtx, m_testCtx.getLog(), m_verify);
289 ReferenceBuffer refBuf;
292 refBuf.setSize(m_size);
294 deUint32 buf = genBuffer();
295 glBindBuffer(m_target, buf);
297 // Initialize with glBufferData()
298 fillWithRandomBytes(refBuf.getPtr(), m_size, dataSeed ^ 0x80354f);
299 glBufferData(m_target, m_size, refBuf.getPtr(), m_usage);
302 // Re-specify part of buffer
303 fillWithRandomBytes(refBuf.getPtr()+m_subDataOffs, m_subDataSize, dataSeed ^ 0xfac425c);
304 glBufferSubData(m_target, m_subDataOffs, m_subDataSize, refBuf.getPtr()+m_subDataOffs);
306 isOk = verifier.verify(buf, refBuf.getPtr(), 0, m_size, m_target);
310 m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS : QP_TEST_RESULT_FAIL,
311 isOk ? "Pass" : "Buffer verification failed");
324 class SubDataToUndefinedCase : public BufferCase
327 SubDataToUndefinedCase (Context& context, const char* name, const char* desc, deUint32 target, deUint32 usage, int size, const tcu::IVec2* ranges, int numRanges, VerifyType verify)
328 : BufferCase (context.getTestContext(), context.getRenderContext(), name, desc)
332 , m_ranges (ranges, ranges+numRanges)
337 IterateResult iterate (void)
339 const deUint32 dataSeed = deStringHash(getName());
340 BufferVerifier verifier (m_renderCtx, m_testCtx.getLog(), m_verify);
341 ReferenceBuffer refBuf;
343 std::vector<tcu::IVec2> definedRanges;
345 refBuf.setSize(m_size);
347 deUint32 buf = genBuffer();
348 glBindBuffer(m_target, buf);
350 // Initialize storage with glBufferData()
351 glBufferData(m_target, m_size, DE_NULL, m_usage);
354 // Fill specified ranges with glBufferSubData()
355 for (vector<tcu::IVec2>::const_iterator range = m_ranges.begin(); range != m_ranges.end(); range++)
357 fillWithRandomBytes(refBuf.getPtr()+range->x(), range->y(), dataSeed ^ deInt32Hash(range->x()+range->y()));
358 glBufferSubData(m_target, range->x(), range->y(), refBuf.getPtr()+range->x());
360 // Mark range as defined
361 definedRanges = addRangeToList(definedRanges, *range);
364 // Verify defined parts
365 for (vector<tcu::IVec2>::const_iterator range = definedRanges.begin(); range != definedRanges.end(); range++)
367 if (!verifier.verify(buf, refBuf.getPtr(), range->x(), range->y(), m_target))
373 m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS : QP_TEST_RESULT_FAIL,
374 isOk ? "Pass" : "Buffer verification failed");
382 std::vector<tcu::IVec2> m_ranges;
386 class RandomBufferWriteCase : public BufferCase
389 RandomBufferWriteCase (Context& context, const char* name, const char* desc, deUint32 seed)
390 : BufferCase(context.getTestContext(), context.getRenderContext(), name, desc)
392 , m_verifier (DE_NULL)
399 ~RandomBufferWriteCase (void)
409 m_buffer = genBuffer();
411 m_verifier = new BufferVerifier(m_renderCtx, m_testCtx.getLog(), VERIFY_AS_VERTEX_ARRAY);
413 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
418 deleteBuffer(m_buffer);
419 m_refBuffer.setSize(0);
422 m_verifier = DE_NULL;
424 BufferCase::deinit();
427 IterateResult iterate (void)
430 const int numIterations = 5;
431 const int uploadsPerIteration = 7;
432 const int minSize = 12;
433 const int maxSize = 32*1024;
434 const float respecifyProbability = 0.07f;
435 const float respecifyDataProbability = 0.2f;
437 static const deUint32 bufferTargets[] =
441 GL_COPY_WRITE_BUFFER,
442 GL_ELEMENT_ARRAY_BUFFER,
443 GL_PIXEL_PACK_BUFFER,
444 GL_PIXEL_UNPACK_BUFFER,
445 GL_TRANSFORM_FEEDBACK_BUFFER,
449 static const deUint32 usageHints[] =
463 deUint32 curBoundTarget = GL_NONE;
464 de::Random rnd (m_seed ^ deInt32Hash(m_iterNdx) ^ 0xacf92e);
466 m_testCtx.getLog() << TestLog::Section(string("Iteration") + de::toString(m_iterNdx+1), string("Iteration ") + de::toString(m_iterNdx+1) + " / " + de::toString(numIterations));
468 for (int uploadNdx = 0; uploadNdx < uploadsPerIteration; uploadNdx++)
470 const deUint32 target = bufferTargets[rnd.getInt(0, DE_LENGTH_OF_ARRAY(bufferTargets)-1)];
471 const bool respecify = m_curSize == 0 || rnd.getFloat() < respecifyProbability;
473 if (target != curBoundTarget)
475 glBindBuffer(target, m_buffer);
476 curBoundTarget = target;
481 const int size = rnd.getInt(minSize, maxSize);
482 const deUint32 hint = usageHints[rnd.getInt(0, DE_LENGTH_OF_ARRAY(usageHints)-1)];
483 const bool fillWithData = rnd.getFloat() < respecifyDataProbability;
485 m_refBuffer.setSize(size);
487 fillWithRandomBytes(m_refBuffer.getPtr(), size, rnd.getUint32());
489 glBufferData(target, size, fillWithData ? m_refBuffer.getPtr() : DE_NULL, hint);
491 m_validRanges.clear();
493 m_validRanges.push_back(tcu::IVec2(0, size));
499 // \note Non-uniform size distribution.
500 const int size = de::clamp(deRoundFloatToInt32((float)m_curSize * deFloatPow(rnd.getFloat(0.0f, 0.7f), 3.0f)), minSize, m_curSize);
501 const int offset = rnd.getInt(0, m_curSize-size);
503 fillWithRandomBytes(m_refBuffer.getPtr()+offset, size, rnd.getUint32());
504 glBufferSubData(target, offset, size, m_refBuffer.getPtr()+offset);
506 m_validRanges = addRangeToList(m_validRanges, tcu::IVec2(offset, size));
512 deUint32 err = glGetError();
513 if (err != GL_NO_ERROR)
514 throw tcu::TestError(string("Got ") + glu::getErrorStr(err).toString());
517 // Verify valid ranges.
518 for (vector<IVec2>::const_iterator range = m_validRanges.begin(); range != m_validRanges.end(); range++)
520 const deUint32 targetHint = GL_ARRAY_BUFFER;
521 if (!m_verifier->verify(m_buffer, m_refBuffer.getPtr(), range->x(), range->y(), targetHint))
523 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Buffer verification failed");
529 m_testCtx.getLog() << TestLog::EndSection;
531 DE_ASSERT(iterOk || m_testCtx.getTestResult() != QP_TEST_RESULT_PASS);
534 return (iterOk && m_iterNdx < numIterations) ? CONTINUE : STOP;
540 BufferVerifier* m_verifier;
542 ReferenceBuffer m_refBuffer;
543 std::vector<tcu::IVec2> m_validRanges;
548 BufferWriteTests::BufferWriteTests (Context& context)
549 : TestCaseGroup(context, "write", "Buffer data upload tests")
553 BufferWriteTests::~BufferWriteTests (void)
557 void BufferWriteTests::init (void)
559 static const deUint32 bufferTargets[] =
563 GL_COPY_WRITE_BUFFER,
564 GL_ELEMENT_ARRAY_BUFFER,
565 GL_PIXEL_PACK_BUFFER,
566 GL_PIXEL_UNPACK_BUFFER,
567 GL_TRANSFORM_FEEDBACK_BUFFER,
571 static const deUint32 usageHints[] =
586 tcu::TestCaseGroup* const basicGroup = new tcu::TestCaseGroup(m_testCtx, "basic", "Basic upload with glBufferData()");
587 addChild(basicGroup);
589 for (int targetNdx = 0; targetNdx < DE_LENGTH_OF_ARRAY(bufferTargets); targetNdx++)
591 for (int usageNdx = 0; usageNdx < DE_LENGTH_OF_ARRAY(usageHints); usageNdx++)
593 const deUint32 target = bufferTargets[targetNdx];
594 const deUint32 usage = usageHints[usageNdx];
595 const int size = 1020;
596 const VerifyType verify = VERIFY_AS_VERTEX_ARRAY;
597 const string name = string(getBufferTargetName(target)) + "_" + getUsageHintName(usage);
599 basicGroup->addChild(new BasicBufferDataCase(m_context, name.c_str(), "", target, usage, size, verify));
606 tcu::TestCaseGroup* const recreateStoreGroup = new tcu::TestCaseGroup(m_testCtx, "recreate_store", "Data store recreate using glBufferData()");
607 addChild(recreateStoreGroup);
609 #define RECREATE_STORE_CASE(NAME, DESC, SPECLIST) \
611 std::vector<DataStoreSpec> specs; \
612 DataStoreSpecVecBuilder builder(specs); \
614 recreateStoreGroup->addChild(new RecreateBufferDataStoreCase(m_context, #NAME, DESC, &specs[0], (int)specs.size(), VERIFY_AS_VERTEX_ARRAY)); \
615 } while (deGetFalse())
617 RECREATE_STORE_CASE(identical_1, "Recreate with identical parameters",
618 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STATIC_DRAW, 996)
619 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STATIC_DRAW, 996)
620 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STATIC_DRAW, 996));
622 RECREATE_STORE_CASE(identical_2, "Recreate with identical parameters",
623 << DataStoreSpec(GL_COPY_WRITE_BUFFER, GL_STATIC_DRAW, 72)
624 << DataStoreSpec(GL_COPY_WRITE_BUFFER, GL_STATIC_DRAW, 72)
625 << DataStoreSpec(GL_COPY_WRITE_BUFFER, GL_STATIC_DRAW, 72));
627 RECREATE_STORE_CASE(different_target, "Recreate with different target",
628 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STATIC_DRAW, 504)
629 << DataStoreSpec(GL_COPY_READ_BUFFER, GL_STATIC_DRAW, 504)
630 << DataStoreSpec(GL_COPY_WRITE_BUFFER, GL_STATIC_DRAW, 504)
631 << DataStoreSpec(GL_ELEMENT_ARRAY_BUFFER, GL_STATIC_DRAW, 504)
632 << DataStoreSpec(GL_PIXEL_PACK_BUFFER, GL_STATIC_DRAW, 504)
633 << DataStoreSpec(GL_PIXEL_UNPACK_BUFFER, GL_STATIC_DRAW, 504)
634 << DataStoreSpec(GL_TRANSFORM_FEEDBACK_BUFFER, GL_STATIC_DRAW, 504)
635 << DataStoreSpec(GL_UNIFORM_BUFFER, GL_STATIC_DRAW, 504)
636 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STATIC_DRAW, 504));
638 RECREATE_STORE_CASE(different_usage, "Recreate with different usage",
639 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STREAM_DRAW, 1644)
640 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STREAM_COPY, 1644)
641 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STATIC_READ, 1644)
642 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STREAM_READ, 1644)
643 << DataStoreSpec(GL_ARRAY_BUFFER, GL_DYNAMIC_COPY, 1644)
644 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STATIC_COPY, 1644)
645 << DataStoreSpec(GL_ARRAY_BUFFER, GL_DYNAMIC_READ, 1644)
646 << DataStoreSpec(GL_ARRAY_BUFFER, GL_DYNAMIC_DRAW, 1644)
647 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STATIC_DRAW, 1644)
648 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STREAM_DRAW, 1644));
650 RECREATE_STORE_CASE(different_size, "Recreate with different size",
651 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STREAM_DRAW, 1024)
652 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STREAM_DRAW, 12)
653 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STREAM_DRAW, 3327)
654 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STREAM_DRAW, 92)
655 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STREAM_DRAW, 123795)
656 << DataStoreSpec(GL_ARRAY_BUFFER, GL_STREAM_DRAW, 571));
658 #undef RECREATE_STORE_CASE
662 const int numRandomCases = 4;
663 const int numUploadsPerCase = 10;
664 const int minSize = 12;
665 const int maxSize = 65536;
666 const VerifyType verify = VERIFY_AS_VERTEX_ARRAY;
667 de::Random rnd (23921);
669 for (int caseNdx = 0; caseNdx < numRandomCases; caseNdx++)
671 vector<DataStoreSpec> specs(numUploadsPerCase);
673 for (vector<DataStoreSpec>::iterator spec = specs.begin(); spec != specs.end(); spec++)
675 spec->target = bufferTargets[rnd.getInt(0, DE_LENGTH_OF_ARRAY(bufferTargets)-1)];
676 spec->usage = usageHints[rnd.getInt(0, DE_LENGTH_OF_ARRAY(usageHints)-1)];
677 spec->size = rnd.getInt(minSize, maxSize);
680 recreateStoreGroup->addChild(new RecreateBufferDataStoreCase(m_context, (string("random_") + de::toString(caseNdx+1)).c_str(), "", &specs[0], (int)specs.size(), verify));
687 tcu::TestCaseGroup* const basicGroup = new tcu::TestCaseGroup(m_testCtx, "basic_subdata", "Basic glBufferSubData() usage");
688 addChild(basicGroup);
690 for (int targetNdx = 0; targetNdx < DE_LENGTH_OF_ARRAY(bufferTargets); targetNdx++)
692 for (int usageNdx = 0; usageNdx < DE_LENGTH_OF_ARRAY(usageHints); usageNdx++)
694 const deUint32 target = bufferTargets[targetNdx];
695 const deUint32 usage = usageHints[usageNdx];
696 const int size = 1020;
697 const VerifyType verify = VERIFY_AS_VERTEX_ARRAY;
698 const string name = string(getBufferTargetName(target)) + "_" + getUsageHintName(usage);
700 basicGroup->addChild(new BasicBufferDataCase(m_context, name.c_str(), "", target, usage, size, verify));
707 tcu::TestCaseGroup* const partialSpecifyGroup = new tcu::TestCaseGroup(m_testCtx, "partial_specify", "Partial buffer data specification with glBufferSubData()");
708 addChild(partialSpecifyGroup);
710 #define PARTIAL_SPECIFY_CASE(NAME, DESC, TARGET, USAGE, SIZE, RANGELIST) \
712 std::vector<tcu::IVec2> ranges; \
713 RangeVecBuilder builder(ranges); \
715 partialSpecifyGroup->addChild(new SubDataToUndefinedCase(m_context, #NAME, DESC, TARGET, USAGE, SIZE, &ranges[0], (int)ranges.size(), VERIFY_AS_VERTEX_ARRAY)); \
716 } while (deGetFalse())
718 PARTIAL_SPECIFY_CASE(whole_1, "Whole buffer specification with single glBufferSubData()", GL_ARRAY_BUFFER, GL_STATIC_DRAW, 996,
720 PARTIAL_SPECIFY_CASE(whole_2, "Whole buffer specification with two calls", GL_UNIFORM_BUFFER, GL_DYNAMIC_READ, 1728,
723 PARTIAL_SPECIFY_CASE(whole_3, "Whole buffer specification with three calls", GL_TRANSFORM_FEEDBACK_BUFFER, GL_STREAM_COPY, 1944,
726 << IVec2(421, 1000));
727 PARTIAL_SPECIFY_CASE(whole_4, "Whole buffer specification with three calls", GL_TRANSFORM_FEEDBACK_BUFFER, GL_STREAM_COPY, 1200,
732 PARTIAL_SPECIFY_CASE(low_1, "Low part of buffer specified with single call", GL_ELEMENT_ARRAY_BUFFER, GL_DYNAMIC_DRAW, 1000,
734 PARTIAL_SPECIFY_CASE(low_2, "Low part of buffer specified with two calls", GL_COPY_READ_BUFFER, GL_DYNAMIC_COPY, 996,
737 PARTIAL_SPECIFY_CASE(low_3, "Low part of buffer specified with two calls", GL_COPY_READ_BUFFER, GL_DYNAMIC_COPY, 1200,
741 PARTIAL_SPECIFY_CASE(high_1, "High part of buffer specified with single call", GL_COPY_WRITE_BUFFER, GL_STATIC_COPY, 1000,
743 PARTIAL_SPECIFY_CASE(high_2, "High part of buffer specified with two calls", GL_TRANSFORM_FEEDBACK_BUFFER, GL_STREAM_DRAW, 1200,
746 PARTIAL_SPECIFY_CASE(high_3, "High part of buffer specified with two calls", GL_PIXEL_PACK_BUFFER, GL_STREAM_READ, 1200,
750 PARTIAL_SPECIFY_CASE(middle_1, "Middle part of buffer specified with single call", GL_PIXEL_UNPACK_BUFFER, GL_STREAM_READ, 2500,
751 << IVec2(1000, 799));
752 PARTIAL_SPECIFY_CASE(middle_2, "Middle part of buffer specified with two calls", GL_ELEMENT_ARRAY_BUFFER, GL_STATIC_DRAW, 2500,
754 << IVec2(1000, 500));
755 PARTIAL_SPECIFY_CASE(middle_3, "Middle part of buffer specified with two calls", GL_ARRAY_BUFFER, GL_STREAM_READ, 2500,
757 << IVec2(1000, 501));
759 #undef PARTIAL_SPECIFY_CASE
764 tcu::TestCaseGroup* const randomGroup = new tcu::TestCaseGroup(m_testCtx, "random", "Randomized buffer data cases");
765 addChild(randomGroup);
767 for (int i = 0; i < 10; i++)
768 randomGroup->addChild(new RandomBufferWriteCase(m_context, de::toString(i).c_str(), "", deInt32Hash(i)));