Jump to content

  • Log In with Google      Sign In   
  • Create Account


SetTechnique does more then I want...


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 cozzie   Members   -  Reputation: 1540

Like
0Likes
Like

Posted 28 January 2013 - 05:18 PM

Hi,

 

Through profiling with PIX, I found out that a specific techniqe in my shader is executed, although I don't call it from my code.

 

I have a function in my code that sets a technique:

 

bool CD3d::SetShaderTechnique(CD3dscene *pD3dscene, int pEffectIndex, char *pTechnique)
{
	if(D3DERR_INVALIDCALL == pD3dscene->mEffect[pEffectIndex]->SetTechnique(pTechnique)) return false;
	return true;
}

Searched through whole source if I use SetTechnique somewhere else, not the case.

When I run my code and debug on this line, it's only called with technique 'OpaqueShader', but in PIX I see the render states, settechnique etc. of my 2nd technique in the shader. I also overwritten 'pTechnique' but 'OpaqueShader' to test, no difference. Filling in 'testbla' I get correct error handling that the technique doesn't exist.

 

Am I overseeing something, is D3DX effect doing somethin I don't know?

 

Here are the 2 techniques:

 

/***********************************************************/
/**          OPAUQE SHADER, REGULAR MESHES         *********/
/***********************************************************/

technique OpaqueShader
{
    pass P0              
    {
        AlphaBlendEnable    = FALSE;
                              
        VertexShader = compile vs_2_0 VS_function();
        PixelShader = compile ps_2_0 PS_function();
    }  
}

/***********************************************************/
/**   BLENDING SHADER, MESHES WITH BLENDED TEXTURES  *******/
/***********************************************************/

technique BlendingShader
{
    pass P0              
    {
        AlphaBlendEnable    = TRUE;
        SrcBlend            = SRCALPHA;
        DestBlend           = INVSRCALPHA;
        AlphaOp[0]          = SelectArg1;
        AlphaArg1[0]        = Texture;
                               
        VertexShader = compile vs_2_0 VS_function();
        PixelShader = compile ps_2_0 PS_function();
    }  
}

 



Sponsor:

#2 cozzie   Members   -  Reputation: 1540

Like
0Likes
Like

Posted 29 January 2013 - 12:52 PM

Found it, i was running a 2nd effect which had one of the similar states as the technique i didn't expect in the initial/1st one




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