Jump to content
  • Advertisement
Sign in to follow this  
giugio

pix and vertex debug

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

Hy. I'm not understand how work the debug of pix. There are part of the debug code that are reach and part not reach. For example: this code:
 VS_OUT VS(VS_IN vIn)
{
	VS_OUT vOut;
		
	float4x4 skinMatrix =
		RebuildSkinMatrix(vIn.blendIndices.x) * vIn.blendWeights.x +
		RebuildSkinMatrix(vIn.blendIndices.y) * vIn.blendWeights.y +
		RebuildSkinMatrix(vIn.blendIndices.z) * vIn.blendWeights.z;
	
	// Calculate local world matrix with help of the skinning matrix
	
	float4x4 localWorld = mul(gWorld, skinMatrix);
	float4 worldPos = mul(localWorld, float4(vIn.posL, 1));
	float4x4 mx0 = RebuildSkinMatrix(1);// the debug don't reach this code!!!!!!
	
        float4 m = float4(0,0,0,0);// the debug don't reach this code!!!!!!
	m = mx0[1];// the debug don't reach this code!!!!!!	
	vOut.posH = mul(worldPos, viewProj);
		
	//vOut.posW    = mul(float4(vIn.posL, 1.0f), gWorld);
	vOut.normalW = mul(mul(float4(vIn.normalL, 0.0f), gWorld), mx0);
	mx0 = mul(mx0,gWorld);

	//vOut.posH = mul(float4(vIn.posL, 1.0f), gWVP);
	vOut.posH = mul(worldPos, viewProj);
	
	// Output vertex attributes for interpolation across triangle.


why???? Thanks

Share this post


Link to post
Share on other sites
Advertisement
If this shader code is being compiled and interacted with using the effects framework then there are several flags etc that need defining when creating effects. Essentially, if you don't tell the compiler not to, it will reorder everything as and whe it sees fit.

Make sure your D3DXCreateEffectFromFile call looks something like the top one here:

#ifdef LUGRU_DEBUG_SHADERS
HRESULT result = D3DXCreateEffectFromFileA( m_Device, rPath.GetFullPath().c_str(), NULL, NULL, D3DXSHADER_DEBUG | D3DXSHADER_NO_PRESHADER | D3DXSHADER_OPTIMIZATION_LEVEL0 | D3DXSHADER_SKIPOPTIMIZATION | D3DXSHADER_SKIPVALIDATION, 0, &NewEffect, &pErrorBuffer );
#else
HRESULT result = D3DXCreateEffectFromFileA( m_Device, rPath.GetFullPath().c_str(), NULL, NULL, 0, 0, &NewEffect, &pErrorBuffer );
#endif

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!