1 #ifndef _VKVALIDATOROPTIONS_HPP 2 #define _VKVALIDATOROPTIONS_HPP 3 /*------------------------------------------------------------------------- 4 * Vulkan CTS Framework 5 * -------------------- 6 * 7 * Copyright (c) 2018 Google LLC 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 SPIR-V validator options 24 *//*--------------------------------------------------------------------*/ 25 26 #include "vkDefs.hpp" 27 28 namespace vk 29 { 30 31 struct SpirvValidatorOptions 32 { 33 enum BlockLayoutRules 34 { 35 // The default for the target Vulkan environment. 36 kDefaultBlockLayout, 37 // Don't check block layout 38 kNoneBlockLayout, 39 // VK_KHR_relaxed_block_layout 40 kRelaxedBlockLayout, 41 // VK_EXT_uniform_buffer_standard_layout 42 kUniformStandardLayout, 43 // VK_EXT_scalar_block_layout 44 kScalarBlockLayout 45 }; 46 47 enum Flags 48 { 49 FLAG_SPIRV_VALIDATOR_WORKGROUP_SCALAR_BLOCK_LAYOUT = (1u<<0) 50 }; 51 SpirvValidatorOptionsvk::SpirvValidatorOptions52 SpirvValidatorOptions(deUint32 the_vulkan_version = VK_MAKE_VERSION(1, 0, 0), BlockLayoutRules the_layout = kDefaultBlockLayout, bool allowSpirv14 = false, deUint32 the_flags = 0) 53 : vulkanVersion(the_vulkan_version), blockLayout(the_layout), supports_VK_KHR_spirv_1_4(allowSpirv14), flags(the_flags) {} 54 55 // The target Vulkan version. This determines the SPIR-V environment rules to 56 // be checked. The bit pattern is as produced by VK_MAKE_VERSION. 57 deUint32 vulkanVersion; 58 59 // The block layout rules to enforce. 60 BlockLayoutRules blockLayout; 61 62 // Does the device support VK_KHR_spirv_1_4? 63 // (Camelcase would just be wrong here.) 64 bool supports_VK_KHR_spirv_1_4; 65 66 deUint32 flags; 67 }; 68 69 } // namespace vk 70 71 #endif // _VKVALIDATOROPTIONS_HPP 72