cg Lives! Nvidia shader lang for PS3 :)

Makes sense for a console where the hardware is fixed and where they want to precisely control the compiler optimizations and language features from top to bottom. I find it unlikely that PS3 code will be very portable due to the nature of CELL anyway.
 
DOGMA1138 said:
and why is that a good thing? :oops:

When you have a closed platform, a vertically intergrated tool stack can have advantages that a heterogenous toolstack cannot.

Normally, this might cause concern because it would make it harder to develop titles that run on XBox2/PS3/NRev/PC, however, due to the hardware architecture of the PS3 (CELL), it is unlikely that any title optimized for CELL will port to the PC or Xbox2 very easily anyway. PS3 titles won't be portable, and using OGL HLSL or DX9 HLSL ain't gonna change it very much, since I think fundamentally, the multithreaded stream architecture will be different and a mismatch for PC ports.

So rather than maintain a fallacious "program once, port anywhere" stack, which doesn't save developers work anyway, may as well go bore for a highly device centric PS3/CELL API layer, with proprietary compiler, OS, that Sony can change at will, rather than try to get PS3 specific alterations through ARB, or come up with "nice" extensions to OGL-ES for PS3 that other people can use on other platforms.

Sony doesn't have time to do it the "nice" way, and they have little incentive to do so, for potentially no gain, and plenty of benefit (lock-in to PS3, more exclusives, fewer multiplatform titles)
 
Well, except that Cg is every bit as portable as GLSL or MS's HLSL, in some ways moreso. But it does make sense above those languages as:

1. The console clearly isn't going to be using any form of Direct3D.
2. Cg offers more low-level control than GLSL, giving developers better tools to work with.
3. GLSL doesn't make as much sense because its primary advantage is the lack of an intermediate assembly language, which (in theory) allows better optimization for compiling across a variety of machines. But when you're only writing for one machine this advantage evaporates (though I think it's definitely the direction that all HLSL's on the PC should move).
 
Chalnoth said:
3. GLSL doesn't make as much sense because its primary advantage is the lack of an intermediate assembly language, which (in theory) allows better optimization for compiling across a variety of machines. But when you're only writing for one machine this advantage evaporates (though I think it's definitely the direction that all HLSL's on the PC should move).
Yeah except you forget that some games get released on multiple platforms and their is no disadvantage aslong as you assume the compiler does a better job then the program at the machine level assembly.

2. Cg offers more low-level control than GLSL, giving developers better tools to work with.
Exactly what low level control do you want? most of the NV shader operation are almost exaclty map to equivilant PS3.0 instructions.
 
bloodbob said:
Yeah except you forget that some games get released on multiple platforms and their is no disadvantage aslong as you assume the compiler does a better job then the program at the machine level assembly.
Except that in that case, Cg is more portable than GLSL, as it'll map more easily to Microsoft's HLSL.

Exactly what low level control do you want? most of the NV shader operation are almost exaclty map to equivilant PS3.0 instructions.
Except the underlying hardware doesn't directly use the PS 3.0 instruction set. On a console you may want to do some tweaking at the most basic level.
 
Chalnoth said:
Except that in that case, Cg is more portable than GLSL, as it'll map more easily to Microsoft's HLSL.
How is Cg more portable? GLSL is completely platform independant as far as I know the Cg compiler currently only has profiles for NV_shaders,ARB assemble and the PS/VS assembly? So if you hardware can't run any of them your stuffed. Exactly which profile is Cg supposed to use for PS3?
Except the underlying hardware doesn't directly use the PS 3.0 instruction set. On a console you may want to do some tweaking at the most basic level.
Who says thats gonna be exposed currently there is no public Cg compiler that compiles directly to native hardware instruction so there is no reason to assume it is on the PS3 it will compile to the hardware level assembly.
 
bloodbob said:
Chalnoth said:
Except that in that case, Cg is more portable than GLSL, as it'll map more easily to Microsoft's HLSL.
How is Cg more portable? GLSL is completely platform independant
Do you think that Microsoft will allow an OpenGL driver for the XBox 2?
 
bloodbob said:
How is Cg more portable? GLSL is completely platform independant as far as I know
Except that I'm willing to bet that Microsoft isn't going to write a GLSL compiler for the X-Box 2.

the Cg compiler currently only has profiles for NV_shaders,ARB assemble and the PS/VS assembly? So if you hardware can't run any of them your stuffed. Exactly which profile is Cg supposed to use for PS3?
1. Anybody can write their own back-end to the compiler.
2. Since nVidia's developing a GPU for use in the PS3, you can bet that they'll also develop an appropriate target.
3. Cg currently supports targets for all assembly-language pixel/vertex shaders out there, except for ATI's proprietary R200 pixel shader and PS 1.4 in Direct3D.
 
Chalnoth said:
bloodbob said:
How is Cg more portable? GLSL is completely platform independant as far as I know
Except that I'm willing to bet that Microsoft isn't going to write a GLSL compiler for the X-Box 2.
I'm also betting they aren't gonna write a Cg Compiler back end either.

the Cg compiler currently only has profiles for NV_shaders,ARB assemble and the PS/VS assembly? So if you hardware can't run any of them your stuffed. Exactly which profile is Cg supposed to use for PS3?
1. Anybody can write their own back-end to the compiler.
So your suggesting the developers start writing the back-ends or would
they just use the one supplied by sony?
Cause why couldn't they just use say a GLSL compiler that comes with the hardware drivers/kernal?

2. Since nVidia's developing a GPU for use in the PS3, you can bet that they'll also develop an appropriate target.
And that makes it MORE portable how? Its gonna make it less portable.

3. Cg currently supports targets for all assembly-language pixel/vertex shaders out there, except for ATI's proprietary R200 pixel shader and PS 1.4 in Direct3D.
Does that include the emotion engine on the PS2?
 
bloodbob said:
Chalnoth said:
bloodbob said:
How is Cg more portable? GLSL is completely platform independant as far as I know
Except that I'm willing to bet that Microsoft isn't going to write a GLSL compiler for the X-Box 2.
I'm also betting they aren't gonna write a Cg Compiler back end either.
They didn't for Windows, either; it's not necessary. The compiler can be included in a DLL or in the executable shipped with the game. The shader gets compiled by Cg into DirectX assembler shader code and tossed to the API.
 
Ostsol said:
They didn't for Windows, either; it's not necessary. The compiler can be included in a DLL or in the executable shipped with the game. The shader gets compiled by Cg into DirectX assembler shader code and tossed to the API.
Hows that any better then Just tossing shader code directly into an API? your just adding an additional layer and potentially removing higher level optimisations.

Microsoft didn't write a GLSL for windows either yet it clearly works for both ATI and NV. Well okay I guess you could say you don't need drivers for Cg to work on windows but of course thats only true because microsoft wrote a reference render.
 
bloodbob said:
Ostsol said:
They didn't for Windows, either; it's not necessary. The compiler can be included in a DLL or in the executable shipped with the game. The shader gets compiled by Cg into DirectX assembler shader code and tossed to the API.
Umm A) the XBOX-2 isn't even out yet B) How does that any better then Just tossing shader code directly into an API?
A) When it is out -- or actually, when the SDK is out, it is possible that NVidia will write a backend for Cg to support whatever shader spec the XBox 2 supports.

B) Well, it is true that one could simply ship pre-compiled ASM with the game. Either way, it originally came from Cg. Chalnoth's point, as I see it, is that with GLSL you don't get either option since the existing compilers map directly to the internal instruction codes used by the hardware.
 
Ostsol said:
bloodbob said:
Ostsol said:
They didn't for Windows, either; it's not necessary. The compiler can be included in a DLL or in the executable shipped with the game. The shader gets compiled by Cg into DirectX assembler shader code and tossed to the API.
Umm A) the XBOX-2 isn't even out yet B) How does that any better then Just tossing shader code directly into an API?
A) When it is out -- or actually, when the SDK is out, it is possible that NVidia will write a backend for Cg to support whatever shader spec the XBox 2 supports.

B) Well, it is true that one could simply ship pre-compiled ASM with the game. Either way, it originally came from Cg. Chalnoth's point, as I see it, is that with GLSL you don't get either option since the existing compilers map directly to the internal instruction codes used by the hardware.
A) When it is out -- or actually, when the SDK is out, it is possible that ATI will write a backend for GLSL to support whatever shader spec the XBox 2 supports.

But how does B) make things less platform dependant? with Cg you have to select a profile for each platform and produce multiple pre-compiled assembly and everytime a new platform come out you have to recompile. With GLSL you don't have to do this.

Its comparble to saying C is more platform independant then perl. Because you have to recompile all your programs for every different chip but with perl you just run it.
 
bloodbob said:
Microsoft didn't write a GLSL for windows either yet it clearly works for both ATI and NV. Well okay I guess you could say you don't need drivers for Cg to work on windows but of course thats only true because microsoft wrote a reference render.
Wrong. Cg works in Windows because it compiles down to existing low-level shader languages. It is a layer separate from the API and the display drivers.

GLSL works in Windows because the compiler is built into IHVs' video drivers. If ATI is permitted to write an OpenGL driver for the XBox 2, then everything could work as you wish. However, that is a question already asked previously: do you think Microsoft will allow it? Cg works because it does not require Microsoft or ATI to write support for it.
 
Back
Top