Sign in to follow this  

nvidia cgc 1.5 hangs??

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

I have a vertex shader that compiles without problems with cgc 1.4.1 but when i try to compile it with cgc 1.5 (beta 1 or 2), cgc hangs (100% cpu) and never compiles the program, it only output the name of the input file and stops there without ever finishing, im using vs_1_1 cgc 1.4.1 doesnt have any profileopts for it cgc 1.5 has a profileopt for max constant register, which i set to 255 any ideas??? :( :( here is the program (not mine)
struct VS_INPUT
{
    float3  Position   : POSITION;
    float3  Normal     : NORMAL;
    float2  Tex0       : TEXCOORD0;
    float4  Weights    : TEXCOORD1;
    float4  Indices    : TEXCOORD2;    
};

struct VS_OUTPUT
{
    float4  Pos     : POSITION;
    float3  Diffuse : COLOR;
    float2  Tex0    : TEXCOORD0;
};


VS_OUTPUT main(VS_INPUT IN,
		uniform float4x3    mWorldMatrixArray[22],
		uniform float4x4 WorldViewProj)
{
    VS_OUTPUT   OUT;
    float3      Normal = 0.0f;    

    float i;        // Index into matrix palette

    float4 inPos;
    inPos.xyz = IN.Position;
    inPos.w = 1;

	
    float3 tempPos, tempNormal;
	
	
    /////////////////////////////////////////////////////////////////////
    // FIRST BONE
    // We don't worry about the ELSE condition because we defined the 
    // initial conditions.

    // grab first bone matrix
    i = IN.Indices.x;

	
    // First transformed position and normal
    tempPos = mul(inPos, mWorldMatrixArray[i]) * IN.Weights.x;
	tempNormal = mul(IN.Normal, (float3x3)mWorldMatrixArray[i]) * IN.Weights.x;
	
	
    /////////////////////////////////////////////////////////////////////
    // SECOND BONE
    // Next bone.

    i = IN.Indices.y;

		
    // Add second transformed position and normal
    tempPos += mul(inPos, mWorldMatrixArray[i]) * IN.Weights.y;
    tempNormal += mul(IN.Normal, (float3x3)mWorldMatrixArray[i]) * IN.Weights.y;
	
    /////////////////////////////////////////////////////////////////////
    // THIRD BONE
    // Note we only skin the normal by the first two bones, these are by 
    // far the most significant.

	i = IN.Indices.z;

	// Add third transformed position only
	tempPos += mul(inPos, mWorldMatrixArray[i]) * IN.Weights.z;

	/////////////////////////////////////////////////////////////////////
	// FOURTH BONE

	i = IN.Indices.w;
                
	// Add fourth transformed position only
	tempPos += mul(inPos, mWorldMatrixArray[i]) * IN.Weights.w;
	
	
    // normalize normals
	Normal = normalize(tempNormal);
	//OUT.Diffuse.xyz = max(dot(Normal, lhtDir), 0).xxx;
	OUT.Diffuse.x=1;
	OUT.Diffuse.y=1;
	OUT.Diffuse.z=1;


    // copy the input texture coordinate through
    OUT.Tex0  = IN.Tex0.xy;

    float4 finalPos;
    finalPos.xyz = tempPos;
    finalPos.w = 1;
    
	// Transform the final skinned position
    OUT.Pos = mul(finalPos, WorldViewProj);
		
	
    return OUT;
}

Share this post


Link to post
Share on other sites
Quote:
Original post by PinkFish
bump. is my question that stupid ??? [bawling][bawling][bawling]


Well cg 1.5 IS still in beta-phase, you might wanna report this to nVidia. I bet that this shader is too complicated for vs_1_1 profile, I tested this on linux and it hanged on me too. Worked with vs_2_0 profile though.

ch.

Share this post


Link to post
Share on other sites
ah thanx a lot for trying it out!

this shader was writting with vs_1_1 in mind (at least that what the author says)
and it compiles ok with vs_1_1 with cgc 1.4.1 as i mentioned b4.

do u think it makes sense reporting it to nvidia? (will they even look at it?)

and whats the best way to do that? their developer feedback form?
clicky

Share this post


Link to post
Share on other sites
Ok I see what you mean.

With the latest code we have as of RIGHT NOW, I don't get a hang but the compiler does give an assertion about "profile does not support spilling."

Since I don't work on the compiler I'm not 100% sure what they mean by that, but I'll file a bug report since I can see, like you say, it does work in 1.4.1.

For now you'll have to use vs_2_0 or higher since compilation works fine in those profiles.


Thanks.

Share this post


Link to post
Share on other sites
If 1.4 does everything you need then you can stick with it for a while longer. Or you could stay with 1.5 and not use vs_1_1, but instead 2_0 or higher as long as that's an option for you.

However, 1.5 improved the D3D9 runtime A LOT so if you're using D3D9, it would be best to use 1.5 if possible.

Share this post


Link to post
Share on other sites
I encountered similar problems under OSX, where Cg would simply stop for no apparent reason with a vertex shader. I don't remember the details though, and I think I may have deleted the test case.

Share this post


Link to post
Share on other sites
Anohter question about 1.5.

in 1.4.1 vs_2_x has the following options

--------------------------------------
vs_2_x profileopts:
DynamicFlowControlDepth=<0 or 24>
NumTemps=<12 to 32>
Predication=<0 or 1>
-------------------------------------


which is ok,
but in 1.5.1 beta2, it is:

-------------------------------------
vs_2_x profileopts:
DynamicFlowControlDepth=<0 or 24>
NumTemps=<12 to 32>
MaxLocalParams=<n>
-------------------------------------

where did predication go? and what is MaxLocalParams? i cant 'find' it in D3DCAPS9.

Share this post


Link to post
Share on other sites
Promit,

We have a page with updated binaries that may have fixed your OSX problem (I can't say for sure though). Here is the link http://developer.nvidia.com/object/cg-redistributable-binaries.html

These fix issues from beta 2 and should be downloaded by everyone who has installed the beta 2 toolkit.


PinkFish,

I'll find out from the compiler group why this change was made.


Thanks.

Share this post


Link to post
Share on other sites
No, sorry. I don't know why I haven't heard back from the compiler team. I guess I'll send my email again to someone else. I sent it to the cgc manager but maybe he's off on vacation or something...

Share this post


Link to post
Share on other sites

This topic is 4105 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this