From d8f1e7750203898f05609dd77cac78b29ed6dd3a Mon Sep 17 00:00:00 2001 From: Robin Heinemann Date: Tue, 8 Dec 2020 23:36:14 +0100 Subject: [PATCH] Add 8bit storage support (#1452) --- CHANGELOG_VULKANO.md | 1 + vulkano-shaders/src/codegen.rs | 5 ++++- vulkano-shaders/src/enums.rs | 1 + vulkano/src/device/extensions.rs | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_VULKANO.md b/CHANGELOG_VULKANO.md index e177da8d..d118c8ab 100644 --- a/CHANGELOG_VULKANO.md +++ b/CHANGELOG_VULKANO.md @@ -6,6 +6,7 @@ - **Breaking** The `CommandBuffer` trait now has an additional required method, `kind`. - **Breaking** Update dependency `winit` 0.22 -> 0.23 - **Breaking** Added an Option to the ComputePipeline constructor to enable pipeline caching. +- Add support for 8bit storage. - Some safety checks have been added to `execute_commands`/`execute_commands_from_vec` on `AutoCommandBufferBuilder`, but not everything is checked yet so it's still unsafe to call. - Added two vulkano-win features `raw-window-handle_` and `winit_` to be able to use vulkano without winit. - Added function to create surface from `RawWindowHandle`. diff --git a/vulkano-shaders/src/codegen.rs b/vulkano-shaders/src/codegen.rs index c10ec16f..167c29c7 100644 --- a/vulkano-shaders/src/codegen.rs +++ b/vulkano-shaders/src/codegen.rs @@ -422,7 +422,7 @@ fn capability_requirement(cap: &Capability) -> DeviceRequirement { Capability::CapabilityImageRect => panic!(), // not supported Capability::CapabilitySampledRect => panic!(), // not supported Capability::CapabilityGenericPointer => panic!(), // not supported - Capability::CapabilityInt8 => panic!(), // not supported + Capability::CapabilityInt8 => DeviceRequirement::Extensions(&["khr_8bit_storage"]), Capability::CapabilityInputAttachment => DeviceRequirement::None, Capability::CapabilitySparseResidency => { DeviceRequirement::Features(&["shader_resource_residency"]) @@ -467,6 +467,9 @@ fn capability_requirement(cap: &Capability) -> DeviceRequirement { Capability::CapabilityStorageInputOutput16 => { DeviceRequirement::Extensions(&["khr_16bit_storage"]) } + Capability::CapabilityStorageInputOutput8 => { + DeviceRequirement::Extensions(&["khr_8bit_storage"]) + } } } diff --git a/vulkano-shaders/src/enums.rs b/vulkano-shaders/src/enums.rs index 787646bf..7c9607f8 100644 --- a/vulkano-shaders/src/enums.rs +++ b/vulkano-shaders/src/enums.rs @@ -551,5 +551,6 @@ enumeration! { CapabilityStorageUniform16 = 4434, CapabilityStoragePushConstant16 = 4435, CapabilityStorageInputOutput16 = 4436, + CapabilityStorageInputOutput8 = 4448, } Capability; } diff --git a/vulkano/src/device/extensions.rs b/vulkano/src/device/extensions.rs index 7fa450be..083af7f6 100644 --- a/vulkano/src/device/extensions.rs +++ b/vulkano/src/device/extensions.rs @@ -114,6 +114,7 @@ device_extensions! { khr_dedicated_allocation => b"VK_KHR_dedicated_allocation", khr_incremental_present => b"VK_KHR_incremental_present", khr_16bit_storage => b"VK_KHR_16bit_storage", + khr_8bit_storage => b"VK_KHR_8bit_storage", khr_storage_buffer_storage_class => b"VK_KHR_storage_buffer_storage_class", ext_debug_utils => b"VK_EXT_debug_utils", khr_multiview => b"VK_KHR_multiview",