diff options
author | android-autoroll <android-autoroll@skia-public.iam.gserviceaccount.com> | 2024-04-29 23:42:17 +0000 |
---|---|---|
committer | android-autoroll <android-autoroll@skia-public.iam.gserviceaccount.com> | 2024-04-29 23:42:17 +0000 |
commit | ed1ec6b274859128ace390d9667b7cfbe50d24e5 (patch) | |
tree | ac23c8c19a37dd6fdba4b2fa53ded709170cbfaa | |
parent | 1db21666b6905e95392de6a45395cdd2c7512089 (diff) | |
parent | b839e05ba7e3775b3e501a15d2414e676b87191d (diff) | |
download | angle-ed1ec6b274859128ace390d9667b7cfbe50d24e5.tar.gz |
Roll ANGLE from f51f2bc55b1f to b839e05ba7e3 (3 revisions)
https://chromium.googlesource.com/angle/angle.git/+log/f51f2bc55b1f..b839e05ba7e3
Please enable autosubmit on changes if possible when approving them.
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-android-autoroll
Please CC angle-team@google.com,cnorthrop@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.
To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Test: Presubmit checks will test this change.
Exempt-From-Owner-Approval: The autoroll bot does not require owner approval.
Bug: b/336844257
Change-Id: I72ab4c345fc35eb0da1d1f5cb2df40455b0b0b7a
-rw-r--r-- | include/platform/autogen/FeaturesVk_autogen.h | 7 | ||||
-rw-r--r-- | include/platform/vk_features.json | 10 | ||||
-rw-r--r-- | src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.cpp | 49 | ||||
-rw-r--r-- | src/libANGLE/renderer/vulkan/vk_helpers.h | 212 | ||||
-rw-r--r-- | src/libANGLE/renderer/vulkan/vk_renderer.cpp | 4 | ||||
-rw-r--r-- | util/autogen/angle_features_autogen.cpp | 1 | ||||
-rw-r--r-- | util/autogen/angle_features_autogen.h | 1 |
7 files changed, 150 insertions, 134 deletions
diff --git a/include/platform/autogen/FeaturesVk_autogen.h b/include/platform/autogen/FeaturesVk_autogen.h index b43a1afc70..896fa7435e 100644 --- a/include/platform/autogen/FeaturesVk_autogen.h +++ b/include/platform/autogen/FeaturesVk_autogen.h @@ -1424,6 +1424,13 @@ struct FeaturesVk : FeatureSetBase &members, "http://anglebug.com/8676" }; + FeatureInfo useVkEventForImageBarrier = { + "useVkEventForImageBarrier", + FeatureCategory::VulkanFeatures, + "Uses VkEvent instead of VkCmdPipelineBarrier for image barriers", + &members, "https://issuetracker.google.com/336844257" + }; + }; inline FeaturesVk::FeaturesVk() = default; diff --git a/include/platform/vk_features.json b/include/platform/vk_features.json index 0a0de11ab6..a915735d87 100644 --- a/include/platform/vk_features.json +++ b/include/platform/vk_features.json @@ -1554,6 +1554,14 @@ "VkDevice supports the VK_KHR_16bit_storage extension and has the storageInputOutput16 feature" ], "issue": "http://anglebug.com/8676" + }, + { + "name": "use_vkEvent_for_image_barrier", + "category": "Features", + "description": [ + "Uses VkEvent instead of VkCmdPipelineBarrier for image barriers" + ], + "issue": "https://issuetracker.google.com/336844257" } ] -}
\ No newline at end of file +} diff --git a/src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.cpp b/src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.cpp index 622566d542..8835dc311f 100644 --- a/src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.cpp +++ b/src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.cpp @@ -80,33 +80,28 @@ void InitBuiltInAtanFunctionEmulatorForGLSLWorkarounds(BuiltInFunctionEmulator * " else if (x < 0.0 && y < 0.0) return atan(y / x) - 3.14159265;\n" " else return 1.57079632 * sign(y);\n" "}\n"); - static const std::array<TSymbolUniqueId, 4> ids = { - BuiltInId::atan_Float1_Float1, - BuiltInId::atan_Float2_Float2, - BuiltInId::atan_Float3_Float3, - BuiltInId::atan_Float4_Float4, - }; - for (int dim = 2; dim <= 4; ++dim) - { - std::stringstream ss = sh::InitializeStream<std::stringstream>(); - ss << "emu_precision vec" << dim << " atan_emu(emu_precision vec" << dim - << " y, emu_precision vec" << dim << " x)\n" - << "{\n" - " return vec" - << dim << "("; - for (int i = 0; i < dim; ++i) - { - ss << "atan_emu(y[" << i << "], x[" << i << "])"; - if (i < dim - 1) - { - ss << ", "; - } - } - ss << ");\n" - "}\n"; - emu->addEmulatedFunctionWithDependency(BuiltInId::atan_Float1_Float1, ids[dim - 1], - ss.str().c_str()); - } + + emu->addEmulatedFunctionWithDependency( + BuiltInId::atan_Float1_Float1, BuiltInId::atan_Float2_Float2, + "emu_precision vec2 atan_emu(emu_precision vec2 y, emu_precision vec2 x)\n" + "{\n" + " return vec2(atan_emu(y[0], x[0]), atan_emu(y[1], x[1]));\n" + "}\n"); + + emu->addEmulatedFunctionWithDependency( + BuiltInId::atan_Float1_Float1, BuiltInId::atan_Float3_Float3, + "emu_precision vec3 atan_emu(emu_precision vec3 y, emu_precision vec3 x)\n" + "{\n" + " return vec3(atan_emu(y[0], x[0]), atan_emu(y[1], x[1]), atan_emu(y[2], x[2]));\n" + "}\n"); + + emu->addEmulatedFunctionWithDependency( + BuiltInId::atan_Float1_Float1, BuiltInId::atan_Float4_Float4, + "emu_precision vec4 atan_emu(emu_precision vec4 y, emu_precision vec4 x)\n" + "{\n" + " return vec4(atan_emu(y[0], x[0]), atan_emu(y[1], x[1]), atan_emu(y[2], x[2]), " + "atan_emu(y[3], x[3]))\n;" + "}\n"); } // Emulate built-in functions missing from GLSL 1.30 and higher diff --git a/src/libANGLE/renderer/vulkan/vk_helpers.h b/src/libANGLE/renderer/vulkan/vk_helpers.h index 7a4c4466a4..d173a106e1 100644 --- a/src/libANGLE/renderer/vulkan/vk_helpers.h +++ b/src/libANGLE/renderer/vulkan/vk_helpers.h @@ -61,6 +61,112 @@ using ImageLayerWriteMask = std::bitset<kMaxParallelLayerWrites using StagingBufferOffsetArray = std::array<VkDeviceSize, 2>; +// Imagine an image going through a few layout transitions: +// +// srcStage 1 dstStage 2 srcStage 2 dstStage 3 +// Layout 1 ------Transition 1-----> Layout 2 ------Transition 2------> Layout 3 +// srcAccess 1 dstAccess 2 srcAccess 2 dstAccess 3 +// \_________________ ___________________/ +// \/ +// A transition +// +// Every transition requires 6 pieces of information: from/to layouts, src/dst stage masks and +// src/dst access masks. At the moment we decide to transition the image to Layout 2 (i.e. +// Transition 1), we need to have Layout 1, srcStage 1 and srcAccess 1 stored as history of the +// image. To perform the transition, we need to know Layout 2, dstStage 2 and dstAccess 2. +// Additionally, we need to know srcStage 2 and srcAccess 2 to retain them for the next transition. +// +// That is, with the history kept, on every new transition we need 5 pieces of new information: +// layout/dstStage/dstAccess to transition into the layout, and srcStage/srcAccess for the future +// transition out from it. Given the small number of possible combinations of these values, an +// enum is used were each value encapsulates these 5 pieces of information: +// +// +--------------------------------+ +// srcStage 1 | dstStage 2 srcStage 2 | dstStage 3 +// Layout 1 ------Transition 1-----> Layout 2 ------Transition 2------> Layout 3 +// srcAccess 1 |dstAccess 2 srcAccess 2| dstAccess 3 +// +--------------- ---------------+ +// \/ +// One enum value +// +// Note that, while generally dstStage for the to-transition and srcStage for the from-transition +// are the same, they may occasionally be BOTTOM_OF_PIPE and TOP_OF_PIPE respectively. +enum class ImageLayout +{ + Undefined = 0, + // Framebuffer attachment layouts are placed first, so they can fit in fewer bits in + // PackedAttachmentOpsDesc. + + // Color (Write): + ColorWrite, + MSRTTEmulationColorUnresolveAndResolve, + + // Depth (Write), Stencil (Write) + DepthWriteStencilWrite, + + // Depth (Write), Stencil (Read) + DepthWriteStencilRead, + DepthWriteStencilReadFragmentShaderStencilRead, + DepthWriteStencilReadAllShadersStencilRead, + + // Depth (Read), Stencil (Write) + DepthReadStencilWrite, + DepthReadStencilWriteFragmentShaderDepthRead, + DepthReadStencilWriteAllShadersDepthRead, + + // Depth (Read), Stencil (Read) + DepthReadStencilRead, + DepthReadStencilReadFragmentShaderRead, + DepthReadStencilReadAllShadersRead, + + // The GENERAL layout is used when there's a feedback loop. For depth/stencil it does't matter + // which aspect is participating in feedback and whether the other aspect is read-only. + ColorWriteFragmentShaderFeedback, + ColorWriteAllShadersFeedback, + DepthStencilFragmentShaderFeedback, + DepthStencilAllShadersFeedback, + + // Depth/stencil resolve is special because it uses the _color_ output stage and mask + DepthStencilResolve, + MSRTTEmulationDepthStencilUnresolveAndResolve, + + Present, + SharedPresent, + // The rest of the layouts. + ExternalPreInitialized, + ExternalShadersReadOnly, + ExternalShadersWrite, + TransferSrc, + TransferDst, + TransferSrcDst, + // Used when the image is transitioned on the host for use by host image copy + HostCopy, + VertexShaderReadOnly, + VertexShaderWrite, + // PreFragment == Vertex, Tessellation and Geometry stages + PreFragmentShadersReadOnly, + PreFragmentShadersWrite, + FragmentShadingRateAttachmentReadOnly, + FragmentShaderReadOnly, + FragmentShaderWrite, + ComputeShaderReadOnly, + ComputeShaderWrite, + AllGraphicsShadersReadOnly, + AllGraphicsShadersWrite, + TransferDstAndComputeWrite, + + InvalidEnum, + EnumCount = InvalidEnum, +}; + +VkImageCreateFlags GetImageCreateFlags(gl::TextureType textureType); + +ImageLayout GetImageLayoutFromGLImageLayout(Context *context, GLenum layout); + +GLenum ConvertImageLayoutToGLImageLayout(ImageLayout imageLayout); + +VkImageLayout ConvertImageLayoutToVkImageLayout(Context *context, ImageLayout imageLayout); + // A dynamic buffer is conceptually an infinitely long buffer. Each time you write to the buffer, // you will always write to a previously unused portion. After a series of writes, you must flush // the buffer data to the device. Buffer lifetime currently assumes that each new allocation will @@ -1799,112 +1905,6 @@ class CommandBufferRecycler std::vector<CommandBufferHelperT *> mCommandBufferHelperFreeList; }; -// Imagine an image going through a few layout transitions: -// -// srcStage 1 dstStage 2 srcStage 2 dstStage 3 -// Layout 1 ------Transition 1-----> Layout 2 ------Transition 2------> Layout 3 -// srcAccess 1 dstAccess 2 srcAccess 2 dstAccess 3 -// \_________________ ___________________/ -// \/ -// A transition -// -// Every transition requires 6 pieces of information: from/to layouts, src/dst stage masks and -// src/dst access masks. At the moment we decide to transition the image to Layout 2 (i.e. -// Transition 1), we need to have Layout 1, srcStage 1 and srcAccess 1 stored as history of the -// image. To perform the transition, we need to know Layout 2, dstStage 2 and dstAccess 2. -// Additionally, we need to know srcStage 2 and srcAccess 2 to retain them for the next transition. -// -// That is, with the history kept, on every new transition we need 5 pieces of new information: -// layout/dstStage/dstAccess to transition into the layout, and srcStage/srcAccess for the future -// transition out from it. Given the small number of possible combinations of these values, an -// enum is used were each value encapsulates these 5 pieces of information: -// -// +--------------------------------+ -// srcStage 1 | dstStage 2 srcStage 2 | dstStage 3 -// Layout 1 ------Transition 1-----> Layout 2 ------Transition 2------> Layout 3 -// srcAccess 1 |dstAccess 2 srcAccess 2| dstAccess 3 -// +--------------- ---------------+ -// \/ -// One enum value -// -// Note that, while generally dstStage for the to-transition and srcStage for the from-transition -// are the same, they may occasionally be BOTTOM_OF_PIPE and TOP_OF_PIPE respectively. -enum class ImageLayout -{ - Undefined = 0, - // Framebuffer attachment layouts are placed first, so they can fit in fewer bits in - // PackedAttachmentOpsDesc. - - // Color (Write): - ColorWrite, - MSRTTEmulationColorUnresolveAndResolve, - - // Depth (Write), Stencil (Write) - DepthWriteStencilWrite, - - // Depth (Write), Stencil (Read) - DepthWriteStencilRead, - DepthWriteStencilReadFragmentShaderStencilRead, - DepthWriteStencilReadAllShadersStencilRead, - - // Depth (Read), Stencil (Write) - DepthReadStencilWrite, - DepthReadStencilWriteFragmentShaderDepthRead, - DepthReadStencilWriteAllShadersDepthRead, - - // Depth (Read), Stencil (Read) - DepthReadStencilRead, - DepthReadStencilReadFragmentShaderRead, - DepthReadStencilReadAllShadersRead, - - // The GENERAL layout is used when there's a feedback loop. For depth/stencil it does't matter - // which aspect is participating in feedback and whether the other aspect is read-only. - ColorWriteFragmentShaderFeedback, - ColorWriteAllShadersFeedback, - DepthStencilFragmentShaderFeedback, - DepthStencilAllShadersFeedback, - - // Depth/stencil resolve is special because it uses the _color_ output stage and mask - DepthStencilResolve, - MSRTTEmulationDepthStencilUnresolveAndResolve, - - Present, - SharedPresent, - // The rest of the layouts. - ExternalPreInitialized, - ExternalShadersReadOnly, - ExternalShadersWrite, - TransferSrc, - TransferDst, - TransferSrcDst, - // Used when the image is transitioned on the host for use by host image copy - HostCopy, - VertexShaderReadOnly, - VertexShaderWrite, - // PreFragment == Vertex, Tessellation and Geometry stages - PreFragmentShadersReadOnly, - PreFragmentShadersWrite, - FragmentShadingRateAttachmentReadOnly, - FragmentShaderReadOnly, - FragmentShaderWrite, - ComputeShaderReadOnly, - ComputeShaderWrite, - AllGraphicsShadersReadOnly, - AllGraphicsShadersWrite, - TransferDstAndComputeWrite, - - InvalidEnum, - EnumCount = InvalidEnum, -}; - -VkImageCreateFlags GetImageCreateFlags(gl::TextureType textureType); - -ImageLayout GetImageLayoutFromGLImageLayout(Context *context, GLenum layout); - -GLenum ConvertImageLayoutToGLImageLayout(ImageLayout imageLayout); - -VkImageLayout ConvertImageLayoutToVkImageLayout(Context *context, ImageLayout imageLayout); - // The source of update to an ImageHelper enum class UpdateSource { diff --git a/src/libANGLE/renderer/vulkan/vk_renderer.cpp b/src/libANGLE/renderer/vulkan/vk_renderer.cpp index d6b224e82a..6ab2a187e9 100644 --- a/src/libANGLE/renderer/vulkan/vk_renderer.cpp +++ b/src/libANGLE/renderer/vulkan/vk_renderer.cpp @@ -5057,6 +5057,10 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, ANGLE_FEATURE_CONDITION(&mFeatures, supportsExternalFormatResolve, false); #endif + // Disable use of VkCmdWaitEvent for image barriers for now. + // https://issuetracker.google.com/336844257 + ANGLE_FEATURE_CONDITION(&mFeatures, useVkEventForImageBarrier, false); + // Disable memory report feature overrides if extension is not supported. if ((mFeatures.logMemoryReportCallbacks.enabled || mFeatures.logMemoryReportStats.enabled) && !mMemoryReportFeatures.deviceMemoryReport) diff --git a/util/autogen/angle_features_autogen.cpp b/util/autogen/angle_features_autogen.cpp index ec503e9fc1..173269fbbb 100644 --- a/util/autogen/angle_features_autogen.cpp +++ b/util/autogen/angle_features_autogen.cpp @@ -405,6 +405,7 @@ constexpr PackedEnumMap<Feature, const char *> kFeatureNames = {{ {Feature::UseSystemMemoryForConstantBuffers, "useSystemMemoryForConstantBuffers"}, {Feature::UseUnusedBlocksWithStandardOrSharedLayout, "useUnusedBlocksWithStandardOrSharedLayout"}, {Feature::UseVertexInputBindingStrideDynamicState, "useVertexInputBindingStrideDynamicState"}, + {Feature::UseVkEventForImageBarrier, "useVkEventForImageBarrier"}, {Feature::UseVmaForImageSuballocation, "useVmaForImageSuballocation"}, {Feature::VaryingsRequireMatchingPrecisionInSpirv, "varyingsRequireMatchingPrecisionInSpirv"}, {Feature::VertexIDDoesNotIncludeBaseVertex, "vertexIDDoesNotIncludeBaseVertex"}, diff --git a/util/autogen/angle_features_autogen.h b/util/autogen/angle_features_autogen.h index 9b57149f74..ec9ac8e00b 100644 --- a/util/autogen/angle_features_autogen.h +++ b/util/autogen/angle_features_autogen.h @@ -405,6 +405,7 @@ enum class Feature UseSystemMemoryForConstantBuffers, UseUnusedBlocksWithStandardOrSharedLayout, UseVertexInputBindingStrideDynamicState, + UseVkEventForImageBarrier, UseVmaForImageSuballocation, VaryingsRequireMatchingPrecisionInSpirv, VertexIDDoesNotIncludeBaseVertex, |