Skip to content

Commit d8f1ff7

Browse files
committed
[wgpu-hal] Expose capabilities DotProductInput*
1 parent 1e51e90 commit d8f1ff7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

wgpu-hal/src/vulkan/adapter.rs

+16
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,11 @@ impl PhysicalDeviceProperties {
10351035
if requested_features.intersects(wgt::Features::EXPERIMENTAL_MESH_SHADER) {
10361036
extensions.push(khr::maintenance4::NAME);
10371037
}
1038+
1039+
// Optional `VK_KHR_shader_integer_dot_product`
1040+
if self.supports_extension(khr::shader_integer_dot_product::NAME) {
1041+
extensions.push(khr::shader_integer_dot_product::NAME);
1042+
}
10381043
}
10391044

10401045
// Optional `VK_KHR_swapchain_mutable_format`
@@ -2011,6 +2016,17 @@ impl super::Adapter {
20112016
if features.contains(wgt::Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN) {
20122017
capabilities.push(spv::Capability::RayQueryPositionFetchKHR)
20132018
}
2019+
if self.phd_capabilities.device_api_version >= vk::API_VERSION_1_3
2020+
|| enabled_extensions.contains(&khr::shader_integer_dot_product::NAME)
2021+
{
2022+
// See <https://registry.khronos.org/vulkan/specs/latest/man/html/VK_KHR_shader_integer_dot_product.html#_new_spir_v_capabilities>.
2023+
capabilities.extend(&[
2024+
spv::Capability::DotProductInputAllKHR,
2025+
spv::Capability::DotProductInput4x8BitKHR,
2026+
spv::Capability::DotProductInput4x8BitPackedKHR,
2027+
spv::Capability::DotProductKHR,
2028+
]);
2029+
}
20142030
spv::Options {
20152031
lang_version: match self.phd_capabilities.device_api_version {
20162032
// Use maximum supported SPIR-V version according to

0 commit comments

Comments
 (0)