Skip to content
Discussion options

You must be logged in to vote

There is no public constructor for it. With slangc 2026.19, Sampler2D combined = Sampler2D(tex, samp); fails with error[E39999]: could not specialize generic for arguments of type (Texture2D<vector<float,4>>, SamplerState).

For Vulkan you usually don't need one, because sampling the separate objects already builds the combined image in SPIR-V. tex.Sample(samp, uv) / tex.SampleLevel(samp, uv, 0) go through __makeCombinedTextureSampler(this, s) on the spirv path (hlsl.meta.slang#L2421) and emit OpSampledImage.

If you really need a Sampler2D value, for example to pass to a function that takes one, that internal helper (#L2374-L2380) can be called directly:

[[vk::binding(0)]] Texture2D tex;
[…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by laperp0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants