diff options
author | Nicolai Hähnle <[email protected]> | 2017-06-09 01:31:45 +0200 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2017-07-31 14:55:37 +0200 |
commit | 6ff53175890a3eff1cc55120ef64d87575c69702 (patch) | |
tree | 8246a44c9fd420c4f2fa7dd64e6ba4ab31553817 /src/amd/common/ac_shader_abi.h | |
parent | 57fbf3f9eb8ee93cda4a202f14537fe1cd527bc5 (diff) |
ac/nir: add and use ac_shader_abi::load_sampler_desc
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/amd/common/ac_shader_abi.h')
-rw-r--r-- | src/amd/common/ac_shader_abi.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/amd/common/ac_shader_abi.h b/src/amd/common/ac_shader_abi.h index 1b204e9f447..63d31c82b56 100644 --- a/src/amd/common/ac_shader_abi.h +++ b/src/amd/common/ac_shader_abi.h @@ -26,6 +26,13 @@ #include <llvm-c/Core.h> +enum ac_descriptor_type { + AC_DESC_IMAGE, + AC_DESC_FMASK, + AC_DESC_SAMPLER, + AC_DESC_BUFFER, +}; + /* Document the shader ABI during compilation. This is what allows radeonsi and * radv to share a compiler backend. */ @@ -50,6 +57,23 @@ struct ac_shader_abi { LLVMValueRef *addrs); LLVMValueRef (*load_ubo)(struct ac_shader_abi *abi, LLVMValueRef index); + + /** + * Load a descriptor associated to a sampler. + * + * \param descriptor_set the descriptor set index (only for Vulkan) + * \param base_index the base index of the sampler variable + * \param constant_index constant part of an array index (or 0, if the + * sampler variable is not an array) + * \param index non-constant part of an array index (may be NULL) + * \param desc_type the type of descriptor to load + */ + LLVMValueRef (*load_sampler_desc)(struct ac_shader_abi *abi, + unsigned descriptor_set, + unsigned base_index, + unsigned constant_index, + LLVMValueRef index, + enum ac_descriptor_type desc_type); }; #endif /* AC_SHADER_ABI_H */ |