1 #ifndef _GL4CINCOMPLETETEXTUREACCESSTESTS_HPP 2 #define _GL4CINCOMPLETETEXTUREACCESSTESTS_HPP 3 /*------------------------------------------------------------------------- 4 * OpenGL Conformance Test Suite 5 * ----------------------------- 6 * 7 * Copyright (c) 2015-2016 The Khronos Group Inc. 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 24 */ /*-------------------------------------------------------------------*/ 25 26 /** 27 * \file gl4cIncompleteTextureAccessTests.hpp 28 * \brief Declares test classes for incomplete texture access cases. 29 */ /*-------------------------------------------------------------------*/ 30 31 /* Includes. */ 32 33 #include "glcTestCase.hpp" 34 #include "glwDefs.hpp" 35 #include "tcuDefs.hpp" 36 37 namespace gl4cts 38 { 39 namespace IncompleteTextureAccess 40 { 41 /** @class Tests 42 * 43 * @brief Incomplete texture access test group. 44 */ 45 class Tests : public deqp::TestCaseGroup 46 { 47 public: 48 /* Public member functions */ 49 Tests(deqp::Context& context); 50 51 void init(); 52 53 private: 54 /* Private member functions */ 55 Tests(const Tests& other); 56 Tests& operator=(const Tests& other); 57 }; 58 /* Tests class */ 59 60 /** @class IncompleteTextureAccessTest 61 * 62 * Description: 63 * 64 * This tests checks access to incomplete texture from shader using 65 * texture sampler functions. For OpenGL 4.5 and higher (0.0, 0.0, 0.0, 1.0) 66 * is expected for floating point non-shadow samplers. 0 is expected 67 * for the shadow sampler. 68 * 69 * Steps: 70 * 71 * Prepare incomplete texture of given type. 72 * Prepare framebuffer with RGBA renderbuffer 1x1 pixels in size 73 * Prepare program which draws full screen textured quad using given sampler. 74 * Make draw call. 75 * Fetch framebuffer data using glReadPixels. 76 * Compare the values with expected value. 77 * 78 * Repeat the steps for following samplers: 79 * - sampler1D, 80 * - sampler2D, 81 * - sampler3D, 82 * - samplerCube, 83 * - sampler2DRect, 84 * - sampler1DArray, 85 * - sampler2DArray, 86 * - samplerCubeArray 87 * expecting (0.0, 0.0, 0.0, 1.0) and: 88 * - sampler1DShadow, 89 * - sampler2DShadow, 90 * - samplerCubeShadow, 91 * - sampler2DRectShadow, 92 * - sampler1DArrayShadow, 93 * - sampler2DArrayShadow, 94 * - samplerCubeArrayShadow 95 * expecting 0.0. 96 */ 97 class SamplerTest : public deqp::TestCase 98 { 99 public: 100 /* Public member functions */ 101 SamplerTest(deqp::Context& context); 102 103 virtual tcu::TestNode::IterateResult iterate(); 104 105 private: 106 /* Private member functions */ 107 SamplerTest(const SamplerTest& other); 108 SamplerTest& operator=(const SamplerTest& other); 109 110 glw::GLuint m_po; 111 glw::GLuint m_to; 112 glw::GLuint m_fbo; 113 glw::GLuint m_rbo; 114 glw::GLuint m_vao; 115 116 static const struct Configuration 117 { 118 glw::GLenum texture_target; 119 const glw::GLchar* sampler_template; 120 const glw::GLchar* fetch_template; 121 glw::GLfloat expected_result[4]; 122 } s_configurations[]; 123 124 static const glw::GLuint s_configurations_count; 125 126 static const glw::GLchar* s_vertex_shader; 127 static const glw::GLchar* s_fragment_shader_head; 128 static const glw::GLchar* s_fragment_shader_body; 129 static const glw::GLchar* s_fragment_shader_tail; 130 131 void PrepareProgram(Configuration configuration); 132 void PrepareTexture(Configuration configuration); 133 void PrepareVertexArrays(); 134 void PrepareFramebuffer(); 135 void Draw(); 136 bool Check(Configuration configuration); 137 void CleanCase(); 138 void CleanTest(); 139 }; 140 141 /* SamplerTest class */ 142 } /* IncompleteTextureAccess namespace */ 143 } /* gl4cts */ 144 145 #endif // _GL4CINCOMPLETETEXTUREACCESSTESTS_HPP 146