Closed ben-clayton closed 3 years ago
@pow2clk @RafaelCintron
It's definitely not required for correctness. We've been running MSAA-enabled workloads with SPIRV-Cross translation for a while, and SPIR-V doesn't carry the number of samples, so the generated HLSL does neither. The question is more of whether or not there is any (performance) advantage in specifying the sample count in there.
It's required for Shader Model 4.0 (D3D10), but not Shader Model 5.0+ (D3D11+).
Thank you both. It certainly sounds like this is a non-issue then. Closing.
According to https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-to-type:
Later it gives an example:
However, WGSL does not currently include the number of samples in the
texture_multisampled_*
types.It seems that DXC actually treats the number of samples argument as optional, but it's I've not found any documentation to explain what omitting the number of samples means.
The DXIL output for
Texture2DMS<float4>
andTexture2DMS<float4, 8>
is clearly different, so it seems this information is being preserved by DXC.If the number of samples is required to function properly, we may need to change the spec to include this as part of the type, or we'll have to inject this information into the shader at pipeline creation time.
Microsoft folks - are you able to provide any information on whether this template argument is required, and what the behaviour is if omitted?