Hi, quick question.
If I have stencil write enabled and I'm using clip() in the shader, will a pixel that gets clipped/discarded, still write to the stencil?
This is aimed at D3D11 and D3D12.
Cheers..
Hi, quick question.
If I have stencil write enabled and I'm using clip() in the shader, will a pixel that gets clipped/discarded, still write to the stencil?
This is aimed at D3D11 and D3D12.
Cheers..
No, unless you've forced early Z via earlydepthstencil (HLSL) or early_fragment_tests (GLSL) as the stencil operation will happen before the pixel shader discards the fragment.
No, unless you've forced early Z via earlydepthstencil (HLSL) or early_fragment_tests (GLSL) as the stencil operation will happen before the pixel shader discards the fragment.
Wow, I didn't know we could do this in PC. But the document is so brief, it didn't even mention where to put the 'earlydepthstencil'. Is it right before ps main function signature? or it is set during PSO creation? It will be great if you could provide a code snippet :-)
Thanks~~~~
Just before the entry point is fine, i.e.:
[earlydepthstencil]
float4 main() : SV_TARGET
{
return 0;
}
Just before the entry point is fine, i.e.:
[earlydepthstencil] float4 main() : SV_TARGET { return 0; }
Thanks for such a quick reply, then how to enable ReZ in PC? (sorry for being such a greedy asker, but I can't find related attributes to try)
Big Thanks Again.
Thanks for such a quick reply, then how to enable ReZ in PC? (sorry for being such a greedy asker, but I can't find related attributes to try)
Big Thanks Again.
I don't know what ReZ in PC means.
Just take in mind that the driver will automatically use early depth if it doesn't affect the rendering result. There is no need to explicitly enabled.
Forcing it will not produce the same results when:
Just before the entry point is fine, i.e.:
[earlydepthstencil] float4 main() : SV_TARGET { return 0; }
Thanks for such a quick reply, then how to enable ReZ in PC? (sorry for being such a greedy asker, but I can't find related attributes to try)
Big Thanks Again.
ReZ cannot be enabled or requested by anything you have control over in DirectX. Whether it's used or not is up to AMD's driver.