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 FLAG_SPIRV_VALIDATOR_ALLOW_LOCALSIZEID = (1u<<1) 51 }; 52 SpirvValidatorOptionsvk::SpirvValidatorOptions53 SpirvValidatorOptions(deUint32 the_vulkan_version = VK_MAKE_VERSION(1, 0, 0), BlockLayoutRules the_layout = kDefaultBlockLayout, bool allowSpirv14 = false, deUint32 the_flags = 0) 54 : vulkanVersion(the_vulkan_version), blockLayout(the_layout), supports_VK_KHR_spirv_1_4(allowSpirv14), flags(the_flags) {} 55 56 // The target Vulkan version. This determines the SPIR-V environment rules to 57 // be checked. The bit pattern is as produced by VK_MAKE_VERSION. 58 deUint32 vulkanVersion; 59 60 // The block layout rules to enforce. 61 BlockLayoutRules blockLayout; 62 63 // Does the device support VK_KHR_spirv_1_4? 64 // (Camelcase would just be wrong here.) 65 bool supports_VK_KHR_spirv_1_4; 66 67 deUint32 flags; 68 }; 69 70 } // namespace vk 71 72 #endif // _VKVALIDATOROPTIONS_HPP 73