Rewrite HashMapHasherDefault based on type traits - it is now possible to declare a default hashing function for any type.
Remove cross-project includes from `hashfuncs.h`. Improve hashing function for `Color` (based on values instead of `String`). Move `Variant` comparison from `hash_map.h` to `dictionary.cpp` (`VariantComparatorDictionary`), where it's used. Remove now unnecessary `HashableHasher`.
This commit is contained in:
@ -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.
|
||||
///
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user