1 #ifndef _GLSTEXTUREBUFFERCASE_HPP 2 #define _GLSTEXTUREBUFFERCASE_HPP 3 /*------------------------------------------------------------------------- 4 * drawElements Quality Program OpenGL (ES) Module 5 * ----------------------------------------------- 6 * 7 * Copyright 2014 The Android Open Source Project 8 * 9 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * you may not use this file except in compliance with the License. 11 * You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 * 21 *//*! 22 * \file 23 * \brief Texture buffer test case 24 *//*--------------------------------------------------------------------*/ 25 26 #include "tcuDefs.hpp" 27 #include "tcuTestCase.hpp" 28 29 namespace glu 30 { 31 class RenderContext; 32 class ShaderProgram; 33 } // namespace glu 34 35 namespace deqp 36 { 37 namespace gls 38 { 39 40 namespace TextureBufferCaseUtil 41 { 42 43 enum ModifyBits 44 { 45 MODIFYBITS_NONE = 0, 46 MODIFYBITS_BUFFERDATA = (0x1 << 0), 47 MODIFYBITS_BUFFERSUBDATA = (0x1 << 1), 48 MODIFYBITS_MAPBUFFER_WRITE = (0x1 << 2), 49 MODIFYBITS_MAPBUFFER_READWRITE = (0x1 << 3), 50 }; 51 52 enum RenderBits 53 { 54 RENDERBITS_NONE = 0, 55 RENDERBITS_AS_VERTEX_ARRAY = (0x1 << 0), 56 RENDERBITS_AS_INDEX_ARRAY = (0x1 << 1), 57 RENDERBITS_AS_VERTEX_TEXTURE = (0x1 << 2), 58 RENDERBITS_AS_FRAGMENT_TEXTURE = (0x1 << 3) 59 }; 60 61 } // namespace TextureBufferCaseUtil 62 63 class TextureBufferCase : public tcu::TestCase 64 { 65 public: 66 TextureBufferCase(tcu::TestContext &testCtx, glu::RenderContext &renderCtx, uint32_t format, size_t bufferSize, 67 size_t offset, size_t size, TextureBufferCaseUtil::RenderBits preRender, 68 TextureBufferCaseUtil::ModifyBits modify, TextureBufferCaseUtil::RenderBits postRender, 69 const char *name, const char *description); 70 71 ~TextureBufferCase(void); 72 73 void init(void); 74 void deinit(void); 75 IterateResult iterate(void); 76 77 private: 78 glu::RenderContext &m_renderCtx; 79 const uint32_t m_format; 80 const size_t m_bufferSize; 81 const size_t m_offset; 82 const size_t m_size; 83 const TextureBufferCaseUtil::RenderBits m_preRender; 84 const TextureBufferCaseUtil::ModifyBits m_modify; 85 const TextureBufferCaseUtil::RenderBits m_postRender; 86 87 glu::ShaderProgram *m_preRenderProgram; 88 glu::ShaderProgram *m_postRenderProgram; 89 }; 90 91 } // namespace gls 92 } // namespace deqp 93 94 #endif // _GLSTEXTUREBUFFERCASE_HPP 95