Vertex programs works just fine, but when I try to bind a fragment program, the jvm crashes.
I load the following fragment program:
void mainf (
float4 iColor : COLOR,
out float4 oColor : COLOR )
{
oColor = iColor;
}
IE just a passthrough.
CgGL loads the program just fine and compiles it.
CgGL.cgGetProgramString(fragmentProgram, CgGL.CG_COMPILED_PROGRAM) shows the following:
// nvparse 1.0 output generated by NVIDIA Cg compiler
// cgc version 1.2.1001, build date Mar 17 2004 10:32:28
// command line args: -q -profile fp20 -entry mainf
//vendor NVIDIA Corporation
//version 1.0.02
//profile fp20
//program mainf
//var float4 iColor : $vin.COLOR : COLOR0 : 0 : 1
//var float4 oColor : $vout.COLOR : COLOR : 1 : 1
!!RC1.0
out.rgb = unsigned(col0.rgb);
out.a = unsigned(col0.a);
// 0 instructions
// End of program
Seems fine to me.
The rendering:
System.out.println("1");
CgGL.cgGLEnableProfile(fragmentProfile);
System.out.println("2");
CgGL.cgGLBindProgram(fragmentProgram);
System.out.println("3");
renderModel(gl, glu);
CgGL.cgGLDisableProfile(fragmentProfile);
The output:
1
2
An unrecoverable stack overflow has occurred.
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_STACK_OVERFLOW (0xc00000fd) occurred at PC=0x2E74587
Function=[Unknown.]
Library=C:\Program Files\NVIDIA Corporation\Cg\bin\cgGL.dll
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.
Current Java thread:
at net.java.games.cg.CgGL.cgGLBindProgram0(Native Method)
at net.java.games.cg.CgGL.cgGLBindProgram(CgGL.java:894)
at CgTest.display(CgTest.java:77)
at net.java.games.jogl.impl.GLDrawableHelper.display(GLDrawableHelper.java:74)
at net.java.games.jogl.GLCanvas$DisplayAction.run(GLCanvas.java:221)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:290)
- locked <0x100901b8> (a net.java.games.jogl.impl.windows.WindowsOnscreenGLContext)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:208)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:75)
at net.java.games.jogl.Animator$1.run(Animator.java:107)
at java.lang.Thread.run(Thread.java:534)
Vertex programs work just fine, and the Cg effects browser thingie works without crashing.
Has anyone gotten this to work?