[all-commits] [llvm/llvm-project] e1d2ff: [SPIRV] Implement lowering for HLSL Texture2D samp...

Steven Perron via All-commits all-commits at lists.llvm.org
Mon Feb 9 14:29:20 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e1d2ff6caf8c1fef15561fbcc275aa93fec4c115
      https://github.com/llvm/llvm-project/commit/e1d2ff6caf8c1fef15561fbcc275aa93fec4c115
  Author: Steven Perron <stevenperron at google.com>
  Date:   2026-02-09 (Mon, 09 Feb 2026)

  Changed paths:
    M llvm/include/llvm/IR/IntrinsicsDirectX.td
    M llvm/include/llvm/IR/IntrinsicsSPIRV.td
    M llvm/lib/Target/SPIRV/SPIRVInstrInfo.td
    M llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
    M llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
    M llvm/test/CodeGen/SPIRV/hlsl-resources/Sample.ll
    A llvm/test/CodeGen/SPIRV/hlsl-resources/Sample1D.ll
    A llvm/test/CodeGen/SPIRV/hlsl-resources/Sample3D.ll
    A llvm/test/CodeGen/SPIRV/hlsl-resources/SampleBias.ll
    A llvm/test/CodeGen/SPIRV/hlsl-resources/SampleCmp.ll
    A llvm/test/CodeGen/SPIRV/hlsl-resources/SampleCmpLevelZero.ll
    A llvm/test/CodeGen/SPIRV/hlsl-resources/SampleCube.ll
    A llvm/test/CodeGen/SPIRV/hlsl-resources/SampleErrors.ll
    A llvm/test/CodeGen/SPIRV/hlsl-resources/SampleErrorsDebug.ll
    A llvm/test/CodeGen/SPIRV/hlsl-resources/SampleGrad.ll
    A llvm/test/CodeGen/SPIRV/hlsl-resources/SampleLevel.ll

  Log Message:
  -----------
  [SPIRV] Implement lowering for HLSL Texture2D sampling intrinsics (#179312)

This patch implements the SPIR-V lowering for the following HLSL
intrinsics:
- SampleBias
- SampleGrad
- SampleLevel
- SampleCmp
- SampleCmpLevelZero

It defines the required LLVM intrinsics in 'IntrinsicsDirectX.td' and
'IntrinsicsSPIRV.td'.

It updates 'SPIRVInstructionSelector.cpp' to handle the new intrinsics
and
generates the correct 'OpImageSample*' instructions with the required
operands
(Bias, Grad, Lod, ConstOffset, MinLod, etc.).

CodeGen tests are added to verify the implementation for images with
dimension 1D, 2D, 3D, and Cube.

Assisted-by: Gemini



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list