From 6da54821dab9aba6be3be1d6c5dba83dc806dfd7 Mon Sep 17 00:00:00 2001 From: Aitor Camacho Date: Thu, 23 Oct 2025 09:51:08 -0600 Subject: [PATCH] kk: Reorder physical device extensions and features Acked-by: Alyssa Rosenzweig Part-of: --- src/kosmickrisp/vulkan/kk_physical_device.c | 79 +++++++++------------ 1 file changed, 33 insertions(+), 46 deletions(-) diff --git a/src/kosmickrisp/vulkan/kk_physical_device.c b/src/kosmickrisp/vulkan/kk_physical_device.c index ce28b59d635..66116c380b0 100644 --- a/src/kosmickrisp/vulkan/kk_physical_device.c +++ b/src/kosmickrisp/vulkan/kk_physical_device.c @@ -73,9 +73,9 @@ kk_get_device_extensions(const struct kk_instance *instance, .KHR_sampler_mirror_clamp_to_edge = false, .KHR_separate_depth_stencil_layouts = true, .KHR_shader_atomic_int64 = false, + .KHR_shader_float_controls = true, .KHR_shader_float16_int8 = false, /* TODO_KOSMICKRISP shaderInt8 shaderFloat16 */ - .KHR_shader_float_controls = true, .KHR_shader_subgroup_extended_types = true, .KHR_spirv_1_4 = true, .KHR_timeline_semaphore = true, @@ -116,22 +116,22 @@ kk_get_device_extensions(const struct kk_instance *instance, /* Vulkan 1.4 */ .KHR_push_descriptor = true, + .KHR_shader_expect_assume = true, - /* Optional extensions */ + /* Optional extensions */ + .KHR_shader_maximal_reconvergence = true, + .KHR_shader_relaxed_extended_instruction = true, + .KHR_shader_subgroup_uniform_control_flow = true, #ifdef KK_USE_WSI_PLATFORM .KHR_swapchain = true, .KHR_swapchain_mutable_format = true, #endif + .EXT_external_memory_metal = true, .EXT_mutable_descriptor_type = true, .EXT_shader_atomic_float = true, .EXT_shader_replicated_composites = true, - .KHR_shader_expect_assume = true, - .KHR_shader_maximal_reconvergence = true, - .KHR_shader_relaxed_extended_instruction = true, - .KHR_shader_subgroup_uniform_control_flow = true, - .GOOGLE_decorate_string = true, .GOOGLE_hlsl_functionality1 = true, .GOOGLE_user_type = true, @@ -145,7 +145,6 @@ kk_get_device_features( { *features = (struct vk_features){ /* Vulkan 1.0 */ - .robustBufferAccess = true, .depthClamp = true, .drawIndirectFirstInstance = true, .dualSrcBlend = true, @@ -158,9 +157,14 @@ kk_get_device_features( .fragmentStoresAndAtomics = false, .imageCubeArray = true, .logicOp = true, + .robustBufferAccess = true, + .samplerAnisotropy = true, .shaderInt16 = true, .shaderInt64 = true, .shaderResourceMinLod = true, + .shaderSampledImageArrayDynamicIndexing = true, + .shaderStorageBufferArrayDynamicIndexing = true, + .shaderStorageImageArrayDynamicIndexing = true, /* TODO_KOSMICKRISP * Disabled because the following test * dEQP-VK.api.format_feature_flags2.r8_unorm and similars fail, need to @@ -170,19 +174,20 @@ kk_get_device_features( .shaderStorageImageReadWithoutFormat = false, .shaderStorageImageWriteWithoutFormat = false, .shaderUniformBufferArrayDynamicIndexing = true, - .shaderSampledImageArrayDynamicIndexing = true, - .shaderStorageBufferArrayDynamicIndexing = true, - .shaderStorageImageArrayDynamicIndexing = true, + .textureCompressionASTC_LDR = true, + .textureCompressionBC = true, + .textureCompressionETC2 = true, /* Vulkan 1.1 */ .multiview = true, + .samplerYcbcrConversion = true, .shaderDrawParameters = true, .storageBuffer16BitAccess = true, .storageInputOutput16 = false, .storagePushConstant16 = true, - .variablePointersStorageBuffer = true, - .variablePointers = true, .uniformAndStorageBuffer16BitAccess = true, + .variablePointers = true, + .variablePointersStorageBuffer = true, /* Vulkan 1.2 */ .descriptorBindingInlineUniformBlockUpdateAfterBind = true, @@ -204,36 +209,25 @@ kk_get_device_features( .separateDepthStencilLayouts = true, /* TODO_KOSMICKRISP shaderFloat16 * Failing: - * dEQP-VK.spirv_assembly.instruction.compute.float16.opcompositeinsert.v4f16 - * dEQP-VK.spirv_assembly.instruction.compute.float16.opcompositeinsert.v2f16arr5 - * dEQP-VK.spirv_assembly.instruction.compute.float16.opcompositeinsert.v3f16arr5 - * dEQP-VK.spirv_assembly.instruction.compute.float16.opcompositeinsert.v4f16arr3 - * dEQP-VK.spirv_assembly.instruction.compute.float16.opcompositeinsert.struct16arr3 - * dEQP-VK.spirv_assembly.instruction.graphics.float16.opcompositeinsert.v3f16_frag - * dEQP-VK.spirv_assembly.instruction.graphics.float16.opcompositeinsert.v4f16_frag - * dEQP-VK.spirv_assembly.instruction.graphics.float16.opcompositeinsert.v2f16arr5_frag - * dEQP-VK.spirv_assembly.instruction.graphics.float16.opcompositeinsert.v3f16arr5_frag - * dEQP-VK.spirv_assembly.instruction.graphics.float16.opcompositeinsert.v4f16arr3_frag - * dEQP-VK.spirv_assembly.instruction.graphics.float16.opcompositeinsert.struct16arr3_frag - * dEQP-VK.memory_model.shared.16bit.nested_structs_arrays.0 - * dEQP-VK.memory_model.shared.16bit.nested_structs_arrays.4 + * dEQP-VK.spirv_assembly.instruction.*.float16.opcompositeinsert.* + * dEQP-VK.memory_model.shared.16bit.nested_structs_arrays.* */ .shaderFloat16 = false, .shaderInputAttachmentArrayDynamicIndexing = true, .shaderInputAttachmentArrayNonUniformIndexing = true, /* TODO_KOSMICKRISP shaderInt8 - * Multiple MSL compiler crashes if we enable shaderInt8, need to - * understand why and a workaround: - * dEQP-VK.memory_model.shared.8bit.vector_types.9 - * dEQP-VK.memory_model.shared.8bit.basic_types.8 - * dEQP-VK.memory_model.shared.8bit.basic_arrays.2 - * dEQP-VK.memory_model.shared.8bit.arrays_of_arrays.1 - * dEQP-VK.memory_model.shared.8bit.arrays_of_arrays.8 - * Probably more - */ + * Multiple MSL compiler crashes if we enable shaderInt8, need to + * understand why and a workaround: + * dEQP-VK.memory_model.shared.8bit.vector_types.9 + * dEQP-VK.memory_model.shared.8bit.basic_types.8 + * dEQP-VK.memory_model.shared.8bit.basic_arrays.2 + * dEQP-VK.memory_model.shared.8bit.arrays_of_arrays.1 + * dEQP-VK.memory_model.shared.8bit.arrays_of_arrays.8 + * Probably more + */ .shaderInt8 = false, - .shaderOutputViewportIndex = true, .shaderOutputLayer = true, + .shaderOutputViewportIndex = true, .shaderSampledImageArrayNonUniformIndexing = true, .shaderStorageBufferArrayNonUniformIndexing = true, .shaderStorageTexelBufferArrayDynamicIndexing = true, @@ -265,13 +259,6 @@ kk_get_device_features( .vulkanMemoryModel = true, .vulkanMemoryModelDeviceScope = true, - /* Optional features */ - .samplerAnisotropy = true, - .samplerYcbcrConversion = true, - .textureCompressionETC2 = true, - .textureCompressionASTC_LDR = true, - .textureCompressionBC = true, - /* VK_EXT_mutable_descriptor_type */ .mutableDescriptorType = true, @@ -293,7 +280,7 @@ kk_get_device_features( /* VK_EXT_shader_atomic_float */ .shaderBufferFloat32Atomics = true, .shaderBufferFloat32AtomicAdd = true, - .shaderSharedFloat32Atomics = true, + .shaderSharedFloat32Atomics = true, }; } @@ -317,8 +304,8 @@ kk_get_device_properties(const struct kk_physical_device *pdev, *properties = (struct vk_properties){ .apiVersion = kk_get_vk_version(), .driverVersion = vk_get_driver_version(), - .vendorID = instance->force_vk_vendor != 0 ? instance->force_vk_vendor - : 0x106b, + .vendorID = + instance->force_vk_vendor != 0 ? instance->force_vk_vendor : 0x106b, .deviceID = 100, .deviceType = VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU,