mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 11:38:05 +02:00
vk: Add anv_minify()
This commit is contained in:
parent
7cec6c5dfd
commit
f7fb7575ef
1 changed files with 9 additions and 0 deletions
|
|
@ -72,6 +72,15 @@ ALIGN_I32(int32_t v, int32_t a)
|
|||
return (v + a - 1) & ~(a - 1);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
anv_minify(uint32_t n, uint32_t levels)
|
||||
{
|
||||
if (unlikely(n == 0))
|
||||
return 0;
|
||||
else
|
||||
return MAX(n >> levels, 1);
|
||||
}
|
||||
|
||||
#define for_each_bit(b, dword) \
|
||||
for (uint32_t __dword = (dword); \
|
||||
(b) = __builtin_ffs(__dword) - 1, __dword; \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue