Home | History | Annotate | Download | only in gles31
      1 #ifndef _ES31CTEXTURESTORAGEMULTISAMPLEFUNCTIONALTESTS_HPP
      2 #define _ES31CTEXTURESTORAGEMULTISAMPLEFUNCTIONALTESTS_HPP
      3 /*-------------------------------------------------------------------------
      4  * OpenGL Conformance Test Suite
      5  * -----------------------------
      6  *
      7  * Copyright (c) 2014-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  */ /*!
     28  * \file  es31cTextureStorageMultisampleFunctionalTests.hpp
     29  * \brief Declares test classes for multisample texture functional conformance
     30  *        tests. (ES3.1 only)
     31  */ /*-------------------------------------------------------------------*/
     32 
     33 #include "es31cTextureStorageMultisampleTests.hpp"
     34 
     35 namespace glcts
     36 {
     37 /** Test case: Verify that blitting from a multi-sampled framebuffer object
     38  *             to a single-sampled framebuffer object.
     39  */
     40 class MultisampleTextureFunctionalTestsBlittingTest : public glcts::TestCase
     41 {
     42 public:
     43 	/* Public methods */
     44 	MultisampleTextureFunctionalTestsBlittingTest(Context& context);
     45 
     46 	virtual void						 deinit();
     47 	virtual tcu::TestNode::IterateResult iterate();
     48 
     49 private:
     50 	/* Private variables */
     51 	glw::GLuint dst_fbo_id;
     52 	glw::GLuint dst_to_color_id;
     53 	glw::GLuint dst_to_depth_stencil_id;
     54 	glw::GLuint src_fbo_id;
     55 	glw::GLuint src_to_color_id;
     56 	glw::GLuint src_to_depth_stencil_id;
     57 };
     58 
     59 /** Test case: Verifies data rendered as a result of blitting depth multisample data
     60  *             to a single-sampled depth attachment is valid.
     61  */
     62 class MultisampleTextureFunctionalTestsBlittingMultisampledDepthAttachmentTest : public glcts::TestCase
     63 {
     64 public:
     65 	/* Public methods */
     66 	MultisampleTextureFunctionalTestsBlittingMultisampledDepthAttachmentTest(Context& context);
     67 
     68 	virtual void						 deinit();
     69 	virtual tcu::TestNode::IterateResult iterate();
     70 
     71 private:
     72 	/* Private variables */
     73 	glw::GLuint fbo_dst_id;
     74 	glw::GLuint fbo_src_id;
     75 	glw::GLuint fs_depth_preview_id;
     76 	glw::GLuint fs_id;
     77 	glw::GLuint po_depth_preview_id;
     78 	glw::GLuint po_id;
     79 	glw::GLuint to_dst_preview_id;
     80 	glw::GLuint to_dst_id;
     81 	glw::GLuint to_src_id;
     82 	glw::GLuint vao_id;
     83 	glw::GLuint vs_id;
     84 };
     85 
     86 /** Test case: Verifies data rendered as a result of blitting integer multisample data
     87  *             to a single-sampled color attachment is valid.
     88  */
     89 class MultisampleTextureFunctionalTestsBlittingMultisampledIntegerAttachmentTest : public glcts::TestCase
     90 {
     91 public:
     92 	/* Public methods */
     93 	MultisampleTextureFunctionalTestsBlittingMultisampledIntegerAttachmentTest(Context& context);
     94 
     95 	virtual void						 deinit();
     96 	virtual tcu::TestNode::IterateResult iterate();
     97 
     98 private:
     99 	/* Private variables */
    100 	glw::GLuint dst_to_id;
    101 	glw::GLuint fbo_draw_id;
    102 	glw::GLuint fbo_read_id;
    103 	glw::GLuint fs_id;
    104 	glw::GLuint po_id;
    105 	glw::GLuint src_to_id;
    106 	glw::GLuint vs_id;
    107 };
    108 
    109 /** Test case: Verify that blitting to a multisampled framebuffer object results
    110  *             in GL_INVALID_OPERATION error.
    111  */
    112 class MultisampleTextureFunctionalTestsBlittingToMultisampledFBOIsForbiddenTest : public glcts::TestCase
    113 {
    114 public:
    115 	/* Public methods */
    116 	MultisampleTextureFunctionalTestsBlittingToMultisampledFBOIsForbiddenTest(Context& context);
    117 
    118 	virtual void						 deinit();
    119 	virtual tcu::TestNode::IterateResult iterate();
    120 
    121 private:
    122 	/* Private variables */
    123 	glw::GLuint dst_to_id;
    124 	glw::GLuint fbo_draw_id;
    125 	glw::GLuint fbo_read_id;
    126 	glw::GLuint src_to_id;
    127 };
    128 
    129 /** Test case: Verify sample masking mechanism for non-integer color-renderable internalformats used for 2D multisample textures */
    130 class MultisampleTextureFunctionalTestsSampleMaskingForNonIntegerColorRenderableTexturesTest : public glcts::TestCase
    131 {
    132 public:
    133 	/* Public methods */
    134 	MultisampleTextureFunctionalTestsSampleMaskingForNonIntegerColorRenderableTexturesTest(Context& context);
    135 
    136 	virtual void						 deinit();
    137 	virtual tcu::TestNode::IterateResult iterate();
    138 
    139 private:
    140 	/* Private methods */
    141 	virtual void compileShader(glw::GLuint id, const glw::GLchar* source);
    142 	virtual void linkProgram(glw::GLuint id);
    143 
    144 	void initInternals();
    145 
    146 	/* Private variables */
    147 	glw::GLuint bo_id;
    148 	glw::GLuint fbo_id;
    149 	glw::GLuint fs_draw_id;
    150 	glw::GLuint po_draw_id;
    151 	glw::GLuint po_verify_id;
    152 	glw::GLuint tfo_id;
    153 	glw::GLuint to_2d_multisample_id;
    154 	glw::GLuint vs_draw_id;
    155 	glw::GLuint vs_verify_id;
    156 };
    157 
    158 /** Test case: Verify sample masking mechanism for normalized/unsigned integer/signed integer color-renderable
    159  *             and depth-renderable internalformats used for 2D multisample textures */
    160 class MultisampleTextureFunctionalTestsSampleMaskingTexturesTest : public glcts::TestCase
    161 {
    162 public:
    163 	/* Public methods */
    164 	MultisampleTextureFunctionalTestsSampleMaskingTexturesTest(Context& context);
    165 
    166 	virtual void						 deinit();
    167 	virtual tcu::TestNode::IterateResult iterate();
    168 
    169 private:
    170 	/* Private methods */
    171 	virtual void compileShader(glw::GLuint id, const glw::GLchar* source);
    172 	void		 initInternals();
    173 	virtual void linkProgram(glw::GLuint id);
    174 
    175 	/* Private variables */
    176 	glw::GLuint bo_id;
    177 	glw::GLuint fbo_id;
    178 	glw::GLuint fs_draw_id;
    179 	glw::GLuint po_draw_id;
    180 	glw::GLuint po_verify_id;
    181 	glw::GLuint tfo_id;
    182 	glw::GLuint to_2d_multisample_id;
    183 	glw::GLuint vs_draw_id;
    184 	glw::GLuint vs_verify_id;
    185 };
    186 
    187 /** Test case: Verify 2D/2D array multisample texture size can be queried successfully
    188  *             from within fragment shaders.
    189  */
    190 class MultisampleTextureFunctionalTestsTextureSizeFragmentShadersTest : public glcts::TestCase
    191 {
    192 public:
    193 	/* Public methods */
    194 	MultisampleTextureFunctionalTestsTextureSizeFragmentShadersTest(Context& context);
    195 
    196 	virtual void						 deinit();
    197 	virtual tcu::TestNode::IterateResult iterate();
    198 
    199 private:
    200 	/* Private variables */
    201 	glw::GLuint fbo_id;
    202 	glw::GLuint fs_id;
    203 	glw::GLuint po_id;
    204 	glw::GLuint to_2d_multisample_id;
    205 	glw::GLuint to_2d_multisample_array_id;
    206 	glw::GLuint vs_id;
    207 };
    208 
    209 /** Test case: Verify 2D/2D array multisample texture size can be queried successfully
    210  *             from within vertex shaders.
    211  */
    212 class MultisampleTextureFunctionalTestsTextureSizeVertexShadersTest : public glcts::TestCase
    213 {
    214 public:
    215 	/* Public methods */
    216 	MultisampleTextureFunctionalTestsTextureSizeVertexShadersTest(Context& context);
    217 
    218 	virtual void						 deinit();
    219 	virtual tcu::TestNode::IterateResult iterate();
    220 
    221 private:
    222 	/* Private variables */
    223 	glw::GLuint bo_id;
    224 	glw::GLuint fbo_id;
    225 	glw::GLuint fs_id;
    226 	glw::GLuint po_id;
    227 	glw::GLuint tfo_id;
    228 	glw::GLuint to_2d_multisample_id;
    229 	glw::GLuint to_2d_multisample_array_id;
    230 	glw::GLuint vs_2d_array_id;
    231 	glw::GLuint vs_2d_id;
    232 };
    233 } /* glcts namespace */
    234 
    235 #endif // _ES31CTEXTURESTORAGEMULTISAMPLEFUNCTIONALTESTS_HPP
    236