Commit 12222070 by Jamie Madill Committed by Commit Bot

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/1133920Reviewed-by: 's avatarLuc Ferron <lucferron@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent dec86230
...@@ -454,6 +454,8 @@ vk::Error RendererVk::initialize(const egl::AttributeMap &attribs, const char *w ...@@ -454,6 +454,8 @@ vk::Error RendererVk::initialize(const egl::AttributeMap &attribs, const char *w
ANGLE_VK_CHECK(graphicsQueueFamilyCount > 0, VK_ERROR_INITIALIZATION_FAILED); 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 // 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. // queue, we'll have to wait until we see a WindowSurface to know which supports present.
if (graphicsQueueFamilyCount == 1) if (graphicsQueueFamilyCount == 1)
...@@ -638,12 +640,23 @@ std::string RendererVk::getRendererDescription() const ...@@ -638,12 +640,23 @@ std::string RendererVk::getRendererDescription() const
return strstr.str(); 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 void RendererVk::ensureCapsInitialized() const
{ {
if (!mCapsInitialized) if (!mCapsInitialized)
{ {
vk::GenerateCaps(mPhysicalDeviceProperties, mNativeTextureCaps, &mNativeCaps, vk::GenerateCaps(mPhysicalDeviceProperties, mNativeTextureCaps, &mNativeCaps,
&mNativeExtensions, &mNativeLimitations, &mFeatures); &mNativeExtensions, &mNativeLimitations);
mCapsInitialized = true; mCapsInitialized = true;
} }
} }
......
...@@ -148,6 +148,7 @@ class RendererVk : angle::NonCopyable ...@@ -148,6 +148,7 @@ class RendererVk : angle::NonCopyable
vk::Error checkInFlightCommands(); vk::Error checkInFlightCommands();
void freeAllInFlightResources(); void freeAllInFlightResources();
vk::Error flushCommandGraph(const gl::Context *context, vk::CommandBuffer *commandBatch); vk::Error flushCommandGraph(const gl::Context *context, vk::CommandBuffer *commandBatch);
void initFeatures();
mutable bool mCapsInitialized; mutable bool mCapsInitialized;
mutable gl::Caps mNativeCaps; mutable gl::Caps mNativeCaps;
......
...@@ -33,8 +33,7 @@ void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties, ...@@ -33,8 +33,7 @@ void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties,
const gl::TextureCapsMap &textureCaps, const gl::TextureCapsMap &textureCaps,
gl::Caps *outCaps, gl::Caps *outCaps,
gl::Extensions *outExtensions, gl::Extensions *outExtensions,
gl::Limitations * /* outLimitations */, gl::Limitations * /* outLimitations */)
FeaturesVk *features)
{ {
outExtensions->setTextureExtensionSupport(textureCaps); outExtensions->setTextureExtensionSupport(textureCaps);
...@@ -145,14 +144,6 @@ void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties, ...@@ -145,14 +144,6 @@ void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties,
outCaps->maxVaryingVectors = outCaps->maxVaryingVectors =
(physicalDeviceProperties.limits.maxVertexOutputComponents / 4) - kReservedVaryingCount; (physicalDeviceProperties.limits.maxVertexOutputComponents / 4) - kReservedVaryingCount;
outCaps->maxVertexOutputComponents = outCaps->maxVaryingVectors * 4; outCaps->maxVertexOutputComponents = outCaps->maxVaryingVectors * 4;
// Use OpenGL line rasterization rules by default.
features->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.
features->flipViewportY = false;
} }
} // namespace vk } // namespace vk
......
...@@ -36,8 +36,7 @@ void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties, ...@@ -36,8 +36,7 @@ void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties,
const gl::TextureCapsMap &textureCaps, const gl::TextureCapsMap &textureCaps,
gl::Caps *outCaps, gl::Caps *outCaps,
gl::Extensions *outExtensions, gl::Extensions *outExtensions,
gl::Limitations * /* outLimitations */, gl::Limitations * /* outLimitations */);
FeaturesVk *features);
} // namespace vk } // namespace vk
namespace egl_vk namespace egl_vk
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment