* Support obsolete semantics with -Gec flag
Shaders with obsoleted semantics now compile with -Gec flag. Each
semantic will trigger a warning and be remapped to the current name.
The obsolete semantics & remappings introduced in this change are:
POSITION -> SV_Position (VS output)
VPOS -> SV_Position (PS input)
COLOR -> SV_Target (PS output)
DEPTH -> SV_Depth (PS output)
* Switch to case insensitive compare; add tests
* Address code review feedback
Since we don't have d3d12shader.h on Linux/macOS, I am disabling the
unit tests that depend on it.
I am currently disabling entire files that depend on this header.
It is possible to have a more fine-grained change to only disable
specific tests within these files, although that would be a more intrusive
change and not necessary at the moment.
Fixes failing RewriterTests
The EnableBackCompatMode flag was not initialized when the compiler
was used via DxcRewriter.
The flag is new and has been introduced shortly after the DxcRewriter
change PR. The tests failures were caused by unfortunate merge timing
of the two changes.
* IDxcRewriter2 interface; change RewriterTest to report errors
Added IDxcRewriter2 interface with method RewriteWithOptions that allows
setting compiler flags for the rewrite. The current IDxcRewrite methods
use HLSL Version 2015 only. RewriteWithOptions allows changing that
and other compiler options.
Modified RewriterTest to report compilation errors. Changed data of existing
tests that started failing because of this change.
Fixed DeadLoopFail test.
Fixes#1525
This CL changes dxcapi.use.h back to what it was before the Linux-port work. It does, however, add a snippet into it to redirect FreeLibrary to dlcose, LoadLibraryW to dlopen, and GetProcAddress to dlsym for non-Windows platforms.
Implement Length property on constant arrays (FXC regression)
The FXC compiler supports Length property on arrays. This change adds it
to the DXC compiler for backwards compatibility. However, it is marked
obsolete and in HLSL Version 2016 will report a warning. On higher versions
it will result in an error to prompt the developer to either change the code
or to use the -HV flag for backwards compatibility.
Fix HLSLVersion not initialized by default
Adds RewriterTest::RunArrayLength tests which is currently disabled until we have
a way to set HLSLVersion on RewriterTests.
Some HLSL features does not have direct mapping to SPIR-V, instead
we emulate them using lots of SPIR-V instructions. Because they
can cause performance hit, the compiler warns by default. This
commit add an option, -Wno-vk-emulated-features, to let developers
turn off such warnings.
Added a new command-line option: -fspv-debug=<category>, where
category can be file, source, line, and tool, to give developers
fine-grained control of what debug information they want in
the generated SPIR-V code.
If targeting Vulkan 1.1 & requesting debug information with -Zi,
two new OpModuleProcessed instruction will be emitted to contain
"dxc-commit-hash" & "dxc-commit-count".