You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/user-guide/a2-01-spirv-target-specific.md
+8-1
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,14 @@ Combined texture sampler
20
20
Slang supports Combined texture sampler such as `Sampler2D`.
21
21
Slang emits SPIR-V code with `OpTypeSampledImage` instruction.
22
22
23
-
You can specify two different register numbers for each: one for the texture register and another for the sampler register.
23
+
For SPIR-V targets, explicit bindings may be provided through a single `vk::binding` decoration.
24
+
```
25
+
[[vk::binding(1,2)]]
26
+
Sampler2D explicitBindingSampler;
27
+
```
28
+
29
+
For other targets (HLSL or others) where combined texture samplers are _not_ supported intrinsicly, they are emulated by Slang using separate objects for Texture and Sampler.
30
+
For explicit binding on such targets, you can specify two different register numbers for each: one for the texture register and another for the sampler register.
tests/diagnostics/hlsl-to-vulkan-sampler-diagnostic.hlsl(25): warning 39013: shader parameter 'cs3' has a 'register' specified for D3D, but no '[[vk::binding(...)]]` specified for Vulkan
tests/diagnostics/hlsl-to-vulkan-sampler-diagnostic.hlsl(25): warning 39013: shader parameter 'cs3' has a 'register' specified for D3D, but no '[[vk::binding(...)]]` specified for Vulkan
Copy file name to clipboardexpand all lines: tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl.expected
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
result code = -1
2
2
standard error = {
3
-
tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl(11): warning 39013: shader parameter 'c' has a 'register' specified for D3D, but no '[[vk::binding(...)]]` specified for Vulkan
3
+
tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl(11): warning 39029: shader parameter 'c' has a 'register' specified for D3D, but no '[[vk::binding(...)]]` specified for Vulkan, nor is `-fvk-xxx-shift` used.
4
4
ConstantBuffer<Data> c : register(b2);
5
5
^~~~~~~~
6
-
tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl(15): warning 39013: shader parameter 'u' has a 'register' specified for D3D, but no '[[vk::binding(...)]]` specified for Vulkan
6
+
tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl(15): warning 39029: shader parameter 'u' has a 'register' specified for D3D, but no '[[vk::binding(...)]]` specified for Vulkan, nor is `-fvk-xxx-shift` used.
7
7
RWStructuredBuffer<Data> u : register(u11);
8
8
^~~~~~~~
9
9
tests/diagnostics/hlsl-to-vulkan-shift-diagnostic.hlsl(15): error 39025: conflicting vulkan inferred binding for parameter 'c' overlap is 0 and 0
0 commit comments