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

@ -32,6 +32,7 @@ bool VkShaderModule::loadFromFile(VkDevice device, const std::string& path) {
}
size_t fileSize = static_cast<size_t>(file.tellg());
// SPIR-V is a stream of 32-bit words — file size must be a multiple of 4
if (fileSize == 0 || fileSize % 4 != 0) {
LOG_ERROR("Invalid SPIR-V file size (", fileSize, "): ", path);
return false;