Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[202x] Propose adding vk::SampledTexture* types #343

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refinements
cassiebeckley committed Oct 17, 2024
commit 70af79c2dcf5e55049be3e06adb39ecdd16c5002
10 changes: 7 additions & 3 deletions proposals/NNNN-vk-sampled-texture.md
Original file line number Diff line number Diff line change
@@ -24,8 +24,9 @@ The [existing annotation](https://github.com/microsoft/DirectXShaderCompiler/wik
for combined image samplers (`[[vk::combinedImageSampler]]`) was designed with
the explicit goal of avoiding defining new HLSL types and functions. This was
intended to minimize the number of changes to the frontend needed to implement
the feature. However, it is verbose and confusing for users, and we do not
intend to implement it in upstream Clang.
the feature. However, it is verbose, confusing for users, and requires a
backend pass to pair up textures and samplers which is prone to subtle errors.
We do not intend to implement it in upstream Clang.

## High-level description

@@ -73,7 +74,7 @@ float4 main(float2 uv: TEXCOORD) : SV_Target {

### HLSL Additions

The following resource types will be added:
The following resource types will be added to the `vk` namespace:

| HLSL Object | Type Parameters |
|---------------------------|-----------------------------------|
@@ -130,6 +131,9 @@ which do not require a sampler, or an `OpTypeSampledImage`, for instructions
which do. For instructions which require an `OpTypeImage`, we can obtain such
a value by passing the `OpTypeSampledImage` value to the `OpImage` instruction.

We will likely represent these types in LLVM IR for upstream Clang by the
addition of a new "sampled" attribute for the resource type.

### Diagnostic Changes

The `vk::SampledTexture*` types and builtin methods should provide the same