DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

Sema: warn when POSITION[0] is used intead of SV_Position

Open Keenuts opened this issue 1 year ago • 1 comments

Before SM4, POSITION was equivalent to today's SV_Position. However, as HLSL moved to system semantics (SV_), the support for those old semantics has been deprecated. Some like VFACE are now completely forbidden, but others like POSITION or COLOR have been handled differently by FXC and DXC.

Today, usage of POSITION in place of SV_Position is probably a mistake as POSITION is now considered to be a user-defined semantic.

This commit adds a warning when POSITION is used as an output semantic for a vertex shader, as most cases should be the result of a mistake. If this is expected, the warning can be disabled by using -Wno-dx9-deprecation.

Fixes #3742

Keenuts avatar Mar 11 '24 14:03 Keenuts

@pow2clk @tex3d

Keenuts avatar Mar 11 '24 17:03 Keenuts

@llvm-beanz ping? (or @tex3d?)

Keenuts avatar Mar 21 '24 14:03 Keenuts

@llvm-beanz friendly ping

Keenuts avatar Mar 25 '24 12:03 Keenuts