mirror of
https://git.suyu.dev/suyu/sirit.git
synced 2025-12-23 15:55:05 +01:00
Assemble uint32_t instead of uint8_t
Vulkan receives SPIR-V modules with a uint32_t alignment. Returning uint8_t forced users to invoke undefined behaviour (reinterpret_cast) or copy.
This commit is contained in:
parent
ab507033db
commit
8cf3d225db
7 changed files with 31 additions and 31 deletions
|
|
@ -79,10 +79,10 @@ int main(int argc, char** argv) {
|
|||
MyModule module;
|
||||
module.Generate();
|
||||
|
||||
std::vector<std::uint8_t> code{module.Assemble()};
|
||||
std::vector<std::uint32_t> code{module.Assemble()};
|
||||
|
||||
FILE* file = fopen("sirit.spv", "wb");
|
||||
fwrite(code.data(), 1, code.size(), file);
|
||||
fwrite(code.data(), sizeof(std::uint32_t), code.size(), file);
|
||||
fclose(file);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue