Skip to content

Commit

Permalink
[gpu.vulkan] quick extra sanity check that draw_t and draw_indexed_t …
Browse files Browse the repository at this point in the history
…are of the correct sizes compared to their vulkan API counterparts
  • Loading branch information
harrand committed Nov 12, 2024
1 parent bc1217d commit 90878fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tz/gpu/rhi_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ namespace tz::gpu
return resource_write(index_buffer, std::as_bytes(indices));
}

static_assert(sizeof(draw_t) == sizeof(VkDrawIndirectCommand));
tz::error_code draw_buffer_write(resource_handle draw_buffer, std::uint32_t count, std::span<const draw_t> draws)
{
std::vector<std::byte> mem(sizeof(std::uint32_t) + draws.size_bytes());
Expand All @@ -1026,6 +1027,7 @@ namespace tz::gpu
return resource_write(draw_buffer, mem);
}

static_assert(sizeof(draw_indexed_t) == sizeof(VkDrawIndexedIndirectCommand));
tz::error_code draw_buffer_indexed_write(resource_handle draw_buffer, std::uint32_t count, std::span<const draw_indexed_t> draws)
{
std::vector<std::byte> mem(sizeof(std::uint32_t) + draws.size_bytes());
Expand Down

0 comments on commit 90878fc

Please sign in to comment.