New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using legacy VFACE semantic does not work but compiler error is not printed (affects both DXIL and SPIR-V backends) #3494
Comments
@Dredhog Thank you for reporting this issue. I will check the SPIR-V backend. |
VFACE is not obsolete. See microsoft#3494.
@jaebaek I think we can close this? To give a bit of background, arbitrary semantics are allowed. As such, we can't reject this semantic just because it used to be a builtin semantic. Instead, Jaebaek added a warning that this may not be doing what you're expecting. |
Yes, fxc allows VFACE and interprets it as an arbitrary semantic unless using -Gec. With -Gec, it emulates it with SV_IsFrontFace. So the real bug is that we should emulate it when using -Gec. Note also that fxc dropped support for -Gec on SM 5.1. |
Sorry for this late reply. Yes. Let me close it. |
Title
Using legacy
VFACE
semantic does not work but compiler error is not printed (affects both DXIL and SPIR-V backends)Functional impact
When porting FXC shaders which use
VFACE
(which has modern equivalentSV_IsFrontFace
) DXC does not warn that these shaders will not work as they did with FXC. With D3D12 a shader which usesVFACE
crashes in the driver during graphics pipeline creation (i.e. call toCreateGraphicsPipelineState
fails). On Vulkan with the SPIR-V backend the argument decorated withVFACE
appears to be zero at runtime (it should be either negative or positive) so it does not work as well.Minimal repro steps
dxc.exe -T ps_6_0 -E PSMain shader.txt
:Expected result
DXC compilation fails and a descriptive error message about the legacy
VFACE
semantic no longer being supported is printed.Actual result
Compilation succeeds but the
VFACE
semantic does not work with eitherD3D12
or Vulkan (as detailed in thefunctional impact
section)Further technical details
N.B. Optionally DXC could add a compiler flag which would emulate
VFACE
withSV_IsFrontFace
as it contains the same information. The fact that theVFACE
argument is of float type can be worked around by creating a temporary float which is positive whenSV_IsFrontFace
is true and negative whenSV_IsFrontFace
is false. The SPIR-V backend can do the same but by emulatingVFACE
withgl_FrontFacing
.The text was updated successfully, but these errors were encountered: