mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
libs/vkd3d: Add UAV counter support for compute pipelines.
UAV counter descriptors are stored in a separate VkDescriptorSet. A VkPipelineLayout created for compute pipeline is compatible for all other descriptor sets with the VkPipelineLayout created for the root signature. This ensures that only UAV counter bindings in the last descriptor set may be disturbed when switching between pipelines with compatible root signatures. The implementation of vkd3d_popcount() is based on https://graphics.stanford.edu/~seander/bithacks.html
This commit is contained in:
@@ -37,6 +37,13 @@ static inline size_t align(size_t addr, size_t alignment)
|
||||
# define VKD3D_UNUSED
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
static inline unsigned int vkd3d_popcount(unsigned int v)
|
||||
{
|
||||
v -= (v >> 1) & 0x55555555;
|
||||
v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
|
||||
return (((v + (v >> 4)) & 0x0f0f0f0f) * 0x01010101) >> 24;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
# if HAVE_SYNC_ADD_AND_FETCH
|
||||
static inline LONG InterlockedIncrement(LONG volatile *x)
|
||||
|
Reference in New Issue
Block a user