Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 09-13-05, 03:30 AM   #1
NolaHi
Registered User
 
Join Date: Sep 2005
Posts: 2
Default GLSL: program object assembly output?

Hello,

for Windows, the tool nvemulate have two options

Writing Program Object Assembly
Writing Program Object Source

Is there a way to get the assembly and/or source output from the drivers GLSL compiler under Linux? (environment variable? X option?...)


( i use linux driver 7667 currently...)

-Thomas Maier
NolaHi is offline   Reply With Quote
Old 09-13-05, 04:56 AM   #2
MacSlow
Registered User
 
MacSlow's Avatar
 
Join Date: Jul 2002
Location: Aachen, Germany
Posts: 76
Send a message via ICQ to MacSlow Send a message via AIM to MacSlow Send a message via MSN to MacSlow
Default Re: GLSL: program object assembly output?

Tag Thomas!

I'm not sure from which domain you intend to obtain GLSL-shader/assembly sources. If you want to get them from within your own program (source-code level) I assume you already have at least the GLSL-shader source But still there's a way to get it. For OpenGL 2.0 there is the call:

Code:
void glGetShaderSource (GLuint shader,
                        GLsizei bufSize,
                        GLsizei *length,
                        GLchar *source)
You can look up details for this call here.

Other than that you can use the cgc (the command-line Cg-compiler from nvidia) to create shader-assembly from your GLSL-shader sources. The latest version is Cg-1.4.0 and can be grabbed here.

Once you've installed that you can get nv shader-assembly for you GLSL-shaders with commands like those:

Code:
cgc -oglsl -profile fp30unlimited some_wicked_shader.frag
cgc -oglsl -profile vp30 some_wicked_shader.vert
The switch -oglsl makes cgc assume the input is GLSL-compliant code. Otherwise it defaults to Cg-shaders I guess. Also remember to chose the right profile for your targetted GPU-hardware. There are numerous shader-assembly targets you can choose from.

I hope that helps a bit.

Gruß...

MacSlow
__________________
First they ignore you...
then they laugh at you...
then they fight you...
then you win!
(Gandhi)
MacSlow is offline   Reply With Quote
Old 09-13-05, 06:41 AM   #3
NolaHi
Registered User
 
Join Date: Sep 2005
Posts: 2
Default Re: GLSL: program object assembly output?

Hi,

thanks for your answer.

I want to know, what code the integrated GLSL compiler produces with a given GLSL source, at best, vendor independent and without using another external compiler or tool! (Output something like ARB_vertex_program assembler instructions)
So glGetShaderSource() does not really help, it simply replies the code i supplied to GL.

Since (at least) the Nvidia Linux driver contains an Cg compiler in libGLcore.so, it should be possible to get the assembler output of the compile (as it is under Windows with the nvemulate tool), but how?

-Thomas
NolaHi is offline   Reply With Quote
Old 09-13-05, 09:26 AM   #4
MacSlow
Registered User
 
MacSlow's Avatar
 
Join Date: Jul 2002
Location: Aachen, Germany
Posts: 76
Send a message via ICQ to MacSlow Send a message via AIM to MacSlow Send a message via MSN to MacSlow
Default Re: GLSL: program object assembly output?

Quote:
Originally Posted by NolaHi
Since (at least) the Nvidia Linux driver contains an Cg compiler in libGLcore.so, it should be possible to get the assembler output of the compile (as it is under Windows with the nvemulate tool), but how?
I know of no means to either instruct the nvidia-driver-internal cgc to use a special profile for shader-assembly generation nor how to "intercept" the driver-generated shader-assembly code. According to my knowledge there are currently no external tools for this available under Linux from neither nvidia nor someone else.

I'm curious what you need such functionality for?

Best regards...

MacSlow
__________________
First they ignore you...
then they laugh at you...
then they fight you...
then you win!
(Gandhi)
MacSlow is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:34 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©1998 - 2014, nV News.