1 #ifndef _VKTTRANSFORMFEEDBACKRANDOMLAYOUTCASE_HPP 2 #define _VKTTRANSFORMFEEDBACKRANDOMLAYOUTCASE_HPP 3 /*------------------------------------------------------------------------ 4 * Vulkan Conformance Tests 5 * ------------------------ 6 * 7 * Copyright (c) 2015 The Khronos Group Inc. 8 * Copyright (c) 2015 Samsung Electronics Co., Ltd. 9 * Copyright (c) 2018 The Khronos Group Inc. 10 * 11 * Licensed under the Apache License, Version 2.0 (the "License"); 12 * you may not use this file except in compliance with the License. 13 * You may obtain a copy of the License at 14 * 15 * http://www.apache.org/licenses/LICENSE-2.0 16 * 17 * Unless required by applicable law or agreed to in writing, software 18 * distributed under the License is distributed on an "AS IS" BASIS, 19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 * See the License for the specific language governing permissions and 21 * limitations under the License. 22 * 23 *//*! 24 * \file 25 * \brief Vulkan Transform Feedback Fuzz Random Layout Tests 26 *//*--------------------------------------------------------------------*/ 27 28 #include "vktTransformFeedbackFuzzLayoutCase.hpp" 29 30 namespace de 31 { 32 class Random; 33 } // de 34 35 namespace vkt 36 { 37 namespace TransformFeedback 38 { 39 40 enum FeatureBits 41 { 42 FEATURE_VECTORS = (1<<0), 43 FEATURE_MATRICES = (1<<1), 44 FEATURE_ARRAYS = (1<<2), 45 FEATURE_STRUCTS = (1<<3), 46 FEATURE_NESTED_STRUCTS = (1<<4), 47 FEATURE_INSTANCE_ARRAYS = (1<<5), 48 FEATURE_ARRAYS_OF_ARRAYS = (1<<6), 49 FEATURE_DOUBLES = (1<<7), 50 FEATURE_UNASSIGNED_FIELDS = (1<<8), 51 FEATURE_UNASSIGNED_BLOCK_MEMBERS= (1<<9), 52 FEATURE_MISSING_BLOCK_MEMBERS = (1<<10), // Add holes into XFB buffer 53 FEATURE_OUT_OF_ORDER_OFFSETS = (1<<11), 54 }; 55 56 class RandomInterfaceBlockCase : public InterfaceBlockCase 57 { 58 public: 59 RandomInterfaceBlockCase (tcu::TestContext& testCtx, 60 const std::string& name, 61 const TestStageFlags testStageFlags, 62 deUint32 features, 63 deUint32 seed); 64 65 private: 66 void generateBlock (de::Random& rnd, deUint32 layoutFlags); 67 void generateBlockMember (de::Random& rnd, InterfaceBlock& block, const int numBlockMembers, int& numMissing); 68 VarType generateType (de::Random& rnd, int typeDepth, bool arrayOk); 69 std::vector<glu::DataType> fillTypeCandidates (void); 70 71 const deUint32 m_features; 72 const bool m_explicitXfbOffsets; 73 const int m_maxBlocks; 74 const int m_maxInstances; 75 const int m_maxArrayLength; 76 const int m_maxStructDepth; 77 const int m_maxBlockMembers; 78 const int m_maxStructMembers; 79 const deUint32 m_seed; 80 81 int m_blockNdx; 82 int m_interfaceNdx; 83 int m_structNdx; 84 std::vector<glu::DataType> m_primitiveTypeCandidates; 85 }; 86 87 } // TransformFeedback 88 } // vkt 89 90 #endif // _VKTTRANSFORMFEEDBACKRANDOMLAYOUTCASE_HPP 91