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