summaryrefslogtreecommitdiff
path: root/drivers/vulkan
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-11-24 22:34:48 +0100
committerGitHub <noreply@github.com>2021-11-24 22:34:48 +0100
commit547c27077721cf024031bedd69e55268c8d6b410 (patch)
treee67c55b758d5ca5553e6ff08bc5058b5a501deec /drivers/vulkan
parente49b127b41a425fadc47d09d375624c5511f1f06 (diff)
parent20deb0917d466ca9dd1bf435dfb326c72f73e3c0 (diff)
Merge pull request #51679 from Je06jm/fsr
AMD FidelityFX Super Resolution
Diffstat (limited to 'drivers/vulkan')
-rw-r--r--drivers/vulkan/rendering_device_vulkan.cpp1
-rw-r--r--drivers/vulkan/vulkan_context.cpp18
-rw-r--r--drivers/vulkan/vulkan_context.h12
3 files changed, 31 insertions, 0 deletions
diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp
index 4cae051302..952ee50074 100644
--- a/drivers/vulkan/rendering_device_vulkan.cpp
+++ b/drivers/vulkan/rendering_device_vulkan.cpp
@@ -8822,6 +8822,7 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context, bool p_local_de
// get info about further features
VulkanContext::MultiviewCapabilities multiview_capabilies = p_context->get_multiview_capabilities();
device_capabilities.supports_multiview = multiview_capabilies.is_supported && multiview_capabilies.max_view_count > 1;
+ device_capabilities.supports_fsr_half_float = p_context->get_shader_capabilities().shader_float16_is_supported && p_context->get_storage_buffer_capabilities().storage_buffer_16_bit_access_is_supported;
}
context = p_context;
diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp
index c178a68236..5912f481ec 100644
--- a/drivers/vulkan/vulkan_context.cpp
+++ b/drivers/vulkan/vulkan_context.cpp
@@ -535,6 +535,24 @@ Error VulkanContext::_check_capabilities() {
multiview_capabilities.is_supported = multiview_features.multiview;
multiview_capabilities.geometry_shader_is_supported = multiview_features.multiviewGeometryShader;
multiview_capabilities.tessellation_shader_is_supported = multiview_features.multiviewTessellationShader;
+
+ VkPhysicalDeviceShaderFloat16Int8FeaturesKHR shader_features;
+ shader_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES_KHR;
+ shader_features.pNext = NULL;
+
+ device_features.pNext = &shader_features;
+
+ device_features_func(gpu, &device_features);
+ shader_capabilities.shader_float16_is_supported = shader_features.shaderFloat16;
+
+ VkPhysicalDevice16BitStorageFeaturesKHR storage_feature;
+ storage_feature.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR;
+ storage_feature.pNext = NULL;
+
+ device_features.pNext = &storage_feature;
+
+ device_features_func(gpu, &device_features);
+ storage_buffer_capabilities.storage_buffer_16_bit_access_is_supported = storage_feature.storageBuffer16BitAccess;
}
// check extended properties
diff --git a/drivers/vulkan/vulkan_context.h b/drivers/vulkan/vulkan_context.h
index ae7c697be8..ab2f6a3eb5 100644
--- a/drivers/vulkan/vulkan_context.h
+++ b/drivers/vulkan/vulkan_context.h
@@ -66,6 +66,14 @@ public:
uint32_t max_instance_count;
};
+ struct ShaderCapabilities {
+ bool shader_float16_is_supported;
+ };
+
+ struct StorageBufferCapabilities {
+ bool storage_buffer_16_bit_access_is_supported;
+ };
+
private:
enum {
MAX_EXTENSIONS = 128,
@@ -88,6 +96,8 @@ private:
uint32_t vulkan_patch = 0;
SubgroupCapabilities subgroup_capabilities;
MultiviewCapabilities multiview_capabilities;
+ ShaderCapabilities shader_capabilities;
+ StorageBufferCapabilities storage_buffer_capabilities;
String device_vendor;
String device_name;
@@ -239,6 +249,8 @@ public:
uint32_t get_vulkan_minor() const { return vulkan_minor; };
SubgroupCapabilities get_subgroup_capabilities() const { return subgroup_capabilities; };
MultiviewCapabilities get_multiview_capabilities() const { return multiview_capabilities; };
+ ShaderCapabilities get_shader_capabilities() const { return shader_capabilities; };
+ StorageBufferCapabilities get_storage_buffer_capabilities() const { return storage_buffer_capabilities; };
VkDevice get_device();
VkPhysicalDevice get_physical_device();