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
I first thought that fixing this should be as simple as adding a trackLinkage to the right location, but the problem is that the actual uniform TVariable created in transformEntryPoint isn't the one that is seen by handleSamplerTextureCombine—that one only sees the locally-scoped variable created in handleFunctionDefinition. So I'm not really sure what the fix should be.
I ended up working around this by detecting this in our engine and rewriting the variable with a different type, but I am posting this as issue in case others run into it.
The text was updated successfully, but these errors were encountered:
Has this issue been fixed? It seems good with my Vulkan + HLSL using SamplerComparisonState with the latest Vullkan SDK. However, I suffer another problem related to this topic. It seems OpenGL only supports combined image sampler (such as sampler2DShadow) in shaders, so OpenGL + HLSL needs DX9 style, but standard Shader Model 3 has no comparison sampler for percentage closer filter. I wonder if we need something like [[spv::Sampler_shadow]] to identify a Sampler2D as a shadow sampler. Or any other way? Thanks.
I could not find anything in the spec suggesting that the depth flag should match between the sampled image type and the original image type given to OpSampledImage, but I reckon that the intent was that it should use the same OpTypeImage, like it does when the Texture2D is declared at global scope.
KhronosGroup/SPIRV-Tools#5695 adds validation for OpSampledImage image types and it flags issues like this. DXC generates the types with a depth operand of 2 (unknown), though it seems to have some optimization based on use (Tint does that too) to avoid always using Depth=2.
Take this
test.frag.hlsl
file:This gets marked as depth image, as expected:
But when the Texture2D is instead in the entry point arguments, it doesn't get marked as depth image:
I first thought that fixing this should be as simple as adding a
trackLinkage
to the right location, but the problem is that the actual uniform TVariable created intransformEntryPoint
isn't the one that is seen byhandleSamplerTextureCombine
—that one only sees the locally-scoped variable created inhandleFunctionDefinition
. So I'm not really sure what the fix should be.I ended up working around this by detecting this in our engine and rewriting the variable with a different type, but I am posting this as issue in case others run into it.
The text was updated successfully, but these errors were encountered: