diff --git a/Common/Hashmaps.h b/Common/Hashmaps.h index 2a7f5994cc..f9781166bb 100644 --- a/Common/Hashmaps.h +++ b/Common/Hashmaps.h @@ -29,7 +29,7 @@ enum class BucketState { // we always use very small values, so it's probably better to have them in the same // cache-line as the corresponding key. // Enforces that value are pointers to make sure that combined storage makes sense. -template +template class DenseHashMap { public: DenseHashMap(int initialCapacity) : capacity_(initialCapacity) { @@ -46,12 +46,12 @@ public: if (map[p].state == BucketState::TAKEN && KeyEquals(key, map[p].key)) return map[p].value; else if (map[p].state == BucketState::FREE) - return nullptr; + return NullValue; p = (p + 1) & mask; // If the state is REMOVED, we just keep on walking. if (p == pos) Crash(); } - return nullptr; + return NullValue; } // Returns false if we already had the key! Which is a bit different. @@ -170,7 +170,7 @@ private: // Like the above, uses linear probing for cache-friendliness. // Does not perform hashing at all so expects well-distributed keys. -template +template class PrehashMap { public: PrehashMap(int initialCapacity) : capacity_(initialCapacity) { @@ -187,12 +187,12 @@ public: if (map[p].state == BucketState::TAKEN && hash == map[p].hash) return map[p].value; else if (map[p].state == BucketState::FREE) - return nullptr; + return NullValue; p = (p + 1) & mask; // If the state is REMOVED, we just keep on walking. if (p == pos) Crash(); } - return nullptr; + return NullValue; } // Returns false if we already had the key! Which is a bit different. diff --git a/GPU/D3D11/DrawEngineD3D11.h b/GPU/D3D11/DrawEngineD3D11.h index cbc3493443..3a7d347932 100644 --- a/GPU/D3D11/DrawEngineD3D11.h +++ b/GPU/D3D11/DrawEngineD3D11.h @@ -167,7 +167,7 @@ private: ID3D11DeviceContext *context_; ID3D11DeviceContext1 *context1_; - PrehashMap vai_; + PrehashMap vai_; struct InputLayoutKey { D3D11VertexShader *vshader; @@ -181,7 +181,7 @@ private: } }; - DenseHashMap inputLayoutMap_; + DenseHashMap inputLayoutMap_; // Other ShaderManagerD3D11 *shaderManager_ = nullptr; diff --git a/GPU/Directx9/DrawEngineDX9.h b/GPU/Directx9/DrawEngineDX9.h index cd7640c06e..4c4f96acc3 100644 --- a/GPU/Directx9/DrawEngineDX9.h +++ b/GPU/Directx9/DrawEngineDX9.h @@ -154,8 +154,8 @@ private: LPDIRECT3DDEVICE9 device_ = nullptr; - PrehashMap vai_; - DenseHashMap vertexDeclMap_; + PrehashMap vai_; + DenseHashMap vertexDeclMap_; // SimpleVertex IDirect3DVertexDeclaration9* transformedVertexDecl_ = nullptr; diff --git a/GPU/GLES/DrawEngineGLES.h b/GPU/GLES/DrawEngineGLES.h index 355cd9e66a..02613af41c 100644 --- a/GPU/GLES/DrawEngineGLES.h +++ b/GPU/GLES/DrawEngineGLES.h @@ -166,7 +166,7 @@ private: void MarkUnreliable(VertexArrayInfo *vai); - PrehashMap vai_; + PrehashMap vai_; // Vertex buffer objects // Element buffer objects diff --git a/GPU/Vulkan/DrawEngineVulkan.h b/GPU/Vulkan/DrawEngineVulkan.h index 1f0f6a6859..22d2fd8df9 100644 --- a/GPU/Vulkan/DrawEngineVulkan.h +++ b/GPU/Vulkan/DrawEngineVulkan.h @@ -197,7 +197,7 @@ private: VulkanPipeline *lastPipeline_; VkDescriptorSet lastDs_ = VK_NULL_HANDLE; - PrehashMap vai_; + PrehashMap vai_; VulkanPushBuffer *vertexCache_; int decimationCounter_ = 0; @@ -228,7 +228,7 @@ private: VulkanPushBuffer *pushVertex; VulkanPushBuffer *pushIndex; // We do rolling allocation and reset instead of caching across frames. That we might do later. - DenseHashMap descSets; + DenseHashMap descSets; void Destroy(VulkanContext *vulkan); }; diff --git a/GPU/Vulkan/PipelineManagerVulkan.h b/GPU/Vulkan/PipelineManagerVulkan.h index 59c95694b7..a564f82a0e 100644 --- a/GPU/Vulkan/PipelineManagerVulkan.h +++ b/GPU/Vulkan/PipelineManagerVulkan.h @@ -97,7 +97,7 @@ public: std::vector DebugGetObjectIDs(DebugShaderType type); private: - DenseHashMap pipelines_; + DenseHashMap pipelines_; VkPipelineCache pipelineCache_; VulkanContext *vulkan_; };