mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
vk: Call anv_batch_emit_dwords() up front in anv_batch_emit()
This avoids putting a memory barrier between the template struct and the pack function, which generates much better code.
This commit is contained in:
parent
fbb119061e
commit
4b097d73e6
1 changed files with 2 additions and 2 deletions
|
|
@ -528,22 +528,22 @@ __gen_combine_address(struct anv_batch *batch, void *location,
|
|||
#include "gen8_pack.h"
|
||||
|
||||
#define anv_batch_emit(batch, cmd, ...) do { \
|
||||
void *__dst = anv_batch_emit_dwords(batch, cmd ## _length); \
|
||||
struct cmd __template = { \
|
||||
cmd ## _header, \
|
||||
__VA_ARGS__ \
|
||||
}; \
|
||||
void *__dst = anv_batch_emit_dwords(batch, cmd ## _length); \
|
||||
cmd ## _pack(batch, __dst, &__template); \
|
||||
VG(VALGRIND_CHECK_MEM_IS_DEFINED(__dst, cmd ## _length * 4)); \
|
||||
} while (0)
|
||||
|
||||
#define anv_batch_emitn(batch, n, cmd, ...) ({ \
|
||||
void *__dst = anv_batch_emit_dwords(batch, n); \
|
||||
struct cmd __template = { \
|
||||
cmd ## _header, \
|
||||
.DwordLength = n - cmd ## _length_bias, \
|
||||
__VA_ARGS__ \
|
||||
}; \
|
||||
void *__dst = anv_batch_emit_dwords(batch, n); \
|
||||
cmd ## _pack(batch, __dst, &__template); \
|
||||
__dst; \
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue