Vulkan: Fix line width caps.
We would need to enable the wide lines feature to support non-unit line
widths. For now just disable the caps.
Bug: angleproject:2598
Bug: angleproject:2706
Change-Id: I0dd228fc2c357bdd9442c3d841be769987a53f72
Reviewed-on: https://chromium-review.googlesource.com/1127303
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/RendererVk.cpp b/src/libANGLE/renderer/vulkan/RendererVk.cpp
index 14d422d..bc6db94 100644
--- a/src/libANGLE/renderer/vulkan/RendererVk.cpp
+++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp
@@ -459,6 +459,8 @@
ChoosePhysicalDevice(physicalDevices, enableMockICD, &mPhysicalDevice,
&mPhysicalDeviceProperties);
+ vkGetPhysicalDeviceFeatures(mPhysicalDevice, &mPhysicalDeviceFeatures);
+
// Ensure we can find a graphics queue family.
uint32_t queueCount = 0;
vkGetPhysicalDeviceQueueFamilyProperties(mPhysicalDevice, &queueCount, nullptr);
@@ -693,8 +695,8 @@
{
if (!mCapsInitialized)
{
- vk::GenerateCaps(mPhysicalDeviceProperties, mNativeTextureCaps, &mNativeCaps,
- &mNativeExtensions, &mNativeLimitations);
+ vk::GenerateCaps(mPhysicalDeviceProperties, mPhysicalDeviceFeatures, mNativeTextureCaps,
+ &mNativeCaps, &mNativeExtensions, &mNativeLimitations);
mCapsInitialized = true;
}
}
diff --git a/src/libANGLE/renderer/vulkan/RendererVk.h b/src/libANGLE/renderer/vulkan/RendererVk.h
index bddea83..58fe7ca 100644
--- a/src/libANGLE/renderer/vulkan/RendererVk.h
+++ b/src/libANGLE/renderer/vulkan/RendererVk.h
@@ -165,6 +165,7 @@
VkDebugReportCallbackEXT mDebugReportCallback;
VkPhysicalDevice mPhysicalDevice;
VkPhysicalDeviceProperties mPhysicalDeviceProperties;
+ VkPhysicalDeviceFeatures mPhysicalDeviceFeatures;
std::vector<VkQueueFamilyProperties> mQueueFamilyProperties;
VkQueue mQueue;
uint32_t mCurrentQueueFamilyIndex;
diff --git a/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp b/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp
index 0a05fba..d2b5ac9 100644
--- a/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp
+++ b/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp
@@ -30,6 +30,7 @@
{
void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties,
+ const VkPhysicalDeviceFeatures &physicalDeviceFeatures,
const gl::TextureCapsMap &textureCaps,
gl::Caps *outCaps,
gl::Extensions *outExtensions,
@@ -58,8 +59,10 @@
outCaps->minAliasedPointSize =
std::max(1.0f, physicalDeviceProperties.limits.pointSizeRange[0]);
outCaps->maxAliasedPointSize = physicalDeviceProperties.limits.pointSizeRange[1];
- outCaps->minAliasedLineWidth = physicalDeviceProperties.limits.lineWidthRange[0];
- outCaps->maxAliasedLineWidth = physicalDeviceProperties.limits.lineWidthRange[1];
+
+ outCaps->minAliasedLineWidth = 1.0f;
+ outCaps->maxAliasedLineWidth = 1.0f;
+
outCaps->maxDrawBuffers =
std::min<uint32_t>(physicalDeviceProperties.limits.maxColorAttachments,
physicalDeviceProperties.limits.maxFragmentOutputAttachments);
diff --git a/src/libANGLE/renderer/vulkan/vk_caps_utils.h b/src/libANGLE/renderer/vulkan/vk_caps_utils.h
index 6c35710..6555bfa 100644
--- a/src/libANGLE/renderer/vulkan/vk_caps_utils.h
+++ b/src/libANGLE/renderer/vulkan/vk_caps_utils.h
@@ -33,6 +33,7 @@
namespace vk
{
void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties,
+ const VkPhysicalDeviceFeatures &physicalDeviceFeatures,
const gl::TextureCapsMap &textureCaps,
gl::Caps *outCaps,
gl::Extensions *outExtensions,