From 2ba6458eba8bd2d4f4d2ffdd452ae089e5b50907 Mon Sep 17 00:00:00 2001 From: cheneym2 Date: Wed, 29 Jan 2025 14:59:42 -0500 Subject: Fix combined sampler documentation and warning (#6207) * Fix combined sampler documentation and warning * Update comment, show detailed '-fvk-t-shift' message in warning instead of generic '-fvk-xxx-shift' * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- docs/user-guide/a2-01-spirv-target-specific.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/user-guide/a2-01-spirv-target-specific.md b/docs/user-guide/a2-01-spirv-target-specific.md index dcbe44e96..5090caacf 100644 --- a/docs/user-guide/a2-01-spirv-target-specific.md +++ b/docs/user-guide/a2-01-spirv-target-specific.md @@ -20,7 +20,14 @@ Combined texture sampler Slang supports Combined texture sampler such as `Sampler2D`. Slang emits SPIR-V code with `OpTypeSampledImage` instruction. -You can specify two different register numbers for each: one for the texture register and another for the sampler register. +For SPIR-V targets, explicit bindings may be provided through a single `vk::binding` decoration. +``` +[[vk::binding(1,2)]] +Sampler2D explicitBindingSampler; +``` + +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. +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. ``` Sampler2D explicitBindingSampler : register(t4): register(s3); ``` -- cgit v1.2.3