Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

why pix for windows can get hlsl code form D3DXCompileShaderFromFile?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
6 replies to this topic

#1 db123   Members   

222
Like
0Likes
Like

Posted 11 August 2013 - 04:58 AM

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 ~~



#2 Hodgman   Moderators   

50655
Like
3Likes
Like

Posted 11 August 2013 - 06:47 AM

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.



#3 db123   Members   

222
Like
0Likes
Like

Posted 11 August 2013 - 06:53 AM

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?



#4 Hodgman   Moderators   

50655
Like
0Likes
Like

Posted 11 August 2013 - 07:20 AM

I'm not sure about that in D3DX. Look into FXC.exe and D3DCompile.



#5 NightCreature83   Members   

4952
Like
0Likes
Like

Posted 11 August 2013 - 08:54 AM

I'm not sure about that in D3DX. Look into FXC.exe and D3DCompile.

You can atleast with FXC i believe it is the /Zi flag

 


Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max


#6 Adam_42   Members   

3587
Like
0Likes
Like

Posted 11 August 2013 - 04:16 PM

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().



#7 Jason Z   Members   

6430
Like
0Likes
Like

Posted 12 August 2013 - 04:53 AM

If you are trying to implement some debugging routines, I'm sure the tracing API will be interesting for you.






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.