mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-16 09:13:50 +00:00
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:
parent
28e5cd9281
commit
683e171fd1
3 changed files with 27 additions and 51 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue