@@ -18,7 +18,7 @@ debugging capabilities of hlsl coding in game, application and driver developmen
1818
1919The dxil counterpart spirv has a similar feature,
2020[ NonSemantic.DebugPrintf extention] ( https://github.com/KhronosGroup/SPIRV-Registry/blob/main/nonsemantic/NonSemantic.DebugPrintf.asciidoc )
21- to generate DebugPrintf spirvOp souced from hlsl/glsl. Based on the spirvOp
21+ to generate DebugPrintf spirvOp sourced from hlsl/glsl. Based on the spirvOp
2222extention, some vendor drivers and Valve lunarG has
2323[ debug printf layer] ( https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/main/docs/debug_printf.md )
2424to dump printf expression, "hlsl/glsl variables" into stdio or file.
@@ -65,22 +65,16 @@ will be a variable arguments function.
6565
6666## Detailed design
6767
68- 1 . The printf dxil op will be purely for debug purpose, it does not affect final hlsl
69- code/algorithm in any way.
70- To separate this kind of debug-purpose dxil ops to the normal non-debug dxil il ops,
71- the debug printf dxil op code can be counted down from 0xffff, or 0xffffffff,
72- e.g. op code is 0xfffe.
73- So it will give a hint to the d3d debug layer to pick up debug printf dxil easily,
74- or a underlying d3d driver to remove these dxil op codes safely.
75- 2 . Add a option to enable printf dxil op generation to dxc, try to separate hlsl code for debugging
76- and for production, if printf option is disabled, the printf in hlsl will be report a error
77- 3 . We should not support dynamic string variable, a string variable content.
78- retrieved from buffer. The string variable should be explicited defined and can
68+ 1 . Add a option to enable printf dxil op generation to dxc, try to separate hlsl code
69+ for debugging purpose and for production purpose. The printf option is disabled by default,
70+ and the printf instructions in hlsl will be report a error without a printf option.
71+ 2 . We should not support dynamic string variable, a string variable content.
72+ retrieved from buffer. The string variable should be explicitly defined and can
7973be retrieved directly/indirectly from global constant variable.
80- 4 . The format string input to the dx.hl.op..void, could be llvm constant
74+ 3 . The format string input to the dx.hl.op..void, could be llvm constant
8175expression, we need to retrieve global variable from the constant expression.
82- 5 . The validation for the dxil overloading checking should be ignored. Because
76+ 4 . The validation for the dxil overloading checking should be ignored. Because
8377of printf variable arguments, there is no definite function type can be validated.
84- 6 . dxc does not valiate format specifier to the c/c++ format speicifer standard, or the matching relation between
85- format specifier and argument. If the number and type don't match, they will produce undefined result from
86- a underlying d3d driver or a debug driver
78+ 5 . dxc will validate matching relation between format specifiers and arguments.
79+ If the number of arguments and number of format specifiers mismatch, dxc will
80+ produce error messages, If their types mismatch, dxc will report a warning messages.
0 commit comments