Jump to content
  • Advertisement
Sign in to follow this  
db123

why pix for windows can get hlsl code form D3DXCompileShaderFromFile?

This topic is 1948 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

when i load hlsl shader file to memory, and then create shader by 

D3DXCompileShader

pix only display asm code at its debugger.

 

if i use 

D3DXCompileShaderFromFile

,it display hlsl.

so i want to know how does it do this or how to make it display hlsl code when i use D3DXCompileShader?

thank you ~~

Share this post


Link to post
Share on other sites
Advertisement

When you use the D3DXSHADER_DEBUG flag, the compiled shader will contain line numbers and file names that the debugger can use to display the corresponding source code for each asm instruction.

e.g. the debugger knows that when it's executing asm instruction #47, it should display line #3 from c:\projects\shader.hlsl.

 

If you're compiling the code from memory, there's no meaningful filenames that can be embedded into the shader code.

Share this post


Link to post
Share on other sites

When you use the D3DXSHADER_DEBUG flag, the compiled shader will contain line numbers and file names that the debugger can use to display the corresponding source code for each asm instruction.

e.g. the debugger knows that when it's executing asm instruction #47, it should display line #3 from c:\projects\shader.hlsl.

 

If you're compiling the code from memory, there's no meaningful filenames that can be embedded into the shader code.

 

can i call some interface to tell him where is the source code or the content of that file?

Share this post


Link to post
Share on other sites

You could always add some debug code that saves the buffer out to a file (named based on say a hash of the source code), and compiles it from there using D3DXCompileShaderFromFile().

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!