fix: VkTexture move/destroy ownsSampler_ flag, extract finalizeSampler

- Fix move constructor and move assignment: set other.ownsSampler_ to
  false after transfer (was incorrectly set to true, leaving moved-from
  object claiming ownership of a null sampler)
- Fix destroy(): reset ownsSampler_ to false after clearing sampler
  handle (was set to true, inconsistent with null handle state)
- Extract finalizeSampler() from 3 duplicated cache-or-create blocks
  in createSampler() overloads and createShadowSampler() (-24 lines)
- Add SPIR-V alignment why-comment in vk_shader.cpp
This commit is contained in:
Kelsi 2026-03-30 14:24:41 -07:00
parent 28e5cd9281
commit 683e171fd1
3 changed files with 27 additions and 51 deletions

View file

@ -68,6 +68,8 @@ public:
private:
void generateMipmaps(VkContext& ctx, VkFormat format, uint32_t width, uint32_t height);
// Shared sampler finalization: prefer the global cache, fall back to direct creation
bool finalizeSampler(VkDevice device, const VkSamplerCreateInfo& samplerInfo);
AllocatedImage image_{};
VkSampler sampler_ = VK_NULL_HANDLE;