Vulkan: Move Feature init before device creation.
We were previously creating our device *before* initializing the
FeaturesVk fields. This means we weren't requesting the MAINTENANCE1
extension correctly. Moving feature init before the first createDevice
call fixes the ordering issue.
This unblocks the viewport flip behaviour fixes.
Bug: angleproject:2673
Change-Id: Iae6973b57bcb4da78134a17b0644cd248bfb4981
Reviewed-on: https://chromium-review.googlesource.com/1133920
Reviewed-by: Luc Ferron <lucferron@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 2e7d7d6..a9b2b1e 100644
--- a/src/libANGLE/renderer/vulkan/RendererVk.cpp
+++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp
@@ -454,6 +454,8 @@
ANGLE_VK_CHECK(graphicsQueueFamilyCount > 0, VK_ERROR_INITIALIZATION_FAILED);
+ initFeatures();
+
// If only one queue family, go ahead and initialize the device. If there is more than one
// queue, we'll have to wait until we see a WindowSurface to know which supports present.
if (graphicsQueueFamilyCount == 1)
@@ -638,12 +640,23 @@
return strstr.str();
}
+void RendererVk::initFeatures()
+{
+ // Use OpenGL line rasterization rules by default.
+ mFeatures.basicGLLineRasterization = true;
+
+ // For now, set this manually to true to enable viewport flipping. A couple of features are not
+ // working well like copyTexImage, copySubTexImage, blit, and probably some more. Until
+ // everything is fixed, we will keep the viewport flipping feature disabled.
+ mFeatures.flipViewportY = false;
+}
+
void RendererVk::ensureCapsInitialized() const
{
if (!mCapsInitialized)
{
vk::GenerateCaps(mPhysicalDeviceProperties, mNativeTextureCaps, &mNativeCaps,
- &mNativeExtensions, &mNativeLimitations, &mFeatures);
+ &mNativeExtensions, &mNativeLimitations);
mCapsInitialized = true;
}
}