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
{{ message }}
Repository navigation
Feature request, combinedImageSampler for texture arrays #5092
However, DXC does not support declaring combined image sampler arrays like this. I have also compiled the HLSL version with shaderc and it produced a shader that rendered the correct/expected output. That might be non-compliance or a bug on the end of shaderc, but that indicates that it is possible to compile this shader down into an homologous spirv representation as the GLSL version.
Among other things this would make it easier for developers to port existing GLSL codebases targetting vulkan into HLSL.
I don't want to double down on the vk::combinedImageSampler attribute. After updating inline spir-v, I'll see how we can handle this. As I work through the inline spr-v, I'll make one of my goals to be able to define a class that can be made available in a header file that will be a combined image sampler.
Then I would to deprecate vk::combinedImageSampler.
We are close to finishing the implementation for vk::SpirvOpaqueType. Once that is done, we will try to implement combined image sampler using that. It should allow for arrays.
The problem with the current design for the vk::combinedImageSampler is that it relies one SPIR-V opt to be able to guess as which textures and samplers should be combined, and there are a lot of corner cases where we cannot get it correct.
Cassandra Beckley (@cassiebeckley) Once the vk::SpirvOpaqueType lands please provide the syntax for people to use to define an array of combined texture samplers, and then close the issue.
Activity
s-perron commentedon Jun 22, 2023
I don't want to double down on the vk::combinedImageSampler attribute. After updating inline spir-v, I'll see how we can handle this. As I work through the inline spr-v, I'll make one of my goals to be able to define a class that can be made available in a header file that will be a combined image sampler.
Then I would to deprecate
vk::combinedImageSampler.Rendering: Combine sampled image and sampler via index
BarabasGitHub commentedon Feb 9, 2024
I was a little surprised this doesn't work. I guess it's not trivial.
Any idea on when this will be supported?
s-perron commentedon Feb 12, 2024
We are close to finishing the implementation for
vk::SpirvOpaqueType. Once that is done, we will try to implement combined image sampler using that. It should allow for arrays.The problem with the current design for the vk::combinedImageSampler is that it relies one SPIR-V opt to be able to guess as which textures and samplers should be combined, and there are a lot of corner cases where we cannot get it correct.
s-perron commentedon Feb 12, 2024
Cassandra Beckley (@cassiebeckley) Once the
vk::SpirvOpaqueTypelands please provide the syntax for people to use to define an array of combined texture samplers, and then close the issue.devshgraphicsprogramming commentedon Apr 18, 2024
Steven Perron (@s-perron) I made this in godbolt https://godbolt.org/z/sxejh1q7W
I'll get Przemog1 to reimplement GLSL-style
samplerXXXandtexture...functions and they'll live in an Apache licensed header here: https://github.com/Devsh-Graphics-Programming/Nabla/blob/master/include/nbl/builtin/hlsl/glsl_compat/core.hlslHowever I've found a bug in the implementationProp 0011, one can't "nest"
vk::SpirvOpaqueTypeinside each other, this is a blocker because:OpTypeImageOpTypeSampledImagefrom (1)OpTypePointerin the UniformConstant storage class, and thats the actual type you declare your variable withThe error I get is that apparently
vk::SpirvOpaqueTypeis an object and not a typeShould I open a separate issue about that?
s-perron commentedon May 17, 2024
Yes please do that.
s-perron commentedon Aug 23, 2024
We are looking into supporting combined texture samplers through the recently added vk::SpirvOpaqueType. When that is done, the arrays should work.
luciechoi commentedon Apr 2, 2026
We are now in the process of implementing combined image samplers vk::SampledTexture2DArray
The new syntax will be
You can try this from head or wait for the next DXC release.
cc: Steven Perron (@s-perron)