Jump to content
  • Advertisement
Sign in to follow this  
yk_cadcg

[vs03,dx9] can't debug vs

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

hi, i step back to dx9 from dx10, since dx9+vs03 has shader debugger addin. but i can't debug vs -- i followed all "Getting Started Debugging Shaders (Direct3D 9)" entry says, such as dx control panel, SHADER_DEBUGGER, SWVP, . i can only step in ps, as below.
void vs(in float4 vert: POSITION,
		out float4 pos: POSITION)
{
	pos = mul(vert, matProj); //can't step into this
}

void ps(in float2 pix: VPOS,
		out int4 col : COLOR)
{
	if(pix.y > 0)
	col = int4(255, 255, 255, pix.x); //avoid skipping ps
}
unabling to debug vs is a long existing problem, i never got answer. thanks. vs's output info:
Quote:
Direct3D9: (INFO) :======================= Reference SWVP device selected 'Direct3D REF Device 1': Attached to debug monitor. 'Direct3D REF-owned HAL (SWVP) Device 1': Attached to debug monitor. D3DX: (INFO) Using SSE2 optimizations 'Direct3D REF-owned HAL (SWVP) Device 1': Loaded vertex shader 'vs' 'Direct3D REF Device 1': Loaded pixel shader 'ps'

Share this post


Link to post
Share on other sites
Advertisement
Have you tried using PIX for debugging your shaders? It's the preferred method these days, AFAIK.

Share this post


Link to post
Share on other sites
yes, but that doesn't answer my question. thanks.
Quote:
Original post by MJP
Have you tried using PIX for debugging your shaders? It's the preferred method these days, AFAIK.


Share this post


Link to post
Share on other sites
Which SDK are you using? If you're getting some debugging you might be using an old enough one, but the addin was part of the SDK in a broken form for a while before they removed it. Although I forget if it was only VS8 that it was broken for.

Are you getting any error messages? Are you 100% certain that VS is actually being used?

Share this post


Link to post
Share on other sites
A check-list for you:

1. Enable debug runtime
2. 'Enable Shaders Debugging' in the DX control panel
3. Create a software or reference IDirect3DDevice9 object
4. Compile the shader with the D3DXSHADER_DEBUG | D3DXSHADER_SKIPOPTIMIZATION
5. Launch the application from the Debug menu: 'Start With Direct3D Debugging'

This is old technology, and unless you have a good reason, you really should be using PIX.

Admiral

Share this post


Link to post
Share on other sites
i'm not certain that vs is being used. i don't know how to use vs rather than fixed function in dx9. i'm confused about SetFVF, such and such.
Good men please check where am i wrong, could you? bow.

V(D3DXCreateEffectFromFile(g_pd3dDevice, "1.fx", 0, 0, dwShaderFlags, 0, &g_pEffect, &err));
if( FAILED(g_pd3dDevice->CreateVertexBuffer(nS * sizeof(CUSTOMVERTEX), D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_DEFAULT , &g_pVBR, NULL))) return E_FAIL;
..
V(g_pd3dDevice->SetFVF( D3DFVF_CUSTOMVERTEX ));

IDirect3DDevice9::CreateVertexBuffer has an FVF para, but it's for fixed function. i'm crazy about it. i'm too tired to be clearminded now. bow



Quote:
Original post by jollyjeffers
Which SDK are you using? If you're getting some debugging you might be using an old enough one, but the addin was part of the SDK in a broken form for a while before they removed it. Although I forget if it was only VS8 that it was broken for.

Are you getting any error messages? Are you 100% certain that VS is actually being used?

Share this post


Link to post
Share on other sites
You're familiar with Direct3D 10 so just use D3D9's vertex declarations. They're much the same as with D3D10 if a little more limited, but a lot lot better than FVF's. There is no real reason to use FVF's in D3D9 anymore except for legacy code paths.

As for knowing if the VS is actually being used you need to know if any calls via the effect or device framework are failing. If you set (intentionally or unintentionally) a NULL vertex shader it'll skip your code and use FF instead.

hth
Jack

Share this post


Link to post
Share on other sites
the reason i can't debug vs is that i didn't use vs at all.
the reason for that is that i used FVF-related funcs below.
i haven't found any good samples, since dx sdk's examples all encapsulates a DXUT which is not suitable for gpgpu, while samples not using DXUT interface are all fixed function ones. Samples are important!
I found an old post of mine and followed some replier's suggestion to solve this problem. thanks to him and you very much.

///////////////////////

i'm trying to find samples that avoid using FVF while meantime using
V(D3DXCreateEffectFromFile(g_pd3dDevice, "1.fx", 0, 0, dwShaderFlags, 0, &g_pEffect, &err));

but i can't find. i'm still finding. thanks a lot lot.
Quote:
Original post by jollyjeffers
You're familiar with Direct3D 10 so just use D3D9's vertex declarations. They're much the same as with D3D10 if a little more limited, but a lot lot better than FVF's. There is no real reason to use FVF's in D3D9 anymore except for legacy code paths.

As for knowing if the VS is actually being used you need to know if any calls via the effect or device framework are failing. If you set (intentionally or unintentionally) a NULL vertex shader it'll skip your code and use FF instead.

hth
Jack


[Edited by - yk_cadcg on September 28, 2007 9:13:43 PM]

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!