Add support for shader draw parameters query
We claim no support for now.
Bug: b/117974925
Test: dEQP-VK.draw.shader_draw_parameters.*
Change-Id: Id3b09419c365cc513dabf636a932c087b99f7cc3
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29188
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Vulkan/VkPhysicalDevice.cpp b/src/Vulkan/VkPhysicalDevice.cpp
index fb6929e..997f090 100644
--- a/src/Vulkan/VkPhysicalDevice.cpp
+++ b/src/Vulkan/VkPhysicalDevice.cpp
@@ -128,6 +128,11 @@
features->protectedMemory = VK_FALSE;
}
+void PhysicalDevice::getFeatures(VkPhysicalDeviceShaderDrawParameterFeatures* features) const
+{
+ features->shaderDrawParameters = VK_FALSE;
+}
+
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 7818f4e..e07ce79 100644
--- a/src/Vulkan/VkPhysicalDevice.hpp
+++ b/src/Vulkan/VkPhysicalDevice.hpp
@@ -37,6 +37,7 @@
void getFeatures(VkPhysicalDevice8BitStorageFeaturesKHR* features) const;
void getFeatures(VkPhysicalDeviceMultiviewFeatures* features) const;
void getFeatures(VkPhysicalDeviceProtectedMemoryFeatures* features) const;
+ void getFeatures(VkPhysicalDeviceShaderDrawParameterFeatures* 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 b2e9b91..188c2d3 100644
--- a/src/Vulkan/libVulkan.cpp
+++ b/src/Vulkan/libVulkan.cpp
@@ -2003,6 +2003,12 @@
vk::Cast(physicalDevice)->getFeatures(&features);
}
break;
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES:
+ {
+ auto& features = *reinterpret_cast<VkPhysicalDeviceShaderDrawParameterFeatures*>(extensionFeatures);
+ vk::Cast(physicalDevice)->getFeatures(&features);
+ }
+ break;
default:
// "the [driver] must skip over, without processing (other than reading the sType and pNext members) any structures in the chain with sType values not defined by [supported extenions]"
UNIMPLEMENTED("extensionFeatures->sType"); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here.