1e5c31af7Sopenharmony_ci/*-------------------------------------------------------------------------
2e5c31af7Sopenharmony_ci * drawElements Quality Program OpenGL ES 3.0 Module
3e5c31af7Sopenharmony_ci * -------------------------------------------------
4e5c31af7Sopenharmony_ci *
5e5c31af7Sopenharmony_ci * Copyright 2014 The Android Open Source Project
6e5c31af7Sopenharmony_ci *
7e5c31af7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
8e5c31af7Sopenharmony_ci * you may not use this file except in compliance with the License.
9e5c31af7Sopenharmony_ci * You may obtain a copy of the License at
10e5c31af7Sopenharmony_ci *
11e5c31af7Sopenharmony_ci *      http://www.apache.org/licenses/LICENSE-2.0
12e5c31af7Sopenharmony_ci *
13e5c31af7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
14e5c31af7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
15e5c31af7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16e5c31af7Sopenharmony_ci * See the License for the specific language governing permissions and
17e5c31af7Sopenharmony_ci * limitations under the License.
18e5c31af7Sopenharmony_ci *
19e5c31af7Sopenharmony_ci *//*!
20e5c31af7Sopenharmony_ci * \file
21e5c31af7Sopenharmony_ci * \brief Buffer copying tests.
22e5c31af7Sopenharmony_ci *//*--------------------------------------------------------------------*/
23e5c31af7Sopenharmony_ci
24e5c31af7Sopenharmony_ci#include "es3fBufferCopyTests.hpp"
25e5c31af7Sopenharmony_ci#include "glsBufferTestUtil.hpp"
26e5c31af7Sopenharmony_ci#include "tcuTestLog.hpp"
27e5c31af7Sopenharmony_ci#include "deMemory.h"
28e5c31af7Sopenharmony_ci#include "deString.h"
29e5c31af7Sopenharmony_ci#include "glwEnums.hpp"
30e5c31af7Sopenharmony_ci#include "glwFunctions.hpp"
31e5c31af7Sopenharmony_ci
32e5c31af7Sopenharmony_ci#include <algorithm>
33e5c31af7Sopenharmony_ci
34e5c31af7Sopenharmony_ciusing std::vector;
35e5c31af7Sopenharmony_ciusing std::string;
36e5c31af7Sopenharmony_ciusing tcu::TestLog;
37e5c31af7Sopenharmony_ci
38e5c31af7Sopenharmony_cinamespace deqp
39e5c31af7Sopenharmony_ci{
40e5c31af7Sopenharmony_cinamespace gles3
41e5c31af7Sopenharmony_ci{
42e5c31af7Sopenharmony_cinamespace Functional
43e5c31af7Sopenharmony_ci{
44e5c31af7Sopenharmony_ci
45e5c31af7Sopenharmony_ciusing namespace gls::BufferTestUtil;
46e5c31af7Sopenharmony_ci
47e5c31af7Sopenharmony_ciclass BasicBufferCopyCase : public BufferCase
48e5c31af7Sopenharmony_ci{
49e5c31af7Sopenharmony_cipublic:
50e5c31af7Sopenharmony_ci	BasicBufferCopyCase (Context&		context,
51e5c31af7Sopenharmony_ci						 const char*	name,
52e5c31af7Sopenharmony_ci						 const char*	desc,
53e5c31af7Sopenharmony_ci						 deUint32		srcTarget,
54e5c31af7Sopenharmony_ci						 int			srcSize,
55e5c31af7Sopenharmony_ci						 deUint32		srcHint,
56e5c31af7Sopenharmony_ci						 deUint32		dstTarget,
57e5c31af7Sopenharmony_ci						 int			dstSize,
58e5c31af7Sopenharmony_ci						 deUint32		dstHint,
59e5c31af7Sopenharmony_ci						 int			copySrcOffset,
60e5c31af7Sopenharmony_ci						 int			copyDstOffset,
61e5c31af7Sopenharmony_ci						 int			copySize,
62e5c31af7Sopenharmony_ci						 VerifyType		verifyType)
63e5c31af7Sopenharmony_ci		: BufferCase		(context.getTestContext(), context.getRenderContext(), name, desc)
64e5c31af7Sopenharmony_ci		, m_srcTarget		(srcTarget)
65e5c31af7Sopenharmony_ci		, m_srcSize			(srcSize)
66e5c31af7Sopenharmony_ci		, m_srcHint			(srcHint)
67e5c31af7Sopenharmony_ci		, m_dstTarget		(dstTarget)
68e5c31af7Sopenharmony_ci		, m_dstSize			(dstSize)
69e5c31af7Sopenharmony_ci		, m_dstHint			(dstHint)
70e5c31af7Sopenharmony_ci		, m_copySrcOffset	(copySrcOffset)
71e5c31af7Sopenharmony_ci		, m_copyDstOffset	(copyDstOffset)
72e5c31af7Sopenharmony_ci		, m_copySize		(copySize)
73e5c31af7Sopenharmony_ci		, m_verifyType		(verifyType)
74e5c31af7Sopenharmony_ci	{
75e5c31af7Sopenharmony_ci		DE_ASSERT(de::inBounds(m_copySrcOffset, 0, m_srcSize) && de::inRange(m_copySrcOffset+m_copySize, m_copySrcOffset, m_srcSize));
76e5c31af7Sopenharmony_ci		DE_ASSERT(de::inBounds(m_copyDstOffset, 0, m_dstSize) && de::inRange(m_copyDstOffset+m_copySize, m_copyDstOffset, m_dstSize));
77e5c31af7Sopenharmony_ci	}
78e5c31af7Sopenharmony_ci
79e5c31af7Sopenharmony_ci	IterateResult iterate (void)
80e5c31af7Sopenharmony_ci	{
81e5c31af7Sopenharmony_ci		BufferVerifier	verifier	(m_renderCtx, m_testCtx.getLog(), m_verifyType);
82e5c31af7Sopenharmony_ci		ReferenceBuffer	srcRef;
83e5c31af7Sopenharmony_ci		ReferenceBuffer	dstRef;
84e5c31af7Sopenharmony_ci		deUint32		srcBuf		= 0;
85e5c31af7Sopenharmony_ci		deUint32		dstBuf		= 0;
86e5c31af7Sopenharmony_ci		deUint32		srcSeed		= deStringHash(getName()) ^ 0xabcd;
87e5c31af7Sopenharmony_ci		deUint32		dstSeed		= deStringHash(getName()) ^ 0xef01;
88e5c31af7Sopenharmony_ci		bool			isOk		= true;
89e5c31af7Sopenharmony_ci
90e5c31af7Sopenharmony_ci		srcRef.setSize(m_srcSize);
91e5c31af7Sopenharmony_ci		fillWithRandomBytes(srcRef.getPtr(), m_srcSize, srcSeed);
92e5c31af7Sopenharmony_ci
93e5c31af7Sopenharmony_ci		dstRef.setSize(m_dstSize);
94e5c31af7Sopenharmony_ci		fillWithRandomBytes(dstRef.getPtr(), m_dstSize, dstSeed);
95e5c31af7Sopenharmony_ci
96e5c31af7Sopenharmony_ci		// Create source buffer and fill with data.
97e5c31af7Sopenharmony_ci		srcBuf = genBuffer();
98e5c31af7Sopenharmony_ci		glBindBuffer(m_srcTarget, srcBuf);
99e5c31af7Sopenharmony_ci		glBufferData(m_srcTarget, m_srcSize, srcRef.getPtr(), m_srcHint);
100e5c31af7Sopenharmony_ci		GLU_CHECK_MSG("glBufferData");
101e5c31af7Sopenharmony_ci
102e5c31af7Sopenharmony_ci		// Create destination buffer and fill with data.
103e5c31af7Sopenharmony_ci		dstBuf = genBuffer();
104e5c31af7Sopenharmony_ci		glBindBuffer(m_dstTarget, dstBuf);
105e5c31af7Sopenharmony_ci		glBufferData(m_dstTarget, m_dstSize, dstRef.getPtr(), m_dstHint);
106e5c31af7Sopenharmony_ci		GLU_CHECK_MSG("glBufferData");
107e5c31af7Sopenharmony_ci
108e5c31af7Sopenharmony_ci		// Verify both buffers before executing copy.
109e5c31af7Sopenharmony_ci		isOk = verifier.verify(srcBuf, srcRef.getPtr(), 0, m_srcSize, m_srcTarget) && isOk;
110e5c31af7Sopenharmony_ci		isOk = verifier.verify(dstBuf, dstRef.getPtr(), 0, m_dstSize, m_dstTarget) && isOk;
111e5c31af7Sopenharmony_ci
112e5c31af7Sopenharmony_ci		// Execute copy.
113e5c31af7Sopenharmony_ci		deMemcpy(dstRef.getPtr()+m_copyDstOffset, srcRef.getPtr()+m_copySrcOffset, m_copySize);
114e5c31af7Sopenharmony_ci
115e5c31af7Sopenharmony_ci		glBindBuffer(m_srcTarget, srcBuf);
116e5c31af7Sopenharmony_ci		glBindBuffer(m_dstTarget, dstBuf);
117e5c31af7Sopenharmony_ci		glCopyBufferSubData(m_srcTarget, m_dstTarget, m_copySrcOffset, m_copyDstOffset, m_copySize);
118e5c31af7Sopenharmony_ci		GLU_CHECK_MSG("glCopyBufferSubData");
119e5c31af7Sopenharmony_ci
120e5c31af7Sopenharmony_ci		// Verify both buffers after copy.
121e5c31af7Sopenharmony_ci		isOk = verifier.verify(srcBuf, srcRef.getPtr(), 0, m_srcSize, m_srcTarget) && isOk;
122e5c31af7Sopenharmony_ci		isOk = verifier.verify(dstBuf, dstRef.getPtr(), 0, m_dstSize, m_dstTarget) && isOk;
123e5c31af7Sopenharmony_ci
124e5c31af7Sopenharmony_ci		m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS	: QP_TEST_RESULT_FAIL,
125e5c31af7Sopenharmony_ci								isOk ? "Pass"				: "Buffer verification failed");
126e5c31af7Sopenharmony_ci		return STOP;
127e5c31af7Sopenharmony_ci	}
128e5c31af7Sopenharmony_ci
129e5c31af7Sopenharmony_ciprivate:
130e5c31af7Sopenharmony_ci	deUint32	m_srcTarget;
131e5c31af7Sopenharmony_ci	int			m_srcSize;
132e5c31af7Sopenharmony_ci	deUint32	m_srcHint;
133e5c31af7Sopenharmony_ci
134e5c31af7Sopenharmony_ci	deUint32	m_dstTarget;
135e5c31af7Sopenharmony_ci	int			m_dstSize;
136e5c31af7Sopenharmony_ci	deUint32	m_dstHint;
137e5c31af7Sopenharmony_ci
138e5c31af7Sopenharmony_ci	int			m_copySrcOffset;
139e5c31af7Sopenharmony_ci	int			m_copyDstOffset;
140e5c31af7Sopenharmony_ci	int			m_copySize;
141e5c31af7Sopenharmony_ci
142e5c31af7Sopenharmony_ci	VerifyType	m_verifyType;
143e5c31af7Sopenharmony_ci};
144e5c31af7Sopenharmony_ci
145e5c31af7Sopenharmony_ci// Case B: same buffer, take range as parameter
146e5c31af7Sopenharmony_ci
147e5c31af7Sopenharmony_ciclass SingleBufferCopyCase : public BufferCase
148e5c31af7Sopenharmony_ci{
149e5c31af7Sopenharmony_cipublic:
150e5c31af7Sopenharmony_ci	SingleBufferCopyCase (Context&		context,
151e5c31af7Sopenharmony_ci						  const char*	name,
152e5c31af7Sopenharmony_ci						  const char*	desc,
153e5c31af7Sopenharmony_ci						  deUint32		srcTarget,
154e5c31af7Sopenharmony_ci						  deUint32		dstTarget,
155e5c31af7Sopenharmony_ci						  deUint32		hint,
156e5c31af7Sopenharmony_ci						  VerifyType	verifyType)
157e5c31af7Sopenharmony_ci		: BufferCase		(context.getTestContext(), context.getRenderContext(), name, desc)
158e5c31af7Sopenharmony_ci		, m_srcTarget		(srcTarget)
159e5c31af7Sopenharmony_ci		, m_dstTarget		(dstTarget)
160e5c31af7Sopenharmony_ci		, m_hint			(hint)
161e5c31af7Sopenharmony_ci		, m_verifyType		(verifyType)
162e5c31af7Sopenharmony_ci	{
163e5c31af7Sopenharmony_ci	}
164e5c31af7Sopenharmony_ci
165e5c31af7Sopenharmony_ci	IterateResult iterate (void)
166e5c31af7Sopenharmony_ci	{
167e5c31af7Sopenharmony_ci		const int		size		= 1000;
168e5c31af7Sopenharmony_ci		BufferVerifier	verifier	(m_renderCtx, m_testCtx.getLog(), m_verifyType);
169e5c31af7Sopenharmony_ci		ReferenceBuffer	ref;
170e5c31af7Sopenharmony_ci		deUint32		buf			= 0;
171e5c31af7Sopenharmony_ci		deUint32		baseSeed	= deStringHash(getName());
172e5c31af7Sopenharmony_ci		bool			isOk		= true;
173e5c31af7Sopenharmony_ci
174e5c31af7Sopenharmony_ci		ref.setSize(size);
175e5c31af7Sopenharmony_ci
176e5c31af7Sopenharmony_ci		// Create buffer.
177e5c31af7Sopenharmony_ci		buf = genBuffer();
178e5c31af7Sopenharmony_ci		glBindBuffer(m_srcTarget, buf);
179e5c31af7Sopenharmony_ci
180e5c31af7Sopenharmony_ci		static const struct
181e5c31af7Sopenharmony_ci		{
182e5c31af7Sopenharmony_ci			int				srcOffset;
183e5c31af7Sopenharmony_ci			int				dstOffset;
184e5c31af7Sopenharmony_ci			int				copySize;
185e5c31af7Sopenharmony_ci		} copyRanges[] =
186e5c31af7Sopenharmony_ci		{
187e5c31af7Sopenharmony_ci			{ 57,		701,	101 },	// Non-adjecent, from low to high.
188e5c31af7Sopenharmony_ci			{ 640,		101,	101 },	// Non-adjecent, from high to low.
189e5c31af7Sopenharmony_ci			{ 0,		500,	500 },	// Lower half to upper half.
190e5c31af7Sopenharmony_ci			{ 500,		0,		500 }	// Upper half to lower half.
191e5c31af7Sopenharmony_ci		};
192e5c31af7Sopenharmony_ci
193e5c31af7Sopenharmony_ci		for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(copyRanges) && isOk; ndx++)
194e5c31af7Sopenharmony_ci		{
195e5c31af7Sopenharmony_ci			int	srcOffset	= copyRanges[ndx].srcOffset;
196e5c31af7Sopenharmony_ci			int	dstOffset	= copyRanges[ndx].dstOffset;
197e5c31af7Sopenharmony_ci			int	copySize	= copyRanges[ndx].copySize;
198e5c31af7Sopenharmony_ci
199e5c31af7Sopenharmony_ci			fillWithRandomBytes(ref.getPtr(), size, baseSeed ^ deInt32Hash(ndx));
200e5c31af7Sopenharmony_ci
201e5c31af7Sopenharmony_ci			// Fill with data.
202e5c31af7Sopenharmony_ci			glBindBuffer(m_srcTarget, buf);
203e5c31af7Sopenharmony_ci			glBufferData(m_srcTarget, size, ref.getPtr(), m_hint);
204e5c31af7Sopenharmony_ci			GLU_CHECK_MSG("glBufferData");
205e5c31af7Sopenharmony_ci
206e5c31af7Sopenharmony_ci			// Execute copy.
207e5c31af7Sopenharmony_ci			deMemcpy(ref.getPtr()+dstOffset, ref.getPtr()+srcOffset, copySize);
208e5c31af7Sopenharmony_ci
209e5c31af7Sopenharmony_ci			glBindBuffer(m_dstTarget, buf);
210e5c31af7Sopenharmony_ci			glCopyBufferSubData(m_srcTarget, m_dstTarget, srcOffset, dstOffset, copySize);
211e5c31af7Sopenharmony_ci			GLU_CHECK_MSG("glCopyBufferSubData");
212e5c31af7Sopenharmony_ci
213e5c31af7Sopenharmony_ci			// Verify buffer after copy.
214e5c31af7Sopenharmony_ci			isOk = verifier.verify(buf, ref.getPtr(), 0, size, m_dstTarget) && isOk;
215e5c31af7Sopenharmony_ci		}
216e5c31af7Sopenharmony_ci
217e5c31af7Sopenharmony_ci		m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS	: QP_TEST_RESULT_FAIL,
218e5c31af7Sopenharmony_ci								isOk ? "Pass"				: "Buffer verification failed");
219e5c31af7Sopenharmony_ci		return STOP;
220e5c31af7Sopenharmony_ci	}
221e5c31af7Sopenharmony_ci
222e5c31af7Sopenharmony_ciprivate:
223e5c31af7Sopenharmony_ci	deUint32	m_srcTarget;
224e5c31af7Sopenharmony_ci	deUint32	m_dstTarget;
225e5c31af7Sopenharmony_ci	deUint32	m_hint;
226e5c31af7Sopenharmony_ci
227e5c31af7Sopenharmony_ci	VerifyType	m_verifyType;
228e5c31af7Sopenharmony_ci};
229e5c31af7Sopenharmony_ci
230e5c31af7Sopenharmony_ciBufferCopyTests::BufferCopyTests (Context& context)
231e5c31af7Sopenharmony_ci	: TestCaseGroup(context, "copy", "Buffer copy tests")
232e5c31af7Sopenharmony_ci{
233e5c31af7Sopenharmony_ci}
234e5c31af7Sopenharmony_ci
235e5c31af7Sopenharmony_ciBufferCopyTests::~BufferCopyTests (void)
236e5c31af7Sopenharmony_ci{
237e5c31af7Sopenharmony_ci}
238e5c31af7Sopenharmony_ci
239e5c31af7Sopenharmony_civoid BufferCopyTests::init (void)
240e5c31af7Sopenharmony_ci{
241e5c31af7Sopenharmony_ci	static const deUint32 bufferTargets[] =
242e5c31af7Sopenharmony_ci	{
243e5c31af7Sopenharmony_ci		GL_ARRAY_BUFFER,
244e5c31af7Sopenharmony_ci		GL_COPY_READ_BUFFER,
245e5c31af7Sopenharmony_ci		GL_COPY_WRITE_BUFFER,
246e5c31af7Sopenharmony_ci		GL_ELEMENT_ARRAY_BUFFER,
247e5c31af7Sopenharmony_ci		GL_PIXEL_PACK_BUFFER,
248e5c31af7Sopenharmony_ci		GL_PIXEL_UNPACK_BUFFER,
249e5c31af7Sopenharmony_ci		GL_TRANSFORM_FEEDBACK_BUFFER,
250e5c31af7Sopenharmony_ci		GL_UNIFORM_BUFFER
251e5c31af7Sopenharmony_ci	};
252e5c31af7Sopenharmony_ci
253e5c31af7Sopenharmony_ci	// .basic
254e5c31af7Sopenharmony_ci	{
255e5c31af7Sopenharmony_ci		tcu::TestCaseGroup* basicGroup = new tcu::TestCaseGroup(m_testCtx, "basic", "Basic buffer copy cases");
256e5c31af7Sopenharmony_ci		addChild(basicGroup);
257e5c31af7Sopenharmony_ci
258e5c31af7Sopenharmony_ci		for (int srcTargetNdx = 0; srcTargetNdx < DE_LENGTH_OF_ARRAY(bufferTargets); srcTargetNdx++)
259e5c31af7Sopenharmony_ci		{
260e5c31af7Sopenharmony_ci			for (int dstTargetNdx = 0; dstTargetNdx < DE_LENGTH_OF_ARRAY(bufferTargets); dstTargetNdx++)
261e5c31af7Sopenharmony_ci			{
262e5c31af7Sopenharmony_ci				if (srcTargetNdx == dstTargetNdx)
263e5c31af7Sopenharmony_ci					continue;
264e5c31af7Sopenharmony_ci
265e5c31af7Sopenharmony_ci				deUint32		srcTarget		= bufferTargets[srcTargetNdx];
266e5c31af7Sopenharmony_ci				deUint32		dstTarget		= bufferTargets[dstTargetNdx];
267e5c31af7Sopenharmony_ci				const int		size			= 1017;
268e5c31af7Sopenharmony_ci				const deUint32	hint			= GL_STATIC_DRAW;
269e5c31af7Sopenharmony_ci				VerifyType		verify			= VERIFY_AS_VERTEX_ARRAY;
270e5c31af7Sopenharmony_ci				string			name			= string(getBufferTargetName(srcTarget)) + "_" + getBufferTargetName(dstTarget);
271e5c31af7Sopenharmony_ci
272e5c31af7Sopenharmony_ci				basicGroup->addChild(new BasicBufferCopyCase(m_context, name.c_str(), "", srcTarget, size, hint, dstTarget, size, hint, 0, 0, size, verify));
273e5c31af7Sopenharmony_ci			}
274e5c31af7Sopenharmony_ci		}
275e5c31af7Sopenharmony_ci	}
276e5c31af7Sopenharmony_ci
277e5c31af7Sopenharmony_ci	// .subrange
278e5c31af7Sopenharmony_ci	{
279e5c31af7Sopenharmony_ci		tcu::TestCaseGroup* subrangeGroup = new tcu::TestCaseGroup(m_testCtx, "subrange", "Buffer subrange copy tests");
280e5c31af7Sopenharmony_ci		addChild(subrangeGroup);
281e5c31af7Sopenharmony_ci
282e5c31af7Sopenharmony_ci		static const struct
283e5c31af7Sopenharmony_ci		{
284e5c31af7Sopenharmony_ci			const char*		name;
285e5c31af7Sopenharmony_ci			int				srcSize;
286e5c31af7Sopenharmony_ci			int				dstSize;
287e5c31af7Sopenharmony_ci			int				srcOffset;
288e5c31af7Sopenharmony_ci			int				dstOffset;
289e5c31af7Sopenharmony_ci			int				copySize;
290e5c31af7Sopenharmony_ci		} cases[] =
291e5c31af7Sopenharmony_ci		{
292e5c31af7Sopenharmony_ci			//						srcSize		dstSize		srcOffs		dstOffs		copySize
293e5c31af7Sopenharmony_ci			{ "middle",				1000,		1000,		250,		250,		500 },
294e5c31af7Sopenharmony_ci			{ "small_to_large",		100,		1000,		0,			409,		100 },
295e5c31af7Sopenharmony_ci			{ "large_to_small",		1000,		100,		409,		0,			100 },
296e5c31af7Sopenharmony_ci			{ "low_to_high_1",		1000,		1000,		0,			500,		500 },
297e5c31af7Sopenharmony_ci			{ "low_to_high_2",		997,		1027,		0,			701,		111 },
298e5c31af7Sopenharmony_ci			{ "high_to_low_1",		1000,		1000,		500,		0,			500 },
299e5c31af7Sopenharmony_ci			{ "high_to_low_2",		1027,		997,		701,		17,			111 }
300e5c31af7Sopenharmony_ci		};
301e5c31af7Sopenharmony_ci
302e5c31af7Sopenharmony_ci		for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(cases); ndx++)
303e5c31af7Sopenharmony_ci		{
304e5c31af7Sopenharmony_ci			deUint32		srcTarget		= GL_COPY_READ_BUFFER;
305e5c31af7Sopenharmony_ci			deUint32		dstTarget		= GL_COPY_WRITE_BUFFER;
306e5c31af7Sopenharmony_ci			deUint32		hint			= GL_STATIC_DRAW;
307e5c31af7Sopenharmony_ci			VerifyType		verify			= VERIFY_AS_VERTEX_ARRAY;
308e5c31af7Sopenharmony_ci
309e5c31af7Sopenharmony_ci			subrangeGroup->addChild(new BasicBufferCopyCase(m_context, cases[ndx].name, "",
310e5c31af7Sopenharmony_ci															srcTarget, cases[ndx].srcSize, hint,
311e5c31af7Sopenharmony_ci															dstTarget, cases[ndx].dstSize, hint,
312e5c31af7Sopenharmony_ci															cases[ndx].srcOffset, cases[ndx].dstOffset, cases[ndx].copySize,
313e5c31af7Sopenharmony_ci															verify));
314e5c31af7Sopenharmony_ci		}
315e5c31af7Sopenharmony_ci	}
316e5c31af7Sopenharmony_ci
317e5c31af7Sopenharmony_ci	// .single_buffer
318e5c31af7Sopenharmony_ci	{
319e5c31af7Sopenharmony_ci		tcu::TestCaseGroup* singleBufGroup = new tcu::TestCaseGroup(m_testCtx, "single_buffer", "Copies within single buffer");
320e5c31af7Sopenharmony_ci		addChild(singleBufGroup);
321e5c31af7Sopenharmony_ci
322e5c31af7Sopenharmony_ci		for (int srcTargetNdx = 0; srcTargetNdx < DE_LENGTH_OF_ARRAY(bufferTargets); srcTargetNdx++)
323e5c31af7Sopenharmony_ci		{
324e5c31af7Sopenharmony_ci			for (int dstTargetNdx = 0; dstTargetNdx < DE_LENGTH_OF_ARRAY(bufferTargets); dstTargetNdx++)
325e5c31af7Sopenharmony_ci			{
326e5c31af7Sopenharmony_ci				if (srcTargetNdx == dstTargetNdx)
327e5c31af7Sopenharmony_ci					continue;
328e5c31af7Sopenharmony_ci
329e5c31af7Sopenharmony_ci				deUint32		srcTarget		= bufferTargets[srcTargetNdx];
330e5c31af7Sopenharmony_ci				deUint32		dstTarget		= bufferTargets[dstTargetNdx];
331e5c31af7Sopenharmony_ci				const deUint32	hint			= GL_STATIC_DRAW;
332e5c31af7Sopenharmony_ci				VerifyType		verify			= VERIFY_AS_VERTEX_ARRAY;
333e5c31af7Sopenharmony_ci				string			name			= string(getBufferTargetName(srcTarget)) + "_" + getBufferTargetName(dstTarget);
334e5c31af7Sopenharmony_ci
335e5c31af7Sopenharmony_ci				singleBufGroup->addChild(new SingleBufferCopyCase(m_context, name.c_str(), "", srcTarget, dstTarget, hint, verify));
336e5c31af7Sopenharmony_ci			}
337e5c31af7Sopenharmony_ci		}
338e5c31af7Sopenharmony_ci	}
339e5c31af7Sopenharmony_ci}
340e5c31af7Sopenharmony_ci
341e5c31af7Sopenharmony_ci} // Functional
342e5c31af7Sopenharmony_ci} // gles3
343e5c31af7Sopenharmony_ci} // deqp
344