summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-05-25 14:59:19 +0200
committerSamuel Pitoiset <[email protected]>2018-05-29 10:07:13 +0200
commit288fe7ec714f0920e870d0551bdaccf277e12a59 (patch)
treef56becf415818927c8983138530e8c27c71ba124 /src
parent57e721a45693e510c6ec25b37ec0ccd23d434553 (diff)
radv: split radv_emit_shader_pointer()
This will allow to emit consecutive shader pointers for reducing the number of emitted SET_SH_REG packets, which is recommended. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_private.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index e2fa58d8d1e..e554fc7acca 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -1131,13 +1131,17 @@ bool radv_get_memory_fd(struct radv_device *device,
int *pFD);
static inline void
-radv_emit_shader_pointer(struct radv_device *device,
- struct radeon_winsys_cs *cs,
- uint32_t sh_offset, uint64_t va, bool global)
+radv_emit_shader_pointer_head(struct radeon_winsys_cs *cs,
+ unsigned sh_offset, bool use_32bit_pointers)
{
- bool use_32bit_pointers = HAVE_32BIT_POINTERS && !global;
-
radeon_set_sh_reg_seq(cs, sh_offset, use_32bit_pointers ? 1 : 2);
+}
+
+static inline void
+radv_emit_shader_pointer_body(struct radv_device *device,
+ struct radeon_winsys_cs *cs,
+ uint64_t va, bool use_32bit_pointers)
+{
radeon_emit(cs, va);
if (use_32bit_pointers) {
@@ -1148,6 +1152,17 @@ radv_emit_shader_pointer(struct radv_device *device,
}
}
+static inline void
+radv_emit_shader_pointer(struct radv_device *device,
+ struct radeon_winsys_cs *cs,
+ uint32_t sh_offset, uint64_t va, bool global)
+{
+ bool use_32bit_pointers = HAVE_32BIT_POINTERS && !global;
+
+ radv_emit_shader_pointer_head(cs, sh_offset, use_32bit_pointers);
+ radv_emit_shader_pointer_body(device, cs, va, use_32bit_pointers);
+}
+
static inline struct radv_descriptor_state *
radv_get_descriptors_state(struct radv_cmd_buffer *cmd_buffer,
VkPipelineBindPoint bind_point)