PDA

View Full Version : link error - not accessible in profile



skvinay
11-23-2005, 10:39 AM
Hello,

A very dummy program gives the following error:

Fragment info
-------------
(0) : error C5052: gl_Vertex is not accessable in this profile
(0) : error C5052: gl_Position is not accessable in this profile

What could i be doing wrong ?

Thanks

jide
11-23-2005, 11:12 AM
Can you say more things, like posting your dummy sources ?

skvinay
11-23-2005, 11:22 AM
Hi,

Here is my vertex program:


"\
void main()\n\
{\n \
gl_Position = ftransform();\n\
}\n\
"My fragment program:


"\
void main()\n\
{\n\
gl_FragColor = vec4(0.4,0.4,0.8,1.0);\n\
}\n\
"My function call is:

glLinkProgram( m_Program );

where m_Program is the program id

On a NVidia GO 6800 card, I get the error:

Fragment info
-------------
(0) : error C5052: gl_Vertex is not accessable in this profile
(0) : error C5052: gl_Position is not accessable in this profile

On a fx 5900, I get a more verbose error:

Vertex info
-----------
Internal error: assembly compile error for vertex shader at offset 336:
-- error message --
line 14, column -30: error: program doesn't write any result registers
-- internal assembly text --
!!VP2.0
# cgc version 1.5.0000, build date Nov 4 2005 18:26:39
# command line args:
#vendor NVIDIA Corporation
#version 1.0.02
#profile vp30
#program main
#semantic gl_ModelViewProjectionMatrixTranspose
#var float4 gl_Vertex : $vin.ATTR0 : ATTR0 : -1 : 1
#var float4x4 gl_ModelViewProjectionMatrixTranspose : : c[0], 4 : -1 : 1
BB1:
END
# 0 instructions, 0 R-regs
Fragment info
-------------
(0) : error C5052: gl_Vertex is not accessable in this profile
(0) : error C5052: gl_Position is not accessable in this profile

I hope someone has some idea on whats wrong.

Thanks,

sqrt[-1]
11-23-2005, 09:41 PM
If you post a exe I'll have a look.
I bet you are incorrectly supplying the strings to OpenGL...

Relic
11-23-2005, 11:51 PM
Looks like the compiler generated empty programs.
If that is C you don't need to put \ at the end of lines to concatenate strings, just put " " around each line.
You can use glGetShaderSource to see if source strings OpenGL has are what you think you sent.

jide
11-24-2005, 02:55 AM
Just to ensure (sorry if it's so easy, but we never know), did you well compiled the shaders first before linking them ?

(sorry again if that's noway)

skvinay
11-24-2005, 12:08 PM
Hi folks,

I got past that :) So now I am storing programs as strings in classes.

I have to declare



private:
static const char* vertexShader;
static const char* fragmentShader;
and fill it up in the cpp file. If I try to init in header, things mess up.

Thanks all.