Jump to content

  • Log In with Google      Sign In   
  • Create Account

Visual 2013 problem with debugging shader


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
1 reply to this topic

#1 kolarz3   Members   -  Reputation: 164

Like
0Likes
Like

Posted 31 May 2014 - 10:11 AM

Hello guys, I try to use brakepoint in my shader file but visual tell me that he didnt see file with flags to debuging. I comppile shader with:

D3DCompile(buffer.data(), buffer.size(), NULL, NULL, NULL, mainFucName, "ps_5_0", D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION, NULL, &PS_Buffer, &errorPS);

In hlsl proporties in both shaders is enable debugging information and shader verision is 5_0.

Project: http://www.dropbox.com/s/0wgbjqdxgvi2g1o/DirectXTest.rar

 



Sponsor:

#2 spazzarama   GDNet+   -  Reputation: 819

Like
1Likes
Like

Posted 31 May 2014 - 11:45 PM

VS can't work out which file your shader belongs to.

 

In your ShaderEngine.cpp

 

Change line 13 from:

hr = D3DCompile(buffer.data(), buffer.size(), NULL, NULL, NULL, mainFucName, "vs_5_0", D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION, NULL, &VS_Buffer, &errorVS);

to

hr = D3DCompile(buffer.data(), buffer.size(), name, NULL, NULL, mainFucName, "vs_5_0", D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION, NULL, &VS_Buffer, &errorVS);

then do the same for your pixel shader compiler function.

 

That worked for me with your sample (passing name into the pSourceName parameter). Not very intuitive smile.png


Edited by spazzarama, 01 June 2014 - 03:00 AM.

Justin Stenning | Blog | Book - Direct3D Rendering Cookbook (using C# and SharpDX)

Projects: Direct3D Hook, EasyHookAfterglow, C#raft

@spazzarama

 




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.



PARTNERS