[clang] [llvm] [HLSL] Implement Texture2D::Gather and Texture2D::GatherCmp (PR #183323)

Helena Kotas via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 11:52:19 PST 2026


hekota wrote:

Got it, thank you for the explanation! I forgot for a moment that we are working with a dependent types so we cannot infer whether it is a vector or not. I'm ok with the change going in as is. 

It might be possible to change this in the future when we add `hlsl::enable_if` and `hlsl::is_arithmetic` constructs to Clang. These are currently spec-ed only in DXC's [LinAngMatrix spec](https://github.com/microsoft/hlsl-specs/blob/main/proposals/0035-linalg-matrix.md#new-hlsl-enable_if). We could use these to conditionally the `Gather*` methods based on whether the element type is a vector or not. 

https://github.com/llvm/llvm-project/pull/183323


More information about the llvm-commits mailing list