]> git.tdb.fi Git - libs/gl.git/commitdiff
Use low-level handles when computing descriptor set hashes
authorMikko Rasa <tdb@tdb.fi>
Wed, 29 Dec 2021 22:03:36 +0000 (00:03 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 29 Dec 2021 22:03:36 +0000 (00:03 +0200)
The handle of a texture may change due to loading and unloading through
a resource manager.

source/backends/vulkan/pipelinestate_backend.cpp

index 172386d6eee9c8bcf85d4e41dfc91b55551d1f70..65c98b94ffe69c485980c91f1528529bb5797ff5 100644 (file)
@@ -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<uintptr_t>(b.block));
-                       result = hash_update<64>(result, reinterpret_cast<uintptr_t>(b.buffer));
+                       result = hash_update<64>(result, reinterpret_cast<uintptr_t>(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<uintptr_t>(t.texture));
-                       result = hash_update<64>(result, reinterpret_cast<uintptr_t>(t.sampler));
+                       result = hash_update<64>(result, reinterpret_cast<uintptr_t>(t.texture->handle));
+                       result = hash_update<64>(result, reinterpret_cast<uintptr_t>(t.sampler->handle));
                        result = hash_update<64>(result, t.level);
                }