Closed AnonN10 closed 3 years ago
If pCode is a pointer to SPIR-V code, codeSize must be a multiple of 4 https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShaderModuleCreateInfo.html
There is no reason to worry about a buffer size not a multiple of 4, because Vulkan requires that the buffer is that way, otherwise its invalid spirv.
it really isn't obvious from the specification that this is the case
integer division rounds down, so it won't account for characters at the end of the file if they don't add up to a multiple of 4 bytes