Support for VK_KHR_separate_depth_stencil_layouts
This cl adds support for the VK_KHR_separate_depth_stencil_layouts.
It doesn't add any new functionality, since SwiftShader has
historically supported quad layout stencil and non quad layout depth.
Bug: b/148881874
Change-Id: I6ed77ee1261bfda1468595474cf0840564f2553d
Tests: dEQP-VK.*
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/41068
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/Vulkan/VkPhysicalDevice.cpp b/src/Vulkan/VkPhysicalDevice.cpp
index f3e62f5..70047a9 100644
--- a/src/Vulkan/VkPhysicalDevice.cpp
+++ b/src/Vulkan/VkPhysicalDevice.cpp
@@ -158,6 +158,11 @@
features->shaderDrawParameters = VK_FALSE;
}
+void PhysicalDevice::getFeatures(VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR* features) const
+{
+ features->separateDepthStencilLayouts = VK_TRUE;
+}
+
void PhysicalDevice::getFeatures(VkPhysicalDeviceLineRasterizationFeaturesEXT *features) const
{
features->rectangularLines = VK_TRUE;
diff --git a/src/Vulkan/VkPhysicalDevice.hpp b/src/Vulkan/VkPhysicalDevice.hpp
index 8e94466..2542e35 100644
--- a/src/Vulkan/VkPhysicalDevice.hpp
+++ b/src/Vulkan/VkPhysicalDevice.hpp
@@ -43,6 +43,7 @@
void getFeatures(VkPhysicalDeviceProtectedMemoryFeatures *features) const;
void getFeatures(VkPhysicalDeviceShaderDrawParameterFeatures *features) const;
void getFeatures(VkPhysicalDeviceLineRasterizationFeaturesEXT *features) const;
+ void getFeatures(VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR* features) const;
void getFeatures(VkPhysicalDeviceProvokingVertexFeaturesEXT *features) const;
bool hasFeatures(const VkPhysicalDeviceFeatures &requestedFeatures) const;
diff --git a/src/Vulkan/libVulkan.cpp b/src/Vulkan/libVulkan.cpp
index beddc54..61eb97c 100644
--- a/src/Vulkan/libVulkan.cpp
+++ b/src/Vulkan/libVulkan.cpp
@@ -312,6 +312,7 @@
{ VK_KHR_MULTIVIEW_EXTENSION_NAME, VK_KHR_MULTIVIEW_SPEC_VERSION },
{ VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME, VK_KHR_RELAXED_BLOCK_LAYOUT_SPEC_VERSION },
{ VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME, VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION },
+ { VK_KHR_SEPARATE_DEPTH_STENCIL_LAYOUTS_EXTENSION_NAME, VK_KHR_SEPARATE_DEPTH_STENCIL_LAYOUTS_SPEC_VERSION },
// Only 1.1 core version of this is supported. The extension has additional requirements
//{ VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION },
{ VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME, VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION },
@@ -713,6 +714,14 @@
}
}
break;
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES_KHR:
+ {
+ const VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR* shaderDrawParametersFeatures = reinterpret_cast<const VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR*>(extensionCreateInfo);
+
+ // Separate depth and stencil layouts is already supported
+ (void)(shaderDrawParametersFeatures->separateDepthStencilLayouts);
+ }
+ break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT:
{
const VkPhysicalDeviceLineRasterizationFeaturesEXT *lineRasterizationFeatures = reinterpret_cast<const VkPhysicalDeviceLineRasterizationFeaturesEXT *>(extensionCreateInfo);
@@ -2746,6 +2755,12 @@
vk::Cast(physicalDevice)->getFeatures(features);
}
break;
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES_KHR:
+ {
+ auto features = reinterpret_cast<VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR*>(extensionFeatures);
+ vk::Cast(physicalDevice)->getFeatures(features);
+ }
+ break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT:
{
auto features = reinterpret_cast<VkPhysicalDeviceLineRasterizationFeaturesEXT *>(extensionFeatures);