Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8d412db

Browse files
null77Commit Bot
authored andcommitted
Revert "Convert unordered_map to absl::flat_hash_map for select files"
This reverts commit 1acaf4e. Reason for revert: Fails when is_component_build is not set: lld-link: error: <root>: undefined symbol: public: __cdecl absl::Condition::Condition<struct std::__1::atomic<bool> const>(bool (__cdecl *)(struct std::__1::atomic<bool> const *), struct std::__1::atomic<bool> const *) <snip> Original change's description: > Convert unordered_map to absl::flat_hash_map for select files > > This is the initial CL to start migrating to abseil in various places: > - formatutils.h > - FramebufferVk.h > - Program.h > - ProgramExecutableVk.h > - RewriteRowMajorMatrices.cpp > > This intentionally hits a couple different places in the code to make > sure the abseil dependencies are added to the required targets. > > Bug: angleproject:4873 > Change-Id: I68c7d067b6912b0cc0ecde231501dbed92f0b189 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2321735 > Commit-Queue: Tim Van Patten <[email protected]> > Reviewed-by: Jamie Madill <[email protected]> > Reviewed-by: Charlie Lao <[email protected]> [email protected],[email protected],[email protected] Change-Id: I75041532fc5126b4c7cc5e0d4529883fb357e05b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:4873 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2383870 Reviewed-by: Jamie Madill <[email protected]> Commit-Queue: Jamie Madill <[email protected]>
1 parent f71283c commit 8d412db

File tree

9 files changed

+16
-55
lines changed

9 files changed

+16
-55
lines changed

BUILD.gn

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,7 @@ config("includes_config") {
221221

222222
angle_source_set("includes") {
223223
sources = libangle_includes
224-
public_configs = [
225-
":angle_abseil_config",
226-
":includes_config",
227-
]
224+
public_configs = [ ":includes_config" ]
228225
}
229226

230227
angle_static_library("preprocessor") {
@@ -464,7 +461,6 @@ angle_static_library("translator") {
464461
public_configs += [ ":external_config" ]
465462

466463
deps = [
467-
":angle_abseil",
468464
":includes",
469465
":preprocessor",
470466
]
@@ -596,7 +592,6 @@ config("libANGLE_config") {
596592

597593
angle_source_set("libANGLE_headers") {
598594
sources = libangle_headers
599-
deps = [ ":angle_abseil" ]
600595
public_deps = [
601596
":angle_common",
602597
":angle_translator_headers",
@@ -612,7 +607,6 @@ if (angle_enable_vulkan || angle_enable_metal) {
612607
"src/libANGLE/renderer/glslang_wrapper_utils.h",
613608
]
614609
deps = [
615-
":angle_abseil",
616610
":libANGLE_headers",
617611
"${angle_glslang_dir}:glslang_default_resource_limits_sources",
618612
"${angle_glslang_dir}:glslang_lib_sources",
@@ -640,7 +634,6 @@ angle_source_set("libANGLE_base") {
640634
":translator",
641635
]
642636
deps = [
643-
":angle_abseil",
644637
":angle_compression",
645638
":angle_image_util",
646639
":includes",
@@ -786,7 +779,7 @@ angle_source_set("libANGLE") {
786779
sources = [ "src/libANGLE/FrameCapture_mock.cpp" ]
787780

788781
# gl_enum_utils defaults included in with_capture build
789-
deps = [ ":angle_abseil" ]
782+
deps = []
790783
if (angle_enable_trace || is_debug) {
791784
deps += [ ":angle_gl_enum_utils" ]
792785
}
@@ -800,25 +793,6 @@ angle_source_set("angle_gl_enum_utils") {
800793
]
801794
}
802795

803-
config("angle_abseil_config") {
804-
configs = [
805-
"//third_party/abseil-cpp:absl_define_config",
806-
"//third_party/abseil-cpp:absl_include_config",
807-
]
808-
}
809-
810-
group("angle_abseil") {
811-
# When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while
812-
# we can be more specific when building standalone ANGLE.
813-
if (build_with_chromium) {
814-
public_deps = [ "//third_party/abseil-cpp:absl" ]
815-
} else {
816-
public_deps = [ "//third_party/abseil-cpp/absl/container:flat_hash_map" ]
817-
}
818-
819-
public_configs = [ ":angle_abseil_config" ]
820-
}
821-
822796
config("angle_compression_config") {
823797
include_dirs = [ "//third_party/zlib/google" ]
824798
}

scripts/export_targets.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ def pre(k):
180180
# #includes in #ifdefs properly, so they will erroneously be marked as being
181181
# included, but not part of the source list.
182182
IGNORED_INCLUDES = {
183-
b'absl/container/flat_hash_map.h',
184183
b'compiler/translator/TranslatorESSL.h',
185184
b'compiler/translator/TranslatorGLSL.h',
186185
b'compiler/translator/TranslatorHLSL.h',
@@ -225,7 +224,6 @@ def pre(k):
225224
}
226225

227226
IGNORED_DIRECTORIES = {
228-
'//third_party/abseil-cpp',
229227
'//third_party/SwiftShader',
230228
'//third_party/vulkan-headers',
231229
'//third_party/vulkan-loader',

src/compiler/translator/tree_ops/RewriteRowMajorMatrices.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
#include "compiler/translator/tree_ops/RewriteRowMajorMatrices.h"
1010

11-
#include "absl/container/flat_hash_map.h"
12-
1311
#include "compiler/translator/Compiler.h"
1412
#include "compiler/translator/ImmutableStringBuilder.h"
1513
#include "compiler/translator/StaticType.h"
@@ -187,7 +185,7 @@ TOperator GetIndexOp(TIntermNode *node)
187185
}
188186

189187
bool IsConvertedField(TIntermTyped *indexNode,
190-
const absl::flat_hash_map<const TField *, bool> &convertedFields)
188+
const std::unordered_map<const TField *, bool> &convertedFields)
191189
{
192190
TIntermBinary *asBinary = indexNode->getAsBinaryNode();
193191
if (asBinary == nullptr)
@@ -534,9 +532,9 @@ class RewriteRowMajorMatricesTraverser : public TIntermTraverser
534532
TIntermSequence *getStructCopyFunctions() { return &mOuterPass.copyFunctionDefinitions; }
535533

536534
private:
537-
using StructMap = absl::flat_hash_map<const TStructure *, StructConversionData>;
538-
using InterfaceBlockMap = absl::flat_hash_map<const TVariable *, TVariable *>;
539-
using InterfaceBlockFieldConverted = absl::flat_hash_map<const TField *, bool>;
535+
typedef std::unordered_map<const TStructure *, StructConversionData> StructMap;
536+
typedef std::unordered_map<const TVariable *, TVariable *> InterfaceBlockMap;
537+
typedef std::unordered_map<const TField *, bool> InterfaceBlockFieldConverted;
540538

541539
RewriteRowMajorMatricesTraverser(
542540
TSymbolTable *symbolTable,

src/libANGLE/Program.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
#include <string>
2121
#include <vector>
2222

23-
#include "absl/container/flat_hash_map.h"
24-
2523
#include "common/Optional.h"
2624
#include "common/angleutils.h"
2725
#include "common/mathutil.h"
@@ -174,12 +172,12 @@ class ProgramBindings final : angle::NonCopyable
174172
int getBindingByName(const std::string &name) const;
175173
int getBinding(const sh::ShaderVariable &variable) const;
176174

177-
using const_iterator = absl::flat_hash_map<std::string, GLuint>::const_iterator;
175+
using const_iterator = std::unordered_map<std::string, GLuint>::const_iterator;
178176
const_iterator begin() const;
179177
const_iterator end() const;
180178

181179
private:
182-
absl::flat_hash_map<std::string, GLuint> mBindings;
180+
std::unordered_map<std::string, GLuint> mBindings;
183181
};
184182

185183
// Uniforms and Fragment Outputs require special treatment due to array notation (e.g., "[0]")

src/libANGLE/formatutils.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#include <cstddef>
1414
#include <ostream>
1515

16-
#include "absl/container/flat_hash_map.h"
17-
1816
#include "angle_gl.h"
1917
#include "common/android_util.h"
2018
#include "libANGLE/Caps.h"
@@ -276,7 +274,7 @@ void MaybeOverrideLuminance(GLenum &format, GLenum &type, GLenum actualFormat, G
276274
typedef std::set<GLenum> FormatSet;
277275
const FormatSet &GetAllSizedInternalFormats();
278276

279-
typedef absl::flat_hash_map<GLenum, absl::flat_hash_map<GLenum, InternalFormat>>
277+
typedef std::unordered_map<GLenum, std::unordered_map<GLenum, InternalFormat>>
280278
InternalFormatInfoMap;
281279
const InternalFormatInfoMap &GetInternalFormatMap();
282280

src/libANGLE/renderer/vulkan/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ angle_source_set("angle_vulkan_backend") {
195195
libs = []
196196
deps = [
197197
":angle_vk_mem_alloc_wrapper",
198-
"$angle_root:angle_abseil",
199198
"$angle_root:angle_compression",
200199
"$angle_root:angle_gpu_info_util",
201200
"$angle_root:angle_image_util",

src/libANGLE/renderer/vulkan/FramebufferVk.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#ifndef LIBANGLE_RENDERER_VULKAN_FRAMEBUFFERVK_H_
1111
#define LIBANGLE_RENDERER_VULKAN_FRAMEBUFFERVK_H_
1212

13-
#include "absl/container/flat_hash_map.h"
14-
1513
#include "libANGLE/renderer/FramebufferImpl.h"
1614
#include "libANGLE/renderer/RenderTargetCache.h"
1715
#include "libANGLE/renderer/vulkan/BufferVk.h"
@@ -257,7 +255,7 @@ class FramebufferVk : public FramebufferImpl
257255
gl::DrawBufferMask mEmulatedAlphaAttachmentMask;
258256

259257
vk::FramebufferDesc mCurrentFramebufferDesc;
260-
absl::flat_hash_map<vk::FramebufferDesc, vk::FramebufferHelper> mFramebufferCache;
258+
std::unordered_map<vk::FramebufferDesc, vk::FramebufferHelper> mFramebufferCache;
261259

262260
vk::ClearValuesArray mDeferredClears;
263261
};

src/libANGLE/renderer/vulkan/ProgramExecutableVk.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#ifndef LIBANGLE_RENDERER_VULKAN_PROGRAMEXECUTABLEVK_H_
1111
#define LIBANGLE_RENDERER_VULKAN_PROGRAMEXECUTABLEVK_H_
1212

13-
#include "absl/container/flat_hash_map.h"
14-
1513
#include "common/bitset_utils.h"
1614
#include "common/utilities.h"
1715
#include "libANGLE/Context.h"
@@ -226,8 +224,8 @@ class ProgramExecutableVk
226224
size_t mNumDefaultUniformDescriptors;
227225
vk::BufferSerial mCurrentDefaultUniformBufferSerial;
228226

229-
absl::flat_hash_map<vk::UniformsAndXfbDesc, VkDescriptorSet> mUniformsAndXfbDescriptorSetCache;
230-
absl::flat_hash_map<vk::TextureDescriptorDesc, VkDescriptorSet> mTextureDescriptorsCache;
227+
std::unordered_map<vk::UniformsAndXfbDesc, VkDescriptorSet> mUniformsAndXfbDescriptorSetCache;
228+
std::unordered_map<vk::TextureDescriptorDesc, VkDescriptorSet> mTextureDescriptorsCache;
231229

232230
// We keep a reference to the pipeline and descriptor set layouts. This ensures they don't get
233231
// deleted while this program is in use.

src/libGLESv2.gni

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,13 @@ libangle_headers = [
238238
"src/libANGLE/MemoryObject.h",
239239
"src/libANGLE/MemoryProgramCache.h",
240240
"src/libANGLE/Observer.h",
241+
"src/libANGLE/Overlay.cpp",
241242
"src/libANGLE/Overlay.h",
243+
"src/libANGLE/OverlayWidgets.cpp",
242244
"src/libANGLE/OverlayWidgets.h",
245+
"src/libANGLE/Overlay_autogen.cpp",
243246
"src/libANGLE/Overlay_autogen.h",
247+
"src/libANGLE/Overlay_font_autogen.cpp",
244248
"src/libANGLE/Overlay_font_autogen.h",
245249
"src/libANGLE/Program.h",
246250
"src/libANGLE/ProgramExecutable.h",
@@ -379,10 +383,6 @@ libangle_sources = [
379383
"src/libANGLE/MemoryObject.cpp",
380384
"src/libANGLE/MemoryProgramCache.cpp",
381385
"src/libANGLE/Observer.cpp",
382-
"src/libANGLE/Overlay.cpp",
383-
"src/libANGLE/OverlayWidgets.cpp",
384-
"src/libANGLE/Overlay_autogen.cpp",
385-
"src/libANGLE/Overlay_font_autogen.cpp",
386386
"src/libANGLE/Platform.cpp",
387387
"src/libANGLE/Program.cpp",
388388
"src/libANGLE/ProgramExecutable.cpp",

0 commit comments

Comments
 (0)