From 3122f36e64694f5e3f536fa1cca57bf5a3db5c2f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 30 Dec 2021 00:03:36 +0200 Subject: [PATCH] Use low-level handles when computing descriptor set hashes The handle of a texture may change due to loading and unloading through a resource manager. --- source/backends/vulkan/pipelinestate_backend.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/backends/vulkan/pipelinestate_backend.cpp b/source/backends/vulkan/pipelinestate_backend.cpp index 172386d6..65c98b94 100644 --- a/source/backends/vulkan/pipelinestate_backend.cpp +++ b/source/backends/vulkan/pipelinestate_backend.cpp @@ -275,14 +275,14 @@ uint64_t VulkanPipelineState::compute_descriptor_set_hash(unsigned index) const { result = hash_update<64>(result, b.binding); result = hash_update<64>(result, reinterpret_cast(b.block)); - result = hash_update<64>(result, reinterpret_cast(b.buffer)); + result = hash_update<64>(result, reinterpret_cast(b.buffer->handle)); } for(const PipelineState::BoundTexture &t: self.textures) if(t.used && (t.binding>>20)==index) { result = hash_update<64>(result, t.binding); - result = hash_update<64>(result, reinterpret_cast(t.texture)); - result = hash_update<64>(result, reinterpret_cast(t.sampler)); + result = hash_update<64>(result, reinterpret_cast(t.texture->handle)); + result = hash_update<64>(result, reinterpret_cast(t.sampler->handle)); result = hash_update<64>(result, t.level); } -- 2.45.2