Open aleino-nv opened 1 week ago
Here is a description of unfilterable float sample type: https://www.w3.org/TR/webgpu/#dom-gputexturesampletype-unfilterable-float
@skallweitNV I guess we should look at what slang-RHI supplies. Seems to me like it should supply the float sample type in this case. Maybe some reflection data is wrong?
Yeah it seems we just return unfilterable-float unconditionally.
As far as I know, textures are not available on compute stage with WGSL. It works only for the fragment shader.
I would be super surprised if textures are not available in compute stage ...
...is TextureSampleType::UnfilterableFloat but used statically with a sampler (group:0, binding:1) that's SamplerBindingType::Filtering
Oh, I think possibly the fix here is to make the sampler not be of type filtering
-- I don't know where it would get derivatives and such generally used for filtering, in a compute shader.
I was surprised too but may be I am reading it wrong. Please see it for your self, here
16.7.8. textureSample Samples a texture. Must only be used in a fragment shader stage.
It could also be because you need derivative of screen-to-triangle transformation in order to pick MIP level.
https://www.w3.org/TR/WGSL/#texturesamplelevel seems to be fine. (Check compute.toys samples)
Oh. Yes, that must be it. It makes sense now
This issue was split from https://github.com/shader-slang/slang/issues/5173.
Affected tests under tests/compute (currently excluded):
func-param-legalize
Output from slang-test, for
func-param-legalize
:Generated WGSL for
slangc -o test.wgsl -target wgsl -stage compute -entry computeMain %SLANG_SRC%\tests\compute\func-param-legalize.slang
: