Jump to content
  • Advertisement
Sign in to follow this  

nvidia cgc 1.5 hangs??

This topic is 4412 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;

		uniform float4x3    mWorldMatrixArray[22],
		uniform float4x4 WorldViewProj)
    float3      Normal = 0.0f;    

    float i;        // Index into matrix palette

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

    float3 tempPos, tempNormal;
    // 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) * IN.Weights.x;
	tempNormal = mul(IN.Normal, (float3x3)mWorldMatrixArray) * IN.Weights.x;
    // Next bone.

    i = IN.Indices.y;

    // Add second transformed position and normal
    tempPos += mul(inPos, mWorldMatrixArray) * IN.Weights.y;
    tempNormal += mul(IN.Normal, (float3x3)mWorldMatrixArray) * IN.Weights.y;
    // 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) * IN.Weights.z;


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

    // 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
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.


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?

Share this post

Link to post
Share on other sites
I work on the NVIDIA Cg runtime team, I'll check into this.

My NVIDIA email is tgrimes@nvidia.com incase you have other Cg issues.


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.


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 need this shader in 1_1, but i can just compile it with 1.4.1 (and use the assembly), and use 1.5 for others or ? [grin]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!