Commit 56124e68 by Shahbaz Youssefi Committed by Commit Bot

Vulkan: remove dependency to inheritedQueries

If using vk::priv::SecondaryCommandBuffer. This would allow ES3 support where inheritedQueries is not supported. Bug: angleproject:3136 Change-Id: I10508058301ea6da8f3415cfdcc052500a67f810 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1538829 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarTobin Ehlis <tobine@google.com>
parent 705f480f
...@@ -320,7 +320,7 @@ angle::Result CommandGraphNode::beginOutsideRenderPassRecording(Context *context ...@@ -320,7 +320,7 @@ angle::Result CommandGraphNode::beginOutsideRenderPassRecording(Context *context
inheritanceInfo.subpass = 0; inheritanceInfo.subpass = 0;
inheritanceInfo.framebuffer = VK_NULL_HANDLE; inheritanceInfo.framebuffer = VK_NULL_HANDLE;
inheritanceInfo.occlusionQueryEnable = inheritanceInfo.occlusionQueryEnable =
context->getRenderer()->getPhysicalDeviceFeatures().inheritedQueries; CommandBuffer::SupportsQueries(context->getRenderer()->getPhysicalDeviceFeatures());
inheritanceInfo.queryFlags = 0; inheritanceInfo.queryFlags = 0;
inheritanceInfo.pipelineStatistics = 0; inheritanceInfo.pipelineStatistics = 0;
...@@ -348,7 +348,7 @@ angle::Result CommandGraphNode::beginInsideRenderPassRecording(Context *context, ...@@ -348,7 +348,7 @@ angle::Result CommandGraphNode::beginInsideRenderPassRecording(Context *context,
inheritanceInfo.subpass = 0; inheritanceInfo.subpass = 0;
inheritanceInfo.framebuffer = mRenderPassFramebuffer.getHandle(); inheritanceInfo.framebuffer = mRenderPassFramebuffer.getHandle();
inheritanceInfo.occlusionQueryEnable = inheritanceInfo.occlusionQueryEnable =
context->getRenderer()->getPhysicalDeviceFeatures().inheritedQueries; CommandBuffer::SupportsQueries(context->getRenderer()->getPhysicalDeviceFeatures());
inheritanceInfo.queryFlags = 0; inheritanceInfo.queryFlags = 0;
inheritanceInfo.pipelineStatistics = 0; inheritanceInfo.pipelineStatistics = 0;
......
...@@ -1141,8 +1141,8 @@ gl::Version RendererVk::getMaxSupportedESVersion() const ...@@ -1141,8 +1141,8 @@ gl::Version RendererVk::getMaxSupportedESVersion() const
maxVersion = gl::Version(2, 0); maxVersion = gl::Version(2, 0);
#endif #endif
// Vulkan inherited queries are required to support any GL query type // If the command buffer doesn't support queries, we can't support ES3.
if (!mPhysicalDeviceFeatures.inheritedQueries) if (!vk::CommandBuffer::SupportsQueries(mPhysicalDeviceFeatures))
{ {
maxVersion = std::max(maxVersion, gl::Version(2, 0)); maxVersion = std::max(maxVersion, gl::Version(2, 0));
} }
......
...@@ -328,6 +328,8 @@ class SecondaryCommandBuffer final : angle::NonCopyable ...@@ -328,6 +328,8 @@ class SecondaryCommandBuffer final : angle::NonCopyable
SecondaryCommandBuffer(); SecondaryCommandBuffer();
~SecondaryCommandBuffer(); ~SecondaryCommandBuffer();
static bool SupportsQueries(const VkPhysicalDeviceFeatures &features) { return true; }
// Add commands // Add commands
void beginQuery(VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); void beginQuery(VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags);
......
...@@ -68,7 +68,8 @@ void RendererVk::ensureCapsInitialized() const ...@@ -68,7 +68,8 @@ void RendererVk::ensureCapsInitialized() const
// We use secondary command buffers almost everywhere and they require a feature to be // We use secondary command buffers almost everywhere and they require a feature to be
// able to execute in the presence of queries. As a result, we won't support queries // able to execute in the presence of queries. As a result, we won't support queries
// unless that feature is available. // unless that feature is available.
mNativeExtensions.occlusionQueryBoolean = mPhysicalDeviceFeatures.inheritedQueries; mNativeExtensions.occlusionQueryBoolean =
vk::CommandBuffer::SupportsQueries(mPhysicalDeviceFeatures);
// From the Vulkan specs: // From the Vulkan specs:
// > The number of valid bits in a timestamp value is determined by the // > The number of valid bits in a timestamp value is determined by the
......
...@@ -172,6 +172,11 @@ class CommandBuffer : public WrappedObject<CommandBuffer, VkCommandBuffer> ...@@ -172,6 +172,11 @@ class CommandBuffer : public WrappedObject<CommandBuffer, VkCommandBuffer>
using WrappedObject::operator=; using WrappedObject::operator=;
static bool SupportsQueries(const VkPhysicalDeviceFeatures &features)
{
return features.inheritedQueries;
}
VkResult begin(const VkCommandBufferBeginInfo &info); VkResult begin(const VkCommandBufferBeginInfo &info);
void beginQuery(VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); void beginQuery(VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags);
......
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