vulkan: use SamplerState::toKey for caching

This commit is contained in:
niki
2022-09-19 14:23:46 +02:00
parent 4b13e5b99d
commit ba759f5bc0
4 changed files with 12 additions and 24 deletions
+3 -2
View File
@@ -152,7 +152,7 @@ bool Texture::loadVolatile()
clear();
createTextureImageView();
textureSampler = vgfx->getCachedSampler(samplerState);
textureSampler = vgfx->getCachedSampler(samplerState.toKey());
if (!isPixelFormatDepthStencil(format) && mipmapCount > 1 && getMipmapsMode() != MIPMAPS_NONE)
generateMipmaps();
@@ -250,7 +250,8 @@ ptrdiff_t Texture::getHandle() const
void Texture::setSamplerState(const SamplerState &s)
{
love::graphics::Texture::setSamplerState(s);
textureSampler = vgfx->getCachedSampler(s);
textureSampler = vgfx->getCachedSampler(s.toKey());
}
VkImageLayout Texture::getImageLayout() const