I've just got an old OpenGL(2.1)/Cg(3.1) code, which I should improve, particularly a deferred shading rendering , where I want to change the kernel of one of the passes.

I'm adding GLSL(3.30) As I'm much more habituated. It seems to work, but I'm wondering if it could be some performance impact mixing up both (GLSL/Cg). In other words, the generated asm code should completely homogeneous?

有帮助吗?

解决方案

You can't mix GLSL and Cg in a single shader, but in different shaders, it should work fine. The Cg code just gets translated to GLSL anyways (unless you're using an Nvidia driver, in which case it may get translated directly to shader asm code). You can look at the GLSL code generated by the Cg compiler if you want to see if its doing anything odd that might be inefficient.

其他提示

You should be able to run cgc as a pre-processor on your Cg code and have it output GLSL, in a pinch! Use the -profile option to select GLSL.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top