summaryrefslogtreecommitdiffstats
path: root/src/vulkan
diff options
context:
space:
mode:
authorKristian Høgsberg Kristensen <[email protected]>2015-07-31 13:45:54 -0700
committerKristian Høgsberg Kristensen <[email protected]>2015-08-03 15:38:14 -0700
commit4b097d73e6bc360235915d34b798284d09174929 (patch)
treedf8318512d2f41b5da9a240237289121e99b568e /src/vulkan
parentfbb119061e7be6ecdaefd8630e3fae274886d297 (diff)
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.
Diffstat (limited to 'src/vulkan')
-rw-r--r--src/vulkan/anv_private.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h
index f14a6ca858f..48edc6c95ed 100644
--- a/src/vulkan/anv_private.h
+++ b/src/vulkan/anv_private.h
@@ -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; \
})