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 } // 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 } // TextureBufferCaseUtil 62 63 class TextureBufferCase : public tcu::TestCase 64 { 65 public: 66 TextureBufferCase (tcu::TestContext& testCtx, 67 glu::RenderContext& renderCtx, 68 deUint32 format, 69 size_t bufferSize, 70 size_t offset, 71 size_t size, 72 TextureBufferCaseUtil::RenderBits preRender, 73 TextureBufferCaseUtil::ModifyBits modify, 74 TextureBufferCaseUtil::RenderBits postRender, 75 const char* name, 76 const char* description); 77 78 ~TextureBufferCase (void); 79 80 void init (void); 81 void deinit (void); 82 IterateResult iterate (void); 83 84 private: 85 glu::RenderContext& m_renderCtx; 86 const deUint32 m_format; 87 const size_t m_bufferSize; 88 const size_t m_offset; 89 const size_t m_size; 90 const TextureBufferCaseUtil::RenderBits m_preRender; 91 const TextureBufferCaseUtil::ModifyBits m_modify; 92 const TextureBufferCaseUtil::RenderBits m_postRender; 93 94 glu::ShaderProgram* m_preRenderProgram; 95 glu::ShaderProgram* m_postRenderProgram; 96 }; 97 98 } // gls 99 } // deqp 100 101 #endif // _GLSTEXTUREBUFFERCASE_HPP 102