From: Mikko Rasa Date: Wed, 29 Dec 2021 22:03:36 +0000 (+0200) Subject: Use low-level handles when computing descriptor set hashes X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=3122f36e64694f5e3f536fa1cca57bf5a3db5c2f;p=libs%2Fgl.git 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. --- 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); }