Merge pull request #106434 from Ivorforce/invert-hashfuncs

Reduce cross project includes by rewriting `HashMapHasherDefault`.
This commit is contained in:
Thaddeus Crews
2025-10-06 09:06:37 -05:00
29 changed files with 253 additions and 222 deletions

View File

@ -33,6 +33,8 @@
#include "core/templates/hash_map.h"
#include "core/templates/local_vector.h"
#include <iterator>
/// An unordered map that splits elements between a fast-access vector of LinearCount consecutively
/// indexed elements, and a slower-access map holding sparse indexes larger than LinearCount.
///

View File

@ -196,7 +196,7 @@ public:
class API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0)) MDResourceCache {
private:
typedef HashMap<ClearAttKey, id<MTLRenderPipelineState>, HashableHasher<ClearAttKey>> HashMap;
typedef HashMap<ClearAttKey, id<MTLRenderPipelineState>> HashMap;
std::unique_ptr<MDResourceFactory> resource_factory;
HashMap clear_states;

View File

@ -60,6 +60,7 @@ GODOT_CLANG_WARNING_PUSH_AND_IGNORE("-Wdeprecated-declarations")
#include "servers/rendering/rendering_device.h"
#import <Metal/Metal.h>
#include <iterator>
#pragma mark -
#pragma mark Metal format capabilities

View File

@ -90,7 +90,7 @@ class API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0)) RenderingDeviceDriverMet
* To prevent unbounded growth of the cache, cache entries are automatically freed when
* there are no more references to the MDLibrary associated with the cache entry.
*/
HashMap<SHA256Digest, ShaderCacheEntry *, HashableHasher<SHA256Digest>> _shader_cache;
HashMap<SHA256Digest, ShaderCacheEntry *> _shader_cache;
void shader_cache_free_entry(const SHA256Digest &key);
public: