Sign in to follow this  

why pix for windows can get hlsl code form D3DXCompileShaderFromFile?

This topic is 1618 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

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

This topic is 1618 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this