mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 07:10:15 +01:00
freedreno/vulkan: for_each_bit -> foreach_bit
Reviewed-by: Rob Clark <robclark@freedesktop.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9191>
This commit is contained in:
parent
6875e10350
commit
77cba4b9f2
3 changed files with 6 additions and 12 deletions
|
|
@ -1192,8 +1192,7 @@ tu_CmdBlitImage(VkCommandBuffer commandBuffer,
|
|||
if (src_image->vk_format == VK_FORMAT_D32_SFLOAT_S8_UINT ||
|
||||
dst_image->vk_format == VK_FORMAT_D32_SFLOAT_S8_UINT) {
|
||||
VkImageBlit region = pRegions[i];
|
||||
uint32_t b;
|
||||
for_each_bit(b, pRegions[i].dstSubresource.aspectMask) {
|
||||
u_foreach_bit(b, pRegions[i].dstSubresource.aspectMask) {
|
||||
region.srcSubresource.aspectMask = BIT(b);
|
||||
region.dstSubresource.aspectMask = BIT(b);
|
||||
tu6_blit_image(cmd, src_image, dst_image, ®ion, filter);
|
||||
|
|
@ -1887,8 +1886,7 @@ tu_CmdClearDepthStencilImage(VkCommandBuffer commandBuffer,
|
|||
|
||||
if (image->vk_format == VK_FORMAT_D32_SFLOAT_S8_UINT) {
|
||||
/* can't clear both depth and stencil at once, split up the aspect mask */
|
||||
uint32_t b;
|
||||
for_each_bit(b, range->aspectMask)
|
||||
u_foreach_bit(b, range->aspectMask)
|
||||
clear_image(cmd, image, (const VkClearValue*) pDepthStencil, range, BIT(b));
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1912,7 +1910,7 @@ tu_clear_sysmem_attachments(struct tu_cmd_buffer *cmd,
|
|||
uint32_t clear_value[MAX_RTS][4];
|
||||
float z_clear_val = 0.0f;
|
||||
uint8_t s_clear_val = 0;
|
||||
uint32_t clear_rts = 0, clear_components = 0, num_rts = 0, b;
|
||||
uint32_t clear_rts = 0, clear_components = 0, num_rts = 0;
|
||||
bool z_clear = false;
|
||||
bool s_clear = false;
|
||||
bool layered_clear = false;
|
||||
|
|
@ -2036,7 +2034,7 @@ tu_clear_sysmem_attachments(struct tu_cmd_buffer *cmd,
|
|||
CP_LOAD_STATE6_0_NUM_UNIT(num_rts));
|
||||
tu_cs_emit(cs, CP_LOAD_STATE6_1_EXT_SRC_ADDR(0));
|
||||
tu_cs_emit(cs, CP_LOAD_STATE6_2_EXT_SRC_ADDR_HI(0));
|
||||
for_each_bit(b, clear_rts)
|
||||
u_foreach_bit(b, clear_rts)
|
||||
tu_cs_emit_array(cs, clear_value[b], 4);
|
||||
|
||||
for (uint32_t i = 0; i < rect_count; i++) {
|
||||
|
|
|
|||
|
|
@ -2109,7 +2109,6 @@ tu_CmdBindPipeline(VkCommandBuffer commandBuffer,
|
|||
if (!(cmd->state.dirty & TU_CMD_DIRTY_DRAW_STATE)) {
|
||||
struct tu_cs *cs = &cmd->draw_cs;
|
||||
uint32_t mask = ~pipeline->dynamic_state_mask & BITFIELD_MASK(TU_DYNAMIC_STATE_COUNT);
|
||||
uint32_t i;
|
||||
|
||||
tu_cs_emit_pkt7(cs, CP_SET_DRAW_STATE, 3 * (6 + util_bitcount(mask)));
|
||||
tu_cs_emit_draw_state(cs, TU_DRAW_STATE_PROGRAM, pipeline->program.state);
|
||||
|
|
@ -2119,7 +2118,7 @@ tu_CmdBindPipeline(VkCommandBuffer commandBuffer,
|
|||
tu_cs_emit_draw_state(cs, TU_DRAW_STATE_RAST, pipeline->rast_state);
|
||||
tu_cs_emit_draw_state(cs, TU_DRAW_STATE_BLEND, pipeline->blend_state);
|
||||
|
||||
for_each_bit(i, mask)
|
||||
u_foreach_bit(i, mask)
|
||||
tu_cs_emit_draw_state(cs, TU_DRAW_STATE_DYNAMIC + i, pipeline->dynamic_state[i]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
|
||||
#include "c11/threads.h"
|
||||
#include "main/macros.h"
|
||||
#include "util/bitscan.h"
|
||||
#include "util/list.h"
|
||||
#include "util/log.h"
|
||||
#include "util/macros.h"
|
||||
|
|
@ -118,10 +119,6 @@ typedef uint32_t xcb_window_t;
|
|||
#define A6XX_TEX_CONST_DWORDS 16
|
||||
#define A6XX_TEX_SAMP_DWORDS 4
|
||||
|
||||
#define for_each_bit(b, dword) \
|
||||
for (uint32_t __dword = (dword); \
|
||||
(b) = __builtin_ffs(__dword) - 1, __dword; __dword &= ~(1 << (b)))
|
||||
|
||||
#define COND(bool, val) ((bool) ? (val) : 0)
|
||||
#define BIT(bit) (1u << (bit))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue