Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit e1cda39

Browse files
committed
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>
1 parent b07147b commit e1cda39

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/Vulkan/VkPhysicalDevice.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ void PhysicalDevice::getFeatures(VkPhysicalDeviceLineRasterizationFeaturesEXT* f
144144
features->stippledSmoothLines = VK_FALSE;
145145
}
146146

147+
void PhysicalDevice::getFeatures(VkPhysicalDeviceProvokingVertexFeaturesEXT* features) const
148+
{
149+
features->provokingVertexLast = VK_TRUE;
150+
}
151+
147152
VkSampleCountFlags PhysicalDevice::getSampleCounts() const
148153
{
149154
return VK_SAMPLE_COUNT_1_BIT | VK_SAMPLE_COUNT_4_BIT;

src/Vulkan/VkPhysicalDevice.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class PhysicalDevice
4444
void getFeatures(VkPhysicalDeviceProtectedMemoryFeatures* features) const;
4545
void getFeatures(VkPhysicalDeviceShaderDrawParameterFeatures* features) const;
4646
void getFeatures(VkPhysicalDeviceLineRasterizationFeaturesEXT* features) const;
47+
void getFeatures(VkPhysicalDeviceProvokingVertexFeaturesEXT* features) const;
4748
bool hasFeatures(const VkPhysicalDeviceFeatures& requestedFeatures) const;
4849

4950
const VkPhysicalDeviceProperties& getProperties() const;

src/Vulkan/libVulkan.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,14 +2424,10 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physica
24242424
break;
24252425
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT:
24262426
{
2427-
const VkPhysicalDeviceProvokingVertexFeaturesEXT* provokingVertexFeatures = reinterpret_cast<const VkPhysicalDeviceProvokingVertexFeaturesEXT*>(extensionFeatures);
2428-
2429-
// Provoking vertex is supported.
2430-
// provokingVertexFeatures->provokingVertexLast can be VK_TRUE or VK_FALSE.
2431-
// No action needs to be taken on our end in either case; it's the apps responsibility to check
2432-
// that the provokingVertexLast feature is enabled before using the provoking vertex convention.
2433-
(void)provokingVertexFeatures->provokingVertexLast;
2427+
auto& features = *reinterpret_cast<VkPhysicalDeviceProvokingVertexFeaturesEXT*>(extensionFeatures);
2428+
vk::Cast(physicalDevice)->getFeatures(&features);
24342429
}
2430+
break;
24352431
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT:
24362432
ASSERT(!HasExtensionProperty(VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, deviceExtensionProperties,
24372433
sizeof(deviceExtensionProperties) / sizeof(deviceExtensionProperties[0])));

0 commit comments

Comments
 (0)