1e5c31af7Sopenharmony_ci#ifndef _GL4CMULTIBINDTESTS_HPP 2e5c31af7Sopenharmony_ci#define _GL4CMULTIBINDTESTS_HPP 3e5c31af7Sopenharmony_ci/*------------------------------------------------------------------------- 4e5c31af7Sopenharmony_ci * OpenGL Conformance Test Suite 5e5c31af7Sopenharmony_ci * ----------------------------- 6e5c31af7Sopenharmony_ci * 7e5c31af7Sopenharmony_ci * Copyright (c) 2015-2016 The Khronos Group Inc. 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 24e5c31af7Sopenharmony_ci */ /*-------------------------------------------------------------------*/ 25e5c31af7Sopenharmony_ci 26e5c31af7Sopenharmony_ci/** 27e5c31af7Sopenharmony_ci * \file gl4cMultiBindTests.hpp 28e5c31af7Sopenharmony_ci * \brief Declares test classes for "Multi Bind" functionality. 29e5c31af7Sopenharmony_ci */ /*-------------------------------------------------------------------*/ 30e5c31af7Sopenharmony_ci 31e5c31af7Sopenharmony_ci#include "glcTestCase.hpp" 32e5c31af7Sopenharmony_ci#include "glwDefs.hpp" 33e5c31af7Sopenharmony_ci 34e5c31af7Sopenharmony_cinamespace gl4cts 35e5c31af7Sopenharmony_ci{ 36e5c31af7Sopenharmony_cinamespace MultiBind 37e5c31af7Sopenharmony_ci{ 38e5c31af7Sopenharmony_ci/** Implementation of test ErrorsBindBuffers. Description follows: 39e5c31af7Sopenharmony_ci * 40e5c31af7Sopenharmony_ci * Verifies that BindBuffersBase and BindBuffersRange commands generate errors 41e5c31af7Sopenharmony_ci * as expected: 42e5c31af7Sopenharmony_ci * - INVALID_ENUM when <target> is not valid; 43e5c31af7Sopenharmony_ci * - INVALID_OPERATION when <first> + <count> is greater than allowed limit; 44e5c31af7Sopenharmony_ci * - INVALID_OPERATION if any value in <buffers> is not zero or the name of 45e5c31af7Sopenharmony_ci * existing buffer; 46e5c31af7Sopenharmony_ci * - INVALID_VALUE if any value in <offsets> is less than zero; 47e5c31af7Sopenharmony_ci * - INVALID_VALUE if any pair of <offsets> and <sizes> exceeds limits. 48e5c31af7Sopenharmony_ci **/ 49e5c31af7Sopenharmony_ciclass ErrorsBindBuffersTest : public deqp::TestCase 50e5c31af7Sopenharmony_ci{ 51e5c31af7Sopenharmony_cipublic: 52e5c31af7Sopenharmony_ci /* Public methods */ 53e5c31af7Sopenharmony_ci ErrorsBindBuffersTest(deqp::Context& context); 54e5c31af7Sopenharmony_ci 55e5c31af7Sopenharmony_ci virtual ~ErrorsBindBuffersTest() 56e5c31af7Sopenharmony_ci { 57e5c31af7Sopenharmony_ci } 58e5c31af7Sopenharmony_ci 59e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 60e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 61e5c31af7Sopenharmony_ci}; 62e5c31af7Sopenharmony_ci 63e5c31af7Sopenharmony_ci/** Implementation of test ErrorsBindTextures. Description follows: 64e5c31af7Sopenharmony_ci * 65e5c31af7Sopenharmony_ci * Verifies that BindTextures generate errors as expected: 66e5c31af7Sopenharmony_ci * - INVALID_OPERATION when <first> + <count> exceed limits; 67e5c31af7Sopenharmony_ci * - INVALID_OPERATION if any value in <textures> is not zero or name of 68e5c31af7Sopenharmony_ci * existing texture. 69e5c31af7Sopenharmony_ci **/ 70e5c31af7Sopenharmony_ciclass ErrorsBindTexturesTest : public deqp::TestCase 71e5c31af7Sopenharmony_ci{ 72e5c31af7Sopenharmony_cipublic: 73e5c31af7Sopenharmony_ci /* Public methods */ 74e5c31af7Sopenharmony_ci ErrorsBindTexturesTest(deqp::Context& context); 75e5c31af7Sopenharmony_ci 76e5c31af7Sopenharmony_ci virtual ~ErrorsBindTexturesTest() 77e5c31af7Sopenharmony_ci { 78e5c31af7Sopenharmony_ci } 79e5c31af7Sopenharmony_ci 80e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 81e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 82e5c31af7Sopenharmony_ci}; 83e5c31af7Sopenharmony_ci 84e5c31af7Sopenharmony_ci/** Implementation of test ErrorsBindSamplers. Description follows: 85e5c31af7Sopenharmony_ci * 86e5c31af7Sopenharmony_ci * Verifies that BindSamplers generate errors as expected: 87e5c31af7Sopenharmony_ci * - INVALID_OPERATION when <first> + <count> exceed limits; 88e5c31af7Sopenharmony_ci * - INVALID_OPERATION if any value in <samplers> is not zero or name of 89e5c31af7Sopenharmony_ci * existing texture. 90e5c31af7Sopenharmony_ci **/ 91e5c31af7Sopenharmony_ciclass ErrorsBindSamplersTest : public deqp::TestCase 92e5c31af7Sopenharmony_ci{ 93e5c31af7Sopenharmony_cipublic: 94e5c31af7Sopenharmony_ci /* Public methods */ 95e5c31af7Sopenharmony_ci ErrorsBindSamplersTest(deqp::Context& context); 96e5c31af7Sopenharmony_ci 97e5c31af7Sopenharmony_ci virtual ~ErrorsBindSamplersTest() 98e5c31af7Sopenharmony_ci { 99e5c31af7Sopenharmony_ci } 100e5c31af7Sopenharmony_ci 101e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 102e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 103e5c31af7Sopenharmony_ci}; 104e5c31af7Sopenharmony_ci 105e5c31af7Sopenharmony_ci/** Implementation of test ErrorsBindImageTextures. Description follows: 106e5c31af7Sopenharmony_ci * 107e5c31af7Sopenharmony_ci * Verifies that BindImageTextures generate errors as expected: 108e5c31af7Sopenharmony_ci * - INVALID_OPERATION when <first> + <count> exceed limits; 109e5c31af7Sopenharmony_ci * - INVALID_OPERATION if any value in <textures> is not zero or name of 110e5c31af7Sopenharmony_ci * existing texture; 111e5c31af7Sopenharmony_ci * - INVALID_OPERATION if any entry found in <textures> has invalid internal 112e5c31af7Sopenharmony_ci * format at level 0; 113e5c31af7Sopenharmony_ci * - INVALID_OPERATION when any entry in <textures> has any of dimensions equal 114e5c31af7Sopenharmony_ci * to 0 at level 0. 115e5c31af7Sopenharmony_ci **/ 116e5c31af7Sopenharmony_ciclass ErrorsBindImageTexturesTest : public deqp::TestCase 117e5c31af7Sopenharmony_ci{ 118e5c31af7Sopenharmony_cipublic: 119e5c31af7Sopenharmony_ci /* Public methods */ 120e5c31af7Sopenharmony_ci ErrorsBindImageTexturesTest(deqp::Context& context); 121e5c31af7Sopenharmony_ci 122e5c31af7Sopenharmony_ci virtual ~ErrorsBindImageTexturesTest() 123e5c31af7Sopenharmony_ci { 124e5c31af7Sopenharmony_ci } 125e5c31af7Sopenharmony_ci 126e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 127e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 128e5c31af7Sopenharmony_ci}; 129e5c31af7Sopenharmony_ci 130e5c31af7Sopenharmony_ci/** Implementation of test ErrorsBindVertexBuffers. Description follows: 131e5c31af7Sopenharmony_ci * 132e5c31af7Sopenharmony_ci * Verifies that BindVertexBuffers generate errors as expected: 133e5c31af7Sopenharmony_ci * - INVALID_OPERATION when <first> + <count> exceeds limits; 134e5c31af7Sopenharmony_ci * - INVALID_OPERATION if any value in <buffers> is not zero or the name of 135e5c31af7Sopenharmony_ci * existing buffer; 136e5c31af7Sopenharmony_ci * - INVALID_VALUE if any value in <offsets> or <strides> is less than zero. 137e5c31af7Sopenharmony_ci **/ 138e5c31af7Sopenharmony_ciclass ErrorsBindVertexBuffersTest : public deqp::TestCase 139e5c31af7Sopenharmony_ci{ 140e5c31af7Sopenharmony_cipublic: 141e5c31af7Sopenharmony_ci /* Public methods */ 142e5c31af7Sopenharmony_ci ErrorsBindVertexBuffersTest(deqp::Context& context); 143e5c31af7Sopenharmony_ci 144e5c31af7Sopenharmony_ci virtual ~ErrorsBindVertexBuffersTest() 145e5c31af7Sopenharmony_ci { 146e5c31af7Sopenharmony_ci } 147e5c31af7Sopenharmony_ci 148e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 149e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 150e5c31af7Sopenharmony_ci}; 151e5c31af7Sopenharmony_ci 152e5c31af7Sopenharmony_ci/** Implementation of test FunctionalBindBuffersBase. Description follows: 153e5c31af7Sopenharmony_ci * 154e5c31af7Sopenharmony_ci * Verifies that BindBuffersBase works as expected. 155e5c31af7Sopenharmony_ci * 156e5c31af7Sopenharmony_ci * Steps to be done for each valid target: 157e5c31af7Sopenharmony_ci * - prepare MAX buffers with some store, where MAX is the maximum supported 158e5c31af7Sopenharmony_ci * amount of bindings points for tested target; 159e5c31af7Sopenharmony_ci * 160e5c31af7Sopenharmony_ci * - execute BindBufferBase to bind all buffers to tested target; 161e5c31af7Sopenharmony_ci * - inspect if bindings were modified; 162e5c31af7Sopenharmony_ci * 163e5c31af7Sopenharmony_ci * - execute BindBufferBase for first half of bindings with NULL as <buffers> 164e5c31af7Sopenharmony_ci * to unbind first half of bindings for tested target; 165e5c31af7Sopenharmony_ci * - inspect if bindings were modified; 166e5c31af7Sopenharmony_ci * - execute BindBufferBase for second half of bindings with NULL as <buffers> 167e5c31af7Sopenharmony_ci * to unbind rest of bindings; 168e5c31af7Sopenharmony_ci * - inspect if bindings were modified; 169e5c31af7Sopenharmony_ci * 170e5c31af7Sopenharmony_ci * - change <buffers> so first entry is invalid; 171e5c31af7Sopenharmony_ci * - execute BindBufferBase to bind all buffers to tested target; It is 172e5c31af7Sopenharmony_ci * expected that INVALID_OPERATION will be generated; 173e5c31af7Sopenharmony_ci * - inspect if all bindings but first were modified; 174e5c31af7Sopenharmony_ci * 175e5c31af7Sopenharmony_ci * - bind any buffer to first binding; 176e5c31af7Sopenharmony_ci * - execute BindBufferBase for 0 as <first>, 1 as <count> and <buffers> filled 177e5c31af7Sopenharmony_ci * with zeros to unbind 1st binding for tested target; 178e5c31af7Sopenharmony_ci * - inspect if bindings were modified; 179e5c31af7Sopenharmony_ci * 180e5c31af7Sopenharmony_ci * - unbind all buffers. 181e5c31af7Sopenharmony_ci **/ 182e5c31af7Sopenharmony_ciclass FunctionalBindBuffersBaseTest : public deqp::TestCase 183e5c31af7Sopenharmony_ci{ 184e5c31af7Sopenharmony_cipublic: 185e5c31af7Sopenharmony_ci /* Public methods */ 186e5c31af7Sopenharmony_ci FunctionalBindBuffersBaseTest(deqp::Context& context); 187e5c31af7Sopenharmony_ci 188e5c31af7Sopenharmony_ci virtual ~FunctionalBindBuffersBaseTest() 189e5c31af7Sopenharmony_ci { 190e5c31af7Sopenharmony_ci } 191e5c31af7Sopenharmony_ci 192e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 193e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 194e5c31af7Sopenharmony_ci}; 195e5c31af7Sopenharmony_ci 196e5c31af7Sopenharmony_ci/** Implementation of test FunctionalBindBuffersRange. Description follows: 197e5c31af7Sopenharmony_ci * 198e5c31af7Sopenharmony_ci * Verifies that BindBuffersRange works as expected. 199e5c31af7Sopenharmony_ci * 200e5c31af7Sopenharmony_ci * Steps to be done for each valid target: 201e5c31af7Sopenharmony_ci * - prepare MAX buffers with some store, where MAX is the maximum supported 202e5c31af7Sopenharmony_ci * amount of bindings points for tested target; 203e5c31af7Sopenharmony_ci * 204e5c31af7Sopenharmony_ci * - execute BindBufferRange to bind all buffers to tested target; 205e5c31af7Sopenharmony_ci * - inspect if bindings were modified; 206e5c31af7Sopenharmony_ci * 207e5c31af7Sopenharmony_ci * - execute BindBufferRange for first half of bindings with NULL as <buffers> 208e5c31af7Sopenharmony_ci * to unbind first half of bindings for tested target; 209e5c31af7Sopenharmony_ci * - inspect if bindings were modified; 210e5c31af7Sopenharmony_ci * - execute BindBufferRange for second half of bindings with NULL as <buffers> 211e5c31af7Sopenharmony_ci * to unbind rest of bindings for tested target; 212e5c31af7Sopenharmony_ci * - inspect if bindings were modified; 213e5c31af7Sopenharmony_ci * 214e5c31af7Sopenharmony_ci * - change <buffers> so first entry is invalid; 215e5c31af7Sopenharmony_ci * - execute BindBufferRange to bind all buffers to tested target; It is 216e5c31af7Sopenharmony_ci * expected that INVALID_OPERATION will be generated; 217e5c31af7Sopenharmony_ci * - inspect if all bindings but first were modified; 218e5c31af7Sopenharmony_ci * 219e5c31af7Sopenharmony_ci * - bind any buffer to first binding; 220e5c31af7Sopenharmony_ci * - execute BindBufferRange for 0 as <first>, 1 as <count> and <buffers> 221e5c31af7Sopenharmony_ci * filled with zeros to unbind first binding for tested target; 222e5c31af7Sopenharmony_ci * - inspect if bindings were modified; 223e5c31af7Sopenharmony_ci * 224e5c31af7Sopenharmony_ci * - unbind all buffers. 225e5c31af7Sopenharmony_ci **/ 226e5c31af7Sopenharmony_ciclass FunctionalBindBuffersRangeTest : public deqp::TestCase 227e5c31af7Sopenharmony_ci{ 228e5c31af7Sopenharmony_cipublic: 229e5c31af7Sopenharmony_ci /* Public methods */ 230e5c31af7Sopenharmony_ci FunctionalBindBuffersRangeTest(deqp::Context& context); 231e5c31af7Sopenharmony_ci 232e5c31af7Sopenharmony_ci virtual ~FunctionalBindBuffersRangeTest() 233e5c31af7Sopenharmony_ci { 234e5c31af7Sopenharmony_ci } 235e5c31af7Sopenharmony_ci 236e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 237e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 238e5c31af7Sopenharmony_ci}; 239e5c31af7Sopenharmony_ci 240e5c31af7Sopenharmony_ci/** Implementation of test FunctionalBindTextures. Description follows: 241e5c31af7Sopenharmony_ci * 242e5c31af7Sopenharmony_ci * Verify that BindTextures works as expected. 243e5c31af7Sopenharmony_ci * 244e5c31af7Sopenharmony_ci * Steps: 245e5c31af7Sopenharmony_ci * - prepare MAX_COMBINED_TEXTURE_IMAGE_UNITS textures with some store; 246e5c31af7Sopenharmony_ci * Use all valid texture targets; 247e5c31af7Sopenharmony_ci * 248e5c31af7Sopenharmony_ci * - execute BindTextures to bind all textures; 249e5c31af7Sopenharmony_ci * - inspect bindings of all texture units to verify that proper bindings were 250e5c31af7Sopenharmony_ci * set; 251e5c31af7Sopenharmony_ci * 252e5c31af7Sopenharmony_ci * - execute BindTextures for the first half of units with <textures> filled 253e5c31af7Sopenharmony_ci * with zeros, to unbind those units; 254e5c31af7Sopenharmony_ci * - inspect bindings of all texture units to verify that proper bindings were 255e5c31af7Sopenharmony_ci * unbound; 256e5c31af7Sopenharmony_ci * 257e5c31af7Sopenharmony_ci * - execute BindTextures for the second half of units with NULL as<textures>, 258e5c31af7Sopenharmony_ci * to unbind those units; 259e5c31af7Sopenharmony_ci * - inspect bindings of all texture units to verify that proper bindings were 260e5c31af7Sopenharmony_ci * unbound; 261e5c31af7Sopenharmony_ci * 262e5c31af7Sopenharmony_ci * - modify <textures> so first entry is invalid; 263e5c31af7Sopenharmony_ci * - execute BindTextures to bind all textures; It is expected that 264e5c31af7Sopenharmony_ci * INVALID_OPERATION will be generated; 265e5c31af7Sopenharmony_ci * - inspect bindings of all texture units to verify that proper bindings were 266e5c31af7Sopenharmony_ci * set; 267e5c31af7Sopenharmony_ci * 268e5c31af7Sopenharmony_ci * - unbind all textures. 269e5c31af7Sopenharmony_ci **/ 270e5c31af7Sopenharmony_ciclass FunctionalBindTexturesTest : public deqp::TestCase 271e5c31af7Sopenharmony_ci{ 272e5c31af7Sopenharmony_cipublic: 273e5c31af7Sopenharmony_ci /* Public methods */ 274e5c31af7Sopenharmony_ci FunctionalBindTexturesTest(deqp::Context& context); 275e5c31af7Sopenharmony_ci 276e5c31af7Sopenharmony_ci virtual ~FunctionalBindTexturesTest() 277e5c31af7Sopenharmony_ci { 278e5c31af7Sopenharmony_ci } 279e5c31af7Sopenharmony_ci 280e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 281e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 282e5c31af7Sopenharmony_ci}; 283e5c31af7Sopenharmony_ci 284e5c31af7Sopenharmony_ci/** Implementation of test FunctionalBindSamplers. Description follows: 285e5c31af7Sopenharmony_ci * 286e5c31af7Sopenharmony_ci * Verify that BindSamplers works as expected. 287e5c31af7Sopenharmony_ci * 288e5c31af7Sopenharmony_ci * Steps: 289e5c31af7Sopenharmony_ci * - prepare MAX_COMBINED_TEXTURE_IMAGE_UNITS samplers; 290e5c31af7Sopenharmony_ci * 291e5c31af7Sopenharmony_ci * - execute BindSamplers to bind all samplers; 292e5c31af7Sopenharmony_ci * - inspect bindings to verify that proper samplers were set; 293e5c31af7Sopenharmony_ci * 294e5c31af7Sopenharmony_ci * - execute BindSamplers for first half of bindings with <samplers> filled 295e5c31af7Sopenharmony_ci * with zeros, to unbind those samplers; 296e5c31af7Sopenharmony_ci * - inspect bindings to verify that proper samplers were unbound; 297e5c31af7Sopenharmony_ci * 298e5c31af7Sopenharmony_ci * - execute BindSamplers for second half of bindings with NULL as <samplers>, 299e5c31af7Sopenharmony_ci * to unbind those samplers; 300e5c31af7Sopenharmony_ci * - inspect bindings to verify that proper samplers were unbound; 301e5c31af7Sopenharmony_ci * 302e5c31af7Sopenharmony_ci * - modify <samplers> so first entry is invalid; 303e5c31af7Sopenharmony_ci * - execute BindSamplers to bind all samplers; It is expected that 304e5c31af7Sopenharmony_ci * INVALID_OPERATION will be generated; 305e5c31af7Sopenharmony_ci * - inspect bindings to verify that proper samplers were set; 306e5c31af7Sopenharmony_ci * 307e5c31af7Sopenharmony_ci * - unbind all samplers. 308e5c31af7Sopenharmony_ci **/ 309e5c31af7Sopenharmony_ciclass FunctionalBindSamplersTest : public deqp::TestCase 310e5c31af7Sopenharmony_ci{ 311e5c31af7Sopenharmony_cipublic: 312e5c31af7Sopenharmony_ci /* Public methods */ 313e5c31af7Sopenharmony_ci FunctionalBindSamplersTest(deqp::Context& context); 314e5c31af7Sopenharmony_ci 315e5c31af7Sopenharmony_ci virtual ~FunctionalBindSamplersTest() 316e5c31af7Sopenharmony_ci { 317e5c31af7Sopenharmony_ci } 318e5c31af7Sopenharmony_ci 319e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 320e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 321e5c31af7Sopenharmony_ci}; 322e5c31af7Sopenharmony_ci 323e5c31af7Sopenharmony_ci/** Implementation of test FunctionalBindImageTextures. Description follows: 324e5c31af7Sopenharmony_ci * 325e5c31af7Sopenharmony_ci * Verify that BindImageTextures works as expected. 326e5c31af7Sopenharmony_ci * 327e5c31af7Sopenharmony_ci * Steps: 328e5c31af7Sopenharmony_ci * - prepare MAX_IMAGE_UNITS textures; Use TEXTURE_1D, TEXTURE_1D_ARRAY, 329e5c31af7Sopenharmony_ci * TEXTURE_2D, TEXTURE_2D_ARRAY, TEXTURE_3D, TEXTURE_BUFFER, TEXTURE_CUBE_MAP 330e5c31af7Sopenharmony_ci * and TEXTURE_CUBE_MAP_ARRAY; If possible use rest of targets; 331e5c31af7Sopenharmony_ci * 332e5c31af7Sopenharmony_ci * - execute BindImageTextures to bind all images; 333e5c31af7Sopenharmony_ci * - inspect bindings to verify that proper images were set; 334e5c31af7Sopenharmony_ci * 335e5c31af7Sopenharmony_ci * - execute BindImageTextures for first half of units with <textures> filled 336e5c31af7Sopenharmony_ci * with zeros, to unbind those images; 337e5c31af7Sopenharmony_ci * - inspect bindings to verify that proper images were unbound; 338e5c31af7Sopenharmony_ci * 339e5c31af7Sopenharmony_ci * - execute BindImageTextures for second half of bindings with NULL as <samples>, 340e5c31af7Sopenharmony_ci * to unbind those images; 341e5c31af7Sopenharmony_ci * - inspect bindings to verify that proper images were unbound; 342e5c31af7Sopenharmony_ci * 343e5c31af7Sopenharmony_ci * - modify <textures> so first entry is invalid; 344e5c31af7Sopenharmony_ci * - execute BindImageTextures to bind all textures; It is expected that 345e5c31af7Sopenharmony_ci * INVALID_OPERATION will be generated; 346e5c31af7Sopenharmony_ci * - inspect bindings to verify that proper images were set; 347e5c31af7Sopenharmony_ci * 348e5c31af7Sopenharmony_ci * - unbind all images. 349e5c31af7Sopenharmony_ci **/ 350e5c31af7Sopenharmony_ciclass FunctionalBindImageTexturesTest : public deqp::TestCase 351e5c31af7Sopenharmony_ci{ 352e5c31af7Sopenharmony_cipublic: 353e5c31af7Sopenharmony_ci /* Public methods */ 354e5c31af7Sopenharmony_ci FunctionalBindImageTexturesTest(deqp::Context& context); 355e5c31af7Sopenharmony_ci 356e5c31af7Sopenharmony_ci virtual ~FunctionalBindImageTexturesTest() 357e5c31af7Sopenharmony_ci { 358e5c31af7Sopenharmony_ci } 359e5c31af7Sopenharmony_ci 360e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 361e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 362e5c31af7Sopenharmony_ci}; 363e5c31af7Sopenharmony_ci 364e5c31af7Sopenharmony_ci/** Implementation of test FunctionalBindVertexBuffers. Description follows: 365e5c31af7Sopenharmony_ci * 366e5c31af7Sopenharmony_ci * Verify that BindVertexBuffers works as expected. 367e5c31af7Sopenharmony_ci * 368e5c31af7Sopenharmony_ci * Steps: 369e5c31af7Sopenharmony_ci * - prepare MAX_VERTEX_ATTRIB_BINDINGS buffers; 370e5c31af7Sopenharmony_ci * 371e5c31af7Sopenharmony_ci * - execute BindVertexBuffers to bind all buffer; 372e5c31af7Sopenharmony_ci * - inspect bindings to verify that proper buffers were set; 373e5c31af7Sopenharmony_ci * 374e5c31af7Sopenharmony_ci * - execute BindVertexBuffers for first half of bindings with <buffers> filled 375e5c31af7Sopenharmony_ci * with zeros, to unbind those buffers; 376e5c31af7Sopenharmony_ci * - inspect bindings to verify that proper buffers were unbound; 377e5c31af7Sopenharmony_ci * 378e5c31af7Sopenharmony_ci * - execute BindVertexBuffers for second half of bindings with NULL as 379e5c31af7Sopenharmony_ci * <buffers>, to unbind those buffers; 380e5c31af7Sopenharmony_ci * - inspect bindings to verify that proper buffers were unbound; 381e5c31af7Sopenharmony_ci * 382e5c31af7Sopenharmony_ci * - modify <buffers> so first entry is invalid; 383e5c31af7Sopenharmony_ci * - execute BindVertexBuffers to bind all buffers; It is expected that 384e5c31af7Sopenharmony_ci * INVALID_OPERATION will be generated; 385e5c31af7Sopenharmony_ci * - inspect bindings to verify that proper buffers were set; 386e5c31af7Sopenharmony_ci * 387e5c31af7Sopenharmony_ci * - unbind all buffers. 388e5c31af7Sopenharmony_ci **/ 389e5c31af7Sopenharmony_ciclass FunctionalBindVertexBuffersTest : public deqp::TestCase 390e5c31af7Sopenharmony_ci{ 391e5c31af7Sopenharmony_cipublic: 392e5c31af7Sopenharmony_ci /* Public methods */ 393e5c31af7Sopenharmony_ci FunctionalBindVertexBuffersTest(deqp::Context& context); 394e5c31af7Sopenharmony_ci 395e5c31af7Sopenharmony_ci virtual ~FunctionalBindVertexBuffersTest() 396e5c31af7Sopenharmony_ci { 397e5c31af7Sopenharmony_ci } 398e5c31af7Sopenharmony_ci 399e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 400e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 401e5c31af7Sopenharmony_ci}; 402e5c31af7Sopenharmony_ci 403e5c31af7Sopenharmony_ci/** Implementation of test DispatchBindBuffersBase. Description follows: 404e5c31af7Sopenharmony_ci * 405e5c31af7Sopenharmony_ci * Verifies that BindBuffersBase command works as expected. 406e5c31af7Sopenharmony_ci * 407e5c31af7Sopenharmony_ci * In compute shader declare the GL_MAX_COMPUTE_UNIFORM_BLOCKS uniform blocks: 408e5c31af7Sopenharmony_ci * 409e5c31af7Sopenharmony_ci * layout(std140, binding = 0) uniform B1 {vec4 a;} b1; 410e5c31af7Sopenharmony_ci * layout(std140, binding = 0) uniform B2 {vec4 a;} b2; 411e5c31af7Sopenharmony_ci * 412e5c31af7Sopenharmony_ci * ... 413e5c31af7Sopenharmony_ci * 414e5c31af7Sopenharmony_ci * layout(std140, binding = (GL_MAX_COMPUTE_UNIFORM_BLOCKS-1)) uniform BX { 415e5c31af7Sopenharmony_ci * vec4 a; 416e5c31af7Sopenharmony_ci * } bx; 417e5c31af7Sopenharmony_ci * 418e5c31af7Sopenharmony_ci * The shader should sum b1.a, b2.a + ... + bx.a and store result in shader 419e5c31af7Sopenharmony_ci * storage buffer. 420e5c31af7Sopenharmony_ci * 421e5c31af7Sopenharmony_ci * In test program, create GL_MAX_COMPUTE_UNIFORM_BLOCKS buffers, bind them 422e5c31af7Sopenharmony_ci * using BindBuffersBase to B1 ... BX blocks, fill them with unique values. 423e5c31af7Sopenharmony_ci * Create and bind shader storage buffer for result. Dispatch compute shader. 424e5c31af7Sopenharmony_ci * 425e5c31af7Sopenharmony_ci * Test pass if the result is correct. 426e5c31af7Sopenharmony_ci **/ 427e5c31af7Sopenharmony_ciclass DispatchBindBuffersBaseTest : public deqp::TestCase 428e5c31af7Sopenharmony_ci{ 429e5c31af7Sopenharmony_cipublic: 430e5c31af7Sopenharmony_ci /* Public methods */ 431e5c31af7Sopenharmony_ci DispatchBindBuffersBaseTest(deqp::Context& context); 432e5c31af7Sopenharmony_ci 433e5c31af7Sopenharmony_ci virtual ~DispatchBindBuffersBaseTest() 434e5c31af7Sopenharmony_ci { 435e5c31af7Sopenharmony_ci } 436e5c31af7Sopenharmony_ci 437e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 438e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 439e5c31af7Sopenharmony_ci}; 440e5c31af7Sopenharmony_ci 441e5c31af7Sopenharmony_ci/** Implementation of test DispatchBindBuffersRange. Description follows: 442e5c31af7Sopenharmony_ci * 443e5c31af7Sopenharmony_ci * Verifies that BindBuffersRange command works as expected. 444e5c31af7Sopenharmony_ci * 445e5c31af7Sopenharmony_ci * In compute shader create the 4 of uniform blocks: 446e5c31af7Sopenharmony_ci * 447e5c31af7Sopenharmony_ci * layout(std140, binding = 0) uniform B1 {int a;} b1; 448e5c31af7Sopenharmony_ci * layout(std140, binding = 1) uniform B2 {int a;} b2; 449e5c31af7Sopenharmony_ci * layout(std140, binding = 2) uniform B4 {int a;} b3; 450e5c31af7Sopenharmony_ci * layout(std140, binding = 3) uniform B4 {int a;} b4; 451e5c31af7Sopenharmony_ci * 452e5c31af7Sopenharmony_ci * The shader should be sum b1.a b2.a, b3.a b4.a and store result in shader 453e5c31af7Sopenharmony_ci * storage buffer. 454e5c31af7Sopenharmony_ci * 455e5c31af7Sopenharmony_ci * 456e5c31af7Sopenharmony_ci * In test program, create the buffer filled with the following 7 bytes: 457e5c31af7Sopenharmony_ci * 458e5c31af7Sopenharmony_ci * { 0x00 0x01 0x00 0x01 0x00 0x01 0x00 } 459e5c31af7Sopenharmony_ci * 460e5c31af7Sopenharmony_ci * Bind buffer with BindBuffersRange with the following parameters: 461e5c31af7Sopenharmony_ci * - <target> GL_UNIFORM_BUFFER 462e5c31af7Sopenharmony_ci * - <first> 0 463e5c31af7Sopenharmony_ci * - <count> 4 464e5c31af7Sopenharmony_ci * - <buffers> { ID, ID, ID, ID }, 465e5c31af7Sopenharmony_ci * - <offsets> { 0, 1, 2, 3 }, 466e5c31af7Sopenharmony_ci * - <sizes> { 4, 4, 4, 4 }. 467e5c31af7Sopenharmony_ci * 468e5c31af7Sopenharmony_ci * Create and bind shader storage buffer for result. Dispatch compute shader. 469e5c31af7Sopenharmony_ci * 470e5c31af7Sopenharmony_ci * Test pass if the result is 0x02020202. 471e5c31af7Sopenharmony_ci **/ 472e5c31af7Sopenharmony_ciclass DispatchBindBuffersRangeTest : public deqp::TestCase 473e5c31af7Sopenharmony_ci{ 474e5c31af7Sopenharmony_cipublic: 475e5c31af7Sopenharmony_ci /* Public methods */ 476e5c31af7Sopenharmony_ci DispatchBindBuffersRangeTest(deqp::Context& context); 477e5c31af7Sopenharmony_ci 478e5c31af7Sopenharmony_ci virtual ~DispatchBindBuffersRangeTest() 479e5c31af7Sopenharmony_ci { 480e5c31af7Sopenharmony_ci } 481e5c31af7Sopenharmony_ci 482e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 483e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 484e5c31af7Sopenharmony_ci}; 485e5c31af7Sopenharmony_ci 486e5c31af7Sopenharmony_ci/** Implementation of test DispatchBindTextures. Description follows: 487e5c31af7Sopenharmony_ci * 488e5c31af7Sopenharmony_ci * Verifies that BindTextures command works as expected. 489e5c31af7Sopenharmony_ci * 490e5c31af7Sopenharmony_ci * Modify DispatchBindBuffersBase test in the following aspects: 491e5c31af7Sopenharmony_ci * - use R32UI textures instead of uniform blocks; 492e5c31af7Sopenharmony_ci * - use GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS textures; 493e5c31af7Sopenharmony_ci * - use all texture targets; 494e5c31af7Sopenharmony_ci * - use 1x1x1 textures, sample point (0.5, 0.5, 0.5). 495e5c31af7Sopenharmony_ci **/ 496e5c31af7Sopenharmony_ciclass DispatchBindTexturesTest : public deqp::TestCase 497e5c31af7Sopenharmony_ci{ 498e5c31af7Sopenharmony_cipublic: 499e5c31af7Sopenharmony_ci /* Public methods */ 500e5c31af7Sopenharmony_ci DispatchBindTexturesTest(deqp::Context& context); 501e5c31af7Sopenharmony_ci virtual ~DispatchBindTexturesTest() 502e5c31af7Sopenharmony_ci { 503e5c31af7Sopenharmony_ci } 504e5c31af7Sopenharmony_ci 505e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 506e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 507e5c31af7Sopenharmony_ci}; 508e5c31af7Sopenharmony_ci 509e5c31af7Sopenharmony_ci/** Implementation of test DispatchBindImageTextures. Description follows: 510e5c31af7Sopenharmony_ci * 511e5c31af7Sopenharmony_ci * Verifies that BindImageTextures command works as expected. 512e5c31af7Sopenharmony_ci * 513e5c31af7Sopenharmony_ci * Modify DispatchBindTextures test in the following aspects: 514e5c31af7Sopenharmony_ci * - use image units instead of texture units. 515e5c31af7Sopenharmony_ci **/ 516e5c31af7Sopenharmony_ciclass DispatchBindImageTexturesTest : public deqp::TestCase 517e5c31af7Sopenharmony_ci{ 518e5c31af7Sopenharmony_cipublic: 519e5c31af7Sopenharmony_ci /* Public methods */ 520e5c31af7Sopenharmony_ci DispatchBindImageTexturesTest(deqp::Context& context); 521e5c31af7Sopenharmony_ci 522e5c31af7Sopenharmony_ci virtual ~DispatchBindImageTexturesTest() 523e5c31af7Sopenharmony_ci { 524e5c31af7Sopenharmony_ci } 525e5c31af7Sopenharmony_ci 526e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 527e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 528e5c31af7Sopenharmony_ci}; 529e5c31af7Sopenharmony_ci 530e5c31af7Sopenharmony_ci/** Implementation of test DispatchBindSamplers. Description follows: 531e5c31af7Sopenharmony_ci * 532e5c31af7Sopenharmony_ci * Verifies that BindSamplers command works as expected. 533e5c31af7Sopenharmony_ci * 534e5c31af7Sopenharmony_ci * Prepare GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 8x8 2D R32UI textures filled so 535e5c31af7Sopenharmony_ci * the edges are set to 1 and center area is set to 0. 536e5c31af7Sopenharmony_ci * Prepare GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS samplers. Set parameter 537e5c31af7Sopenharmony_ci * GL_TEXTURE_WRAP_S to GL_CLAMP_TO_EDGE for all samplers. 538e5c31af7Sopenharmony_ci * 539e5c31af7Sopenharmony_ci * Prepare compute program as in test DispatchBindTextures, but sample 540e5c31af7Sopenharmony_ci * point (1.5, 0.5, 0.5). 541e5c31af7Sopenharmony_ci * 542e5c31af7Sopenharmony_ci * Test pass when the result stored in storage buffer is equal to 543e5c31af7Sopenharmony_ci * GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS. 544e5c31af7Sopenharmony_ci **/ 545e5c31af7Sopenharmony_ciclass DispatchBindSamplersTest : public deqp::TestCase 546e5c31af7Sopenharmony_ci{ 547e5c31af7Sopenharmony_cipublic: 548e5c31af7Sopenharmony_ci /* Public methods */ 549e5c31af7Sopenharmony_ci DispatchBindSamplersTest(deqp::Context& context); 550e5c31af7Sopenharmony_ci 551e5c31af7Sopenharmony_ci virtual ~DispatchBindSamplersTest() 552e5c31af7Sopenharmony_ci { 553e5c31af7Sopenharmony_ci } 554e5c31af7Sopenharmony_ci 555e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 556e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 557e5c31af7Sopenharmony_ci}; 558e5c31af7Sopenharmony_ci 559e5c31af7Sopenharmony_ci/** Implementation of test DrawBindVertexBuffers. Description follows: 560e5c31af7Sopenharmony_ci * 561e5c31af7Sopenharmony_ci * Verifies that BindVertexBuffers command works as expected. 562e5c31af7Sopenharmony_ci * 563e5c31af7Sopenharmony_ci * Prepare program consisting of vertex, geometry and fragment shader. Vertex 564e5c31af7Sopenharmony_ci * shader should: 565e5c31af7Sopenharmony_ci * - declare GL_MAX_VERTEX_ATTRIB_BINDINGS attributes: 566e5c31af7Sopenharmony_ci * 567e5c31af7Sopenharmony_ci * layout(location = 0) in vec4 attr_0; 568e5c31af7Sopenharmony_ci * layout(location = 1) in vec4 attr_0; 569e5c31af7Sopenharmony_ci * 570e5c31af7Sopenharmony_ci * ... 571e5c31af7Sopenharmony_ci * 572e5c31af7Sopenharmony_ci * layout(location = GL_MAX_VERTEX_ATTRIB_BINDINGS - 1) in vec4 attr_X; 573e5c31af7Sopenharmony_ci * 574e5c31af7Sopenharmony_ci * - calcualte sum of all attributes and store result in output varying. 575e5c31af7Sopenharmony_ci * Geometry shader should: 576e5c31af7Sopenharmony_ci * - output fullscreen quad; 577e5c31af7Sopenharmony_ci * - pass-through the value of summed attributes to fragment shader. 578e5c31af7Sopenharmony_ci * Fragment shader should pass-through the value of summed attributes to output 579e5c31af7Sopenharmony_ci * color. 580e5c31af7Sopenharmony_ci * 581e5c31af7Sopenharmony_ci * Prepare and bind vertex array object. Prepare ARRAY buffer filled with all 582e5c31af7Sopenharmony_ci * attributes. Values should be selected so the sum is equal 1.0 at each 583e5c31af7Sopenharmony_ci * channel. Use BindVertexBuffers to set up all attributes to use the buffer. 584e5c31af7Sopenharmony_ci * 585e5c31af7Sopenharmony_ci * Prepare framebuffer with 8x8 2D RGBA8 texture attached as color 0. Fill 586e5c31af7Sopenharmony_ci * texture with 0. 587e5c31af7Sopenharmony_ci * 588e5c31af7Sopenharmony_ci * Execute drawArrays for single vertex. 589e5c31af7Sopenharmony_ci * 590e5c31af7Sopenharmony_ci * Test pass if framebuffer is filled with value 1. 591e5c31af7Sopenharmony_ci **/ 592e5c31af7Sopenharmony_ciclass DrawBindVertexBuffersTest : public deqp::TestCase 593e5c31af7Sopenharmony_ci{ 594e5c31af7Sopenharmony_cipublic: 595e5c31af7Sopenharmony_ci /* Public methods */ 596e5c31af7Sopenharmony_ci DrawBindVertexBuffersTest(deqp::Context& context); 597e5c31af7Sopenharmony_ci 598e5c31af7Sopenharmony_ci virtual ~DrawBindVertexBuffersTest() 599e5c31af7Sopenharmony_ci { 600e5c31af7Sopenharmony_ci } 601e5c31af7Sopenharmony_ci 602e5c31af7Sopenharmony_ci /* Public methods inherited from TestCase */ 603e5c31af7Sopenharmony_ci virtual tcu::TestNode::IterateResult iterate(void); 604e5c31af7Sopenharmony_ci}; 605e5c31af7Sopenharmony_ci} /* MultiBind */ 606e5c31af7Sopenharmony_ci 607e5c31af7Sopenharmony_ci/** Group class for multi bind conformance tests */ 608e5c31af7Sopenharmony_ciclass MultiBindTests : public deqp::TestCaseGroup 609e5c31af7Sopenharmony_ci{ 610e5c31af7Sopenharmony_cipublic: 611e5c31af7Sopenharmony_ci /* Public methods */ 612e5c31af7Sopenharmony_ci MultiBindTests(deqp::Context& context); 613e5c31af7Sopenharmony_ci 614e5c31af7Sopenharmony_ci virtual ~MultiBindTests(void) 615e5c31af7Sopenharmony_ci { 616e5c31af7Sopenharmony_ci } 617e5c31af7Sopenharmony_ci 618e5c31af7Sopenharmony_ci virtual void init(void); 619e5c31af7Sopenharmony_ci 620e5c31af7Sopenharmony_ciprivate: 621e5c31af7Sopenharmony_ci /* Private methods */ 622e5c31af7Sopenharmony_ci MultiBindTests(const MultiBindTests& other); 623e5c31af7Sopenharmony_ci MultiBindTests& operator=(const MultiBindTests& other); 624e5c31af7Sopenharmony_ci}; 625e5c31af7Sopenharmony_ci 626e5c31af7Sopenharmony_ci} /* gl4cts */ 627e5c31af7Sopenharmony_ci 628e5c31af7Sopenharmony_ci#endif // _GL4CMULTIBINDTESTS_HPP 629