X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Famd%2Fvulkan%2Fradv_private.h;h=708cacf7708936faf0b5441cec682ac3f949b586;hb=88d1ed0f818930fd37ea012893405f21ef1b78ea;hp=e3eed887fae098e02005cee01f2337553f427e68;hpb=3d4d388e3929d7948b62d90867357aecbfba5aeb;p=mesa.git diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index e3eed887fae..708cacf7708 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -57,8 +57,10 @@ #include "ac_nir_to_llvm.h" #include "ac_gpu_info.h" #include "ac_surface.h" +#include "ac_llvm_build.h" #include "radv_descriptor_set.h" #include "radv_extensions.h" +#include "radv_cs.h" #include @@ -624,7 +626,6 @@ struct radv_device { struct radeon_winsys_cs *empty_cs[RADV_MAX_QUEUE_FAMILIES]; bool always_use_syncobj; - bool llvm_supports_spill; bool has_distributed_tess; bool pbb_allowed; bool dfsm_allowed; @@ -1129,6 +1130,41 @@ bool radv_get_memory_fd(struct radv_device *device, struct radv_device_memory *memory, int *pFD); +static inline void +radv_emit_shader_pointer_head(struct radeon_winsys_cs *cs, + unsigned sh_offset, unsigned pointer_count, + bool use_32bit_pointers) +{ + radeon_emit(cs, PKT3(PKT3_SET_SH_REG, pointer_count * (use_32bit_pointers ? 1 : 2), 0)); + radeon_emit(cs, (sh_offset - SI_SH_REG_OFFSET) >> 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) { + assert(va == 0 || + (va >> 32) == device->physical_device->rad_info.address32_hi); + } else { + radeon_emit(cs, va >> 32); + } +} + +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, 1, 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)