Pergunta

Estou tentando descobrir como depurar os shaders de pixel e vértice no DirectX, tentei usar o PIX para Windows, mas acho que é bastante buggy e efetivamente não operacional. Existe uma alternativa que me permitiria depurar esses shaders dentro do meu próprio aplicativo?

Foi útil?

Solução

I don't know of any third party tool for debugging hlsl-shaders, but I had good experiences with debugging it by using some simple techniques.

You could just copy render targets on cpu and store it into a bitmap, print it out to the terminal, or access it in your CPU debugger.

If there is a bug, you should first check whether the buffers you use really have the right values, at the beginning it can happen often that some textures are created with wrong parameters or the data is expected in another order ... in my experience this is a common error-source.

Outras dicas

In short, no.

Yes pix is a bit buggy but has improved MASSIVELY since its first release. Make sure you are running the latest SDK!

Just output debug information as color. For example you can output 255*(normal+1) as r,g,b, you can output some intermediate shader variable as color, or you can check if it is within the bounds in the shader and output white if it is and black if it's not. That usually help.

PIX for Windows comes with the DirectX SDK (from June 2010 I can verify) and will allow you to visually debug what you are setting state wise and allow you to step through your shaders line by line. Its a life saver.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top