The MSDN HLSL reference states this about printf:
"Submits a custom shader message to the information queue."
https://msdn.microsoft.com/en-us/library/windows/desktop/ff728755%28v=vs.85%29.aspx
What is the information queue and how can I see the shader message? Does it mean that when used in pixel shader it will output width*height (screen pixels) messages?
Thanks!
It can be used for shader tracing, basically. The D3D11_TRACE_STEP structure can help you get the message passed by printf from HLSL, an example would be the following, which seems okay at first glance (although written in D) :
https://github.com/evilrat666/directx-d/blob/master/src/directx/d3d11shadertracing.d
Can be used together with this interface to access the tracing information :
https://msdn.microsoft.com/en-us/library/windows/desktop/hh446840(v=vs.85).aspx
Disclaimer : this is just what I found researching the topic, so I cannot provide actual code example. For debugging shaders I would rather advise using Renderdoc or the VS Graphics Debugger
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With