You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When invoking dxc with a -D option to define a macro, on the way down the pipe from command line to defines recognized by the preprocessor, they get duplicated in the argument list. This causes them to show up twice in the debug information. They are also applied twice to the preprocessor, but it treats them exactly as if the same define was set twice with the same value and accepts it without complaint.
This can be observed by compiling tools/clang/test/HLSLFileCheck/dxil/debug/misc/share_mem_dbg.hlsl with the dxc invocation stipulated by the RUN: command. The CHECK: like indicates that DefineA and DefineB should show up once. When invoked by the test infrastructure, which skips the initial compile operations found in dxc.cpp, that's what happens, but when invoked directly from the command line, both defines are duplicated:
pow2clk
changed the title
User command line defines are duplicated in debug code and in preprocessor
User command line defines are duplicated in debug info and in preprocessor
Jan 31, 2020
pow2clk
added a commit
to pow2clk/DirectXShaderCompiler
that referenced
this issue
Jan 31, 2020
When defines are specified through the command line of dxc using -D
flags, they are added to a vector of defines passed into WrapCompile as
part of the adaptor of the Compiler3 interface to the old interface.
WrapCompile then packages them up into an argument list for the
Compiler3 interface, but since the argument list already contains the
defines, adding them from the define vector duplicates them.
This problem was solved for -E entry points and -T target profiles by
adding optional skipping of these arguments when they are found to be
present by another means. This mechanism is here extended to account for
defines as well.
Fixesmicrosoft#2673
When invoking dxc with a -D option to define a macro, on the way down the pipe from command line to defines recognized by the preprocessor, they get duplicated in the argument list. This causes them to show up twice in the debug information. They are also applied twice to the preprocessor, but it treats them exactly as if the same define was set twice with the same value and accepts it without complaint.
This can be observed by compiling tools/clang/test/HLSLFileCheck/dxil/debug/misc/share_mem_dbg.hlsl with the dxc invocation stipulated by the RUN: command. The CHECK: like indicates that DefineA and DefineB should show up once. When invoked by the test infrastructure, which skips the initial compile operations found in dxc.cpp, that's what happens, but when invoked directly from the command line, both defines are duplicated:
!71 = !{!"DefineA=1", !"DefineB=0", !"DefineA=1", !"DefineB=0"}
The text was updated successfully, but these errors were encountered: