[all-commits] [llvm/llvm-project] ef7301: [HLSL] Implement Texture2D::operator[]
Steven Perron via All-commits
all-commits at lists.llvm.org
Mon Mar 23 12:35:08 PDT 2026
Branch: refs/heads/users/s-perron/texture2d-mips
Home: https://github.com/llvm/llvm-project
Commit: ef7301ca21c59b5ac588a86c6d6d7617527f5566
https://github.com/llvm/llvm-project/commit/ef7301ca21c59b5ac588a86c6d6d7617527f5566
Author: Steven Perron <stevenperron at google.com>
Date: 2026-03-12 (Thu, 12 Mar 2026)
Changed paths:
M clang/include/clang/Basic/DiagnosticSemaKinds.td
M clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.cpp
M clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.h
M clang/lib/Sema/HLSLExternalSemaSource.cpp
M clang/lib/Sema/SemaHLSL.cpp
M clang/test/AST/HLSL/Texture2D-scalar-AST.hlsl
M clang/test/AST/HLSL/Texture2D-vector-AST.hlsl
M clang/test/CodeGenHLSL/resources/ByteAddressBuffers-methods.hlsl
M clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
M clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl
M clang/test/CodeGenHLSL/resources/StructuredBuffers-subscripts.hlsl
A clang/test/CodeGenHLSL/resources/Texture2D-Subscript.hlsl
M clang/test/CodeGenHLSL/resources/TypedBuffers-methods.hlsl
M clang/test/CodeGenHLSL/resources/TypedBuffers-subscript.hlsl
M clang/test/SemaHLSL/BuiltIns/resource_getpointer-errors.hlsl
A clang/test/SemaHLSL/Resources/Texture2D-Subscript.hlsl
M llvm/include/llvm/IR/IntrinsicsDirectX.td
M llvm/include/llvm/IR/IntrinsicsSPIRV.td
M llvm/test/CodeGen/DirectX/MemIntrinsics/memcpy-pointee.ll
M llvm/test/CodeGen/DirectX/forward_handle_on_alloca.ll
M llvm/test/Transforms/GVN/PRE/no-pre-load-for-token-like.ll
M llvm/test/Transforms/GVN/no-sink-dxgetpointer.ll
M llvm/test/Transforms/SimplifyCFG/DirectX/no-sink-dxgetpointer.ll
M llvm/test/Transforms/SimplifyCFG/token_like_type.ll
Log Message:
-----------
[HLSL] Implement Texture2D::operator[]
Implments the Texture2D::operator[] method. It uses the same design as
Buffer::operator[]. However, this requires us to chagne the
resource_getpointer intrinsic to accept integer vectors for the index.
Assisted-by: Gemini
Commit: 8c5bd3dbfbdebb2af0a640c8fcb44cf68d9ef120
https://github.com/llvm/llvm-project/commit/8c5bd3dbfbdebb2af0a640c8fcb44cf68d9ef120
Author: Steven Perron <stevenperron at google.com>
Date: 2026-03-12 (Thu, 12 Mar 2026)
Changed paths:
M clang/include/clang/Basic/DiagnosticSemaKinds.td
M clang/include/clang/Sema/SemaHLSL.h
M clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.cpp
M clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.h
M clang/lib/Sema/HLSLExternalSemaSource.cpp
M clang/lib/Sema/SemaHLSL.cpp
M clang/test/CodeGenHLSL/resources/Texture2D-Gather.hlsl
A clang/test/CodeGenHLSL/resources/Texture2D-Mips.hlsl
M clang/test/CodeGenHLSL/resources/Texture2D-Sample.hlsl
M clang/test/CodeGenHLSL/resources/Texture2D-SampleBias.hlsl
M clang/test/CodeGenHLSL/resources/Texture2D-SampleCmp.hlsl
M clang/test/CodeGenHLSL/resources/Texture2D-SampleGrad.hlsl
M clang/test/CodeGenHLSL/resources/Texture2D-SampleLevel.hlsl
M clang/test/CodeGenHLSL/resources/Texture2D-default-explicit-binding.hlsl
M clang/test/CodeGenHLSL/resources/Texture2D-default.hlsl
M clang/test/CodeGenHLSL/resources/Texture2D-shorthand-contexts.hlsl
A clang/test/SemaHLSL/Texture2D-mips-errors.hlsl
A clang/test/SemaHLSL/Texture2D-mips-errors.ll
Log Message:
-----------
[HLSL] Implement Texture2D::mips[][]
We implement the Textur2D::mips[][] method. We follow the design in DXC.
There is a new member called `mips` with type mips_type. The member will
contain a copy of the handle for the texture.
The type `mips_type` will have a member function `operator[]` that takes
a level, and returns a `mips_slice_type`. The slice will contain the
handle and the level. It also has an operator[] member function that
take a coordinate. It will do a load from the handle with the level and
coordinate, and return that value.
Assisted-by: Gemini
Compare: https://github.com/llvm/llvm-project/compare/523e53ef4835...8c5bd3dbfbde
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