/*
 * MVKDeviceFeatureStructs.def
 *
 * Copyright (c) 2015-2024 The Brenwill Workshop Ltd. (http://www.brenwill.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// To use this file, define the macro MVK_DEVICE_FEATURE and optionally
// MVK_DEVICE_FEATURE_EXTN if needed, then #include this file.

// To add a new device feature struct, simply add a line below.
// The order is the typical approach of alphabetical but separated
// into sections based on Vulkan extensions.

#ifndef MVK_DEVICE_FEATURE
#error MVK_DEVICE_FEATURE must be defined before including this file
#endif
#ifndef MVK_DEVICE_FEATURE_EXTN
#define MVK_DEVICE_FEATURE_EXTN(structName, enumName, extnSfx, flagCount) MVK_DEVICE_FEATURE(structName, enumName, flagCount)
#endif

// INTEL is a common macro defined elsewhere in the system.
// We need to temporarily undefine it so that it doesn't expand when used in a macro below.
#pragma push_macro("INTEL")
#undef INTEL

MVK_DEVICE_FEATURE(16BitStorage,                      16BIT_STORAGE,                          4)
MVK_DEVICE_FEATURE(8BitStorage,                       8BIT_STORAGE,                           3)
MVK_DEVICE_FEATURE(BufferDeviceAddress,               BUFFER_DEVICE_ADDRESS,                  3)
MVK_DEVICE_FEATURE(DescriptorIndexing,                DESCRIPTOR_INDEXING,                   20)
MVK_DEVICE_FEATURE(DynamicRendering,                  DYNAMIC_RENDERING,                      1)
MVK_DEVICE_FEATURE(HostQueryReset,                    HOST_QUERY_RESET,                       1)
MVK_DEVICE_FEATURE(ImagelessFramebuffer,              IMAGELESS_FRAMEBUFFER,                  1)
MVK_DEVICE_FEATURE(ImageRobustness,                   IMAGE_ROBUSTNESS,                       1)
MVK_DEVICE_FEATURE(InlineUniformBlock,                INLINE_UNIFORM_BLOCK,                   2)
MVK_DEVICE_FEATURE(Multiview,                         MULTIVIEW,                              3)
MVK_DEVICE_FEATURE(PrivateData,                       PRIVATE_DATA,                           1)
MVK_DEVICE_FEATURE(ProtectedMemory,                   PROTECTED_MEMORY,                       1)
MVK_DEVICE_FEATURE(SamplerYcbcrConversion,            SAMPLER_YCBCR_CONVERSION,               1)
MVK_DEVICE_FEATURE(ScalarBlockLayout,                 SCALAR_BLOCK_LAYOUT,                    1)
MVK_DEVICE_FEATURE(SeparateDepthStencilLayouts,       SEPARATE_DEPTH_STENCIL_LAYOUTS,         1)
MVK_DEVICE_FEATURE(ShaderDrawParameters,              SHADER_DRAW_PARAMETERS,                 1)
MVK_DEVICE_FEATURE(ShaderAtomicInt64,                 SHADER_ATOMIC_INT64,                    2)
MVK_DEVICE_FEATURE(ShaderFloat16Int8,                 SHADER_FLOAT16_INT8,                    2)
MVK_DEVICE_FEATURE(ShaderIntegerDotProduct,           SHADER_INTEGER_DOT_PRODUCT,             1)
MVK_DEVICE_FEATURE(ShaderSubgroupExtendedTypes,       SHADER_SUBGROUP_EXTENDED_TYPES,         1)
MVK_DEVICE_FEATURE(SubgroupSizeControl,               SUBGROUP_SIZE_CONTROL,                  2)
MVK_DEVICE_FEATURE(Synchronization2,                  SYNCHRONIZATION_2,                      1)
MVK_DEVICE_FEATURE(TextureCompressionASTCHDR,         TEXTURE_COMPRESSION_ASTC_HDR,           1)
MVK_DEVICE_FEATURE(TimelineSemaphore,                 TIMELINE_SEMAPHORE,                     1)
MVK_DEVICE_FEATURE(UniformBufferStandardLayout,       UNIFORM_BUFFER_STANDARD_LAYOUT,         1)
MVK_DEVICE_FEATURE(VariablePointer,                   VARIABLE_POINTER,                       2)
MVK_DEVICE_FEATURE(VulkanMemoryModel,                 VULKAN_MEMORY_MODEL,                    3)
MVK_DEVICE_FEATURE_EXTN(FragmentShaderBarycentric,    FRAGMENT_SHADER_BARYCENTRIC,     KHR,   1)
MVK_DEVICE_FEATURE_EXTN(PortabilitySubset,            PORTABILITY_SUBSET,              KHR,  15)
MVK_DEVICE_FEATURE_EXTN(4444Formats,                  4444_FORMATS,                    EXT,   2)
MVK_DEVICE_FEATURE_EXTN(ExtendedDynamicState,         EXTENDED_DYNAMIC_STATE,          EXT,   1)
MVK_DEVICE_FEATURE_EXTN(ExtendedDynamicState2,        EXTENDED_DYNAMIC_STATE_2,        EXT,   3)
MVK_DEVICE_FEATURE_EXTN(ExtendedDynamicState3,        EXTENDED_DYNAMIC_STATE_3,        EXT,  31)
MVK_DEVICE_FEATURE_EXTN(FragmentShaderInterlock,      FRAGMENT_SHADER_INTERLOCK,       EXT,   3)
MVK_DEVICE_FEATURE_EXTN(HostImageCopy,                HOST_IMAGE_COPY,                 EXT,   1)
MVK_DEVICE_FEATURE_EXTN(PipelineCreationCacheControl, PIPELINE_CREATION_CACHE_CONTROL, EXT,   1)
MVK_DEVICE_FEATURE_EXTN(Robustness2,                  ROBUSTNESS_2,                    EXT,   3)
MVK_DEVICE_FEATURE_EXTN(ShaderAtomicFloat,            SHADER_ATOMIC_FLOAT,             EXT,  12)
MVK_DEVICE_FEATURE_EXTN(SwapchainMaintenance1,        SWAPCHAIN_MAINTENANCE_1,         EXT,   1)
MVK_DEVICE_FEATURE_EXTN(TexelBufferAlignment,         TEXEL_BUFFER_ALIGNMENT,          EXT,   1)
MVK_DEVICE_FEATURE_EXTN(VertexAttributeDivisor,       VERTEX_ATTRIBUTE_DIVISOR,        EXT,   2)
MVK_DEVICE_FEATURE_EXTN(ShaderIntegerFunctions2,      SHADER_INTEGER_FUNCTIONS_2,      INTEL, 1)

#pragma pop_macro("INTEL")
#undef MVK_DEVICE_FEATURE_EXTN
#undef MVK_DEVICE_FEATURE
