|
| 1 | +diff --git a/src/dawn/native/vulkan/DeviceVk.cpp b/src/dawn/native/vulkan/DeviceVk.cpp |
| 2 | +index c01d64e40f..0f1f4beae4 100644 |
| 3 | +--- a/src/dawn/native/vulkan/DeviceVk.cpp |
| 4 | ++++ b/src/dawn/native/vulkan/DeviceVk.cpp |
| 5 | +@@ -464,13 +464,15 @@ ResultOrError<VulkanDeviceKnobs> Device::CreateDevice(VkPhysicalDevice vkPhysica |
| 6 | + DAWN_ASSERT(usedKnobs.HasExt(DeviceExt::ShaderFloat16Int8) && |
| 7 | + mDeviceInfo.shaderFloat16Int8Features.shaderFloat16 == VK_TRUE && |
| 8 | + usedKnobs.HasExt(DeviceExt::_16BitStorage) && |
| 9 | +- mDeviceInfo._16BitStorageFeatures.storageBuffer16BitAccess == VK_TRUE && |
| 10 | ++ mDeviceInfo._16BitStorageFeatures.storageBuffer16BitAccess == VK_TRUE /*&& |
| 11 | + mDeviceInfo._16BitStorageFeatures.uniformAndStorageBuffer16BitAccess == |
| 12 | +- VK_TRUE); |
| 13 | ++ VK_TRUE*/); |
| 14 | + |
| 15 | + usedKnobs.shaderFloat16Int8Features.shaderFloat16 = VK_TRUE; |
| 16 | + usedKnobs._16BitStorageFeatures.storageBuffer16BitAccess = VK_TRUE; |
| 17 | +- usedKnobs._16BitStorageFeatures.uniformAndStorageBuffer16BitAccess = VK_TRUE; |
| 18 | ++ if (mDeviceInfo._16BitStorageFeatures.uniformAndStorageBuffer16BitAccess == VK_TRUE) { |
| 19 | ++ usedKnobs._16BitStorageFeatures.uniformAndStorageBuffer16BitAccess = VK_TRUE; |
| 20 | ++ } |
| 21 | + if (mDeviceInfo._16BitStorageFeatures.storageInputOutput16 == VK_TRUE) { |
| 22 | + usedKnobs._16BitStorageFeatures.storageInputOutput16 = VK_TRUE; |
| 23 | + } |
| 24 | +diff --git a/src/dawn/native/vulkan/PhysicalDeviceVk.cpp b/src/dawn/native/vulkan/PhysicalDeviceVk.cpp |
| 25 | +index a324c101ed..8d64da750f 100644 |
| 26 | +--- a/src/dawn/native/vulkan/PhysicalDeviceVk.cpp |
| 27 | ++++ b/src/dawn/native/vulkan/PhysicalDeviceVk.cpp |
| 28 | +@@ -269,8 +269,9 @@ void PhysicalDevice::InitializeSupportedFeaturesImpl() { |
| 29 | + if (mDeviceInfo.HasExt(DeviceExt::ShaderFloat16Int8) && |
| 30 | + mDeviceInfo.HasExt(DeviceExt::_16BitStorage) && |
| 31 | + mDeviceInfo.shaderFloat16Int8Features.shaderFloat16 == VK_TRUE && |
| 32 | +- mDeviceInfo._16BitStorageFeatures.storageBuffer16BitAccess == VK_TRUE && |
| 33 | +- mDeviceInfo._16BitStorageFeatures.uniformAndStorageBuffer16BitAccess == VK_TRUE) { |
| 34 | ++ mDeviceInfo._16BitStorageFeatures.storageBuffer16BitAccess == VK_TRUE /*&& |
| 35 | ++ WebGPU EP needs to ensure we don't put fp16 values in uniforms when this patch is applied. |
| 36 | ++ mDeviceInfo._16BitStorageFeatures.uniformAndStorageBuffer16BitAccess == VK_TRUE*/) { |
| 37 | + // ONNX Runtime Patch: enable shaderF16 on all devices. |
| 38 | + EnableFeature(Feature::ShaderF16); |
| 39 | + shaderF16Enabled = true; |
0 commit comments