Open cdavis5e opened 5 years ago
It looks like Apple removed this incomplete feature from the MSL 2.2 headers. Maybe the next version will support this.
yep.. but we should reopen as it should have returned today in Xcode 11 GM as it's a new feature of A13 GPU.. see (https://twitter.com/gavkar/status/1171494278545018882) also https://developer.apple.com/videos/play/tech-talks/608/
It does not seem like Metal's varying shading rate is remotely compatible with D3D or Vulkan. From what I understand it's varying rasterization rate with required resolve rather than varying shading rate (but fixed raster rate).
It does not seem like Metal's varying shading rate is remotely compatible with D3D or Vulkan. From what I understand it's varying rasterization rate with required resolve rather than varying shading rate (but fixed raster rate).
Part of it's the way it's implemented. Vulkan and D3D12's Tier 2 use an image to set the rate at which the fragment/pixel shader is invoked. Metal, however, uses a pair of piecewise linear functions, which cannot express everything that you can express with a shading rate image. Basically, Metal's functionality is greater than D3D12 Tier 1 VRS (which sets a constant rate for the whole render target) but lesser than Tier 2.
It does not seem like Metal's varying shading rate is remotely compatible with D3D or Vulkan. From what I understand it's varying rasterization rate with required resolve rather than varying shading rate (but fixed raster rate).
Part of it's the way it's implemented. Vulkan and D3D12's Tier 2 use an image to set the rate at which the fragment/pixel shader is invoked. Metal, however, uses a pair of piecewise linear functions, which cannot express everything that you can express with a shading rate image. Basically, Metal's functionality is greater than D3D12 Tier 1 VRS (which sets a constant rate for the whole render target) but lesser than Tier 2.
The other thing is that it's unclear if the rasterization rate map affects depth and stencil rendering. D3D12 is clear that its implementation of VRS does not. Vulkan does not seem to specify. I suspect, though, that because it indicates that it only affects the number of fragment shader invocations, the depth and stencil values are computed normally.
MSL 2.2 adds a new rasterization rate map type which maps between logical and screen coordinates. Using this new type with the
FragCoord
builtin should enable us to support theFragSizeEXT
builtin fromSPV_EXT_fragment_invocation_density
. TheFragInvocationCountEXT
builtin, meanwhile, can be implemented in terms of the number of samples in the render target, assuming sample-rate shading is active. Since Metal doesn't actually supportminSampleShading
, we'd thus always return the number of samples as the invocation count.