mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
vk/util: add macros for multidraw
this simplifies implementations since a lot of the code is going to be copy/pasted around, enabling related tweaks to be made in a centralized place Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11496>
This commit is contained in:
parent
8c968b8301
commit
6d0aceae4d
1 changed files with 15 additions and 0 deletions
|
|
@ -255,6 +255,21 @@ mesa_to_vk_shader_stage(gl_shader_stage mesa_stage)
|
|||
return (VkShaderStageFlagBits) (1 << ((uint32_t) mesa_stage));
|
||||
}
|
||||
|
||||
/* iterate over a sequence of indexed multidraws for VK_EXT_multi_draw extension */
|
||||
/* 'i' must be explicitly declared */
|
||||
#define vk_foreach_multi_draw_indexed(_draw, _i, _pDrawInfo, _num_draws, _stride) \
|
||||
for (const VkMultiDrawIndexedInfoEXT *_draw = (const void*)(_pDrawInfo); \
|
||||
(_i) < (_num_draws); \
|
||||
(_i)++, (_draw) = (const VkMultiDrawIndexedInfoEXT*)((const uint8_t*)(_draw) + (_stride)))
|
||||
|
||||
/* iterate over a sequence of multidraws for VK_EXT_multi_draw extension */
|
||||
/* 'i' must be explicitly declared */
|
||||
#define vk_foreach_multi_draw(_draw, _i, _pDrawInfo, _num_draws, _stride) \
|
||||
for (const VkMultiDrawInfoEXT *_draw = (const void*)(_pDrawInfo); \
|
||||
(_i) < (_num_draws); \
|
||||
(_i)++, (_draw) = (const VkMultiDrawInfoEXT*)((const uint8_t*)(_draw) + (_stride)))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue