vkGetPhysicalDeviceFeatures2 fix
A mistake found its way into the previous "Provoking vertex fixes"
cl. This cl fixes the vkGetPhysicalDeviceFeatures2 function for the
VK_EXT_provoking_vertex extension.
Bug: angleproject:3677, angleproject:3430
Change-Id: I561361f3fd2c3f6b7ca524614b7d7af461cc12d4
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/37710
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Vulkan/VkPhysicalDevice.cpp b/src/Vulkan/VkPhysicalDevice.cpp
index 54e5158..187c4bb 100644
--- a/src/Vulkan/VkPhysicalDevice.cpp
+++ b/src/Vulkan/VkPhysicalDevice.cpp
@@ -144,6 +144,11 @@
features->stippledSmoothLines = VK_FALSE;
}
+void PhysicalDevice::getFeatures(VkPhysicalDeviceProvokingVertexFeaturesEXT* features) const
+{
+ features->provokingVertexLast = VK_TRUE;
+}
+
VkSampleCountFlags PhysicalDevice::getSampleCounts() const
{
return VK_SAMPLE_COUNT_1_BIT | VK_SAMPLE_COUNT_4_BIT;
diff --git a/src/Vulkan/VkPhysicalDevice.hpp b/src/Vulkan/VkPhysicalDevice.hpp
index 531b4cd..a7faecf 100644
--- a/src/Vulkan/VkPhysicalDevice.hpp
+++ b/src/Vulkan/VkPhysicalDevice.hpp
@@ -44,6 +44,7 @@
void getFeatures(VkPhysicalDeviceProtectedMemoryFeatures* features) const;
void getFeatures(VkPhysicalDeviceShaderDrawParameterFeatures* features) const;
void getFeatures(VkPhysicalDeviceLineRasterizationFeaturesEXT* features) const;
+ void getFeatures(VkPhysicalDeviceProvokingVertexFeaturesEXT* features) const;
bool hasFeatures(const VkPhysicalDeviceFeatures& requestedFeatures) const;
const VkPhysicalDeviceProperties& getProperties() const;
diff --git a/src/Vulkan/libVulkan.cpp b/src/Vulkan/libVulkan.cpp
index 025aa7e..b7a9b1a 100644
--- a/src/Vulkan/libVulkan.cpp
+++ b/src/Vulkan/libVulkan.cpp
@@ -2424,14 +2424,10 @@
break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT:
{
- const VkPhysicalDeviceProvokingVertexFeaturesEXT* provokingVertexFeatures = reinterpret_cast<const VkPhysicalDeviceProvokingVertexFeaturesEXT*>(extensionFeatures);
-
- // Provoking vertex is supported.
- // provokingVertexFeatures->provokingVertexLast can be VK_TRUE or VK_FALSE.
- // No action needs to be taken on our end in either case; it's the apps responsibility to check
- // that the provokingVertexLast feature is enabled before using the provoking vertex convention.
- (void)provokingVertexFeatures->provokingVertexLast;
+ auto& features = *reinterpret_cast<VkPhysicalDeviceProvokingVertexFeaturesEXT*>(extensionFeatures);
+ vk::Cast(physicalDevice)->getFeatures(&features);
}
+ break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT:
ASSERT(!HasExtensionProperty(VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, deviceExtensionProperties,
sizeof(deviceExtensionProperties) / sizeof(deviceExtensionProperties[0])));