1e5c31af7Sopenharmony_ci#ifndef _GLSMEMORYSTRESSCASE_HPP
2e5c31af7Sopenharmony_ci#define _GLSMEMORYSTRESSCASE_HPP
3e5c31af7Sopenharmony_ci/*-------------------------------------------------------------------------
4e5c31af7Sopenharmony_ci * drawElements Quality Program OpenGL ES Module
5e5c31af7Sopenharmony_ci * ---------------------------------------------
6e5c31af7Sopenharmony_ci *
7e5c31af7Sopenharmony_ci * Copyright 2014 The Android Open Source Project
8e5c31af7Sopenharmony_ci *
9e5c31af7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
10e5c31af7Sopenharmony_ci * you may not use this file except in compliance with the License.
11e5c31af7Sopenharmony_ci * You may obtain a copy of the License at
12e5c31af7Sopenharmony_ci *
13e5c31af7Sopenharmony_ci *      http://www.apache.org/licenses/LICENSE-2.0
14e5c31af7Sopenharmony_ci *
15e5c31af7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
16e5c31af7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
17e5c31af7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18e5c31af7Sopenharmony_ci * See the License for the specific language governing permissions and
19e5c31af7Sopenharmony_ci * limitations under the License.
20e5c31af7Sopenharmony_ci *
21e5c31af7Sopenharmony_ci *//*!
22e5c31af7Sopenharmony_ci * \file
23e5c31af7Sopenharmony_ci * \brief Memory object stress test
24e5c31af7Sopenharmony_ci *//*--------------------------------------------------------------------*/
25e5c31af7Sopenharmony_ci
26e5c31af7Sopenharmony_ci#include "tcuDefs.hpp"
27e5c31af7Sopenharmony_ci#include "tcuTestCase.hpp"
28e5c31af7Sopenharmony_ci#include "gluRenderContext.hpp"
29e5c31af7Sopenharmony_ci
30e5c31af7Sopenharmony_ci#include <vector>
31e5c31af7Sopenharmony_ci
32e5c31af7Sopenharmony_cinamespace deqp
33e5c31af7Sopenharmony_ci{
34e5c31af7Sopenharmony_cinamespace gls
35e5c31af7Sopenharmony_ci{
36e5c31af7Sopenharmony_ci
37e5c31af7Sopenharmony_cienum MemObjectType
38e5c31af7Sopenharmony_ci{
39e5c31af7Sopenharmony_ci	MEMOBJECTTYPE_TEXTURE = (1 << 0),
40e5c31af7Sopenharmony_ci	MEMOBJECTTYPE_BUFFER = (1 << 1),
41e5c31af7Sopenharmony_ci
42e5c31af7Sopenharmony_ci	MEMOBJECTTYPE_LAST
43e5c31af7Sopenharmony_ci};
44e5c31af7Sopenharmony_ci
45e5c31af7Sopenharmony_cistruct MemObjectConfig
46e5c31af7Sopenharmony_ci{
47e5c31af7Sopenharmony_ci	int minBufferSize;
48e5c31af7Sopenharmony_ci	int maxBufferSize;
49e5c31af7Sopenharmony_ci
50e5c31af7Sopenharmony_ci	int minTextureSize;
51e5c31af7Sopenharmony_ci	int maxTextureSize;
52e5c31af7Sopenharmony_ci
53e5c31af7Sopenharmony_ci	bool useUnusedData;
54e5c31af7Sopenharmony_ci	bool write;
55e5c31af7Sopenharmony_ci	bool use;
56e5c31af7Sopenharmony_ci};
57e5c31af7Sopenharmony_ci
58e5c31af7Sopenharmony_ciclass MemoryStressCase : public tcu::TestCase
59e5c31af7Sopenharmony_ci{
60e5c31af7Sopenharmony_cipublic:
61e5c31af7Sopenharmony_ci							MemoryStressCase		(tcu::TestContext& testCtx, glu::RenderContext& renderContext, deUint32 objectTypes, int minTextureSize, int maxTextureSize, int minBufferSize, int maxBufferSize, bool write, bool use, bool useUnusedData, bool clearAfterOOM, const char* name, const char* desc);
62e5c31af7Sopenharmony_ci							~MemoryStressCase		(void);
63e5c31af7Sopenharmony_ci
64e5c31af7Sopenharmony_ci	void					init					(void);
65e5c31af7Sopenharmony_ci	void					deinit					(void);
66e5c31af7Sopenharmony_ci	IterateResult			iterate					(void);
67e5c31af7Sopenharmony_ci
68e5c31af7Sopenharmony_ciprivate:
69e5c31af7Sopenharmony_ci	int						m_iteration;
70e5c31af7Sopenharmony_ci	int						m_iterationCount;
71e5c31af7Sopenharmony_ci	std::vector<int>		m_allocated;
72e5c31af7Sopenharmony_ci	MemObjectType			m_objectTypes;
73e5c31af7Sopenharmony_ci	MemObjectConfig			m_config;
74e5c31af7Sopenharmony_ci	bool					m_zeroAlloc;
75e5c31af7Sopenharmony_ci	bool					m_clearAfterOOM;
76e5c31af7Sopenharmony_ci	glu::RenderContext&		m_renderCtx;
77e5c31af7Sopenharmony_ci
78e5c31af7Sopenharmony_ci							MemoryStressCase	(const MemoryStressCase&);
79e5c31af7Sopenharmony_ci	MemoryStressCase&		operator=			(const MemoryStressCase&);
80e5c31af7Sopenharmony_ci};
81e5c31af7Sopenharmony_ci
82e5c31af7Sopenharmony_ci
83e5c31af7Sopenharmony_ci} // gls
84e5c31af7Sopenharmony_ci} // deqp
85e5c31af7Sopenharmony_ci
86e5c31af7Sopenharmony_ci#endif // _GLSMEMORYSTRESSCASE_HPP
87