GLSL - Compile time check for OpenGL 2.0?

Phil Costin philcostin at hotmail.com
Sun Apr 23 04:13:14 CDT 2006


Hi,

Let me introduce myself, I'm a final year student of Software Engineering
from the UK and I'm beginning to take more of an active interest in Wine. I
believe that one of the main reasons people stick with Windows over Linux
or BSD is because they miss their games. I have an interest in OpenGL and
Direct3D and would be interested in helping to get the Shader code up to a
nice level of functionality. This is no small task and I'm still figuring
things out. It seems we still need a HLSL to GLSL translator for SM 3.0 but
that is for future discussion :)

I have noticed that at the moment, shaders are parsed and converted to
AFP_FP/VP 1 and if a particular opcode is not supported, a FIXME states a
requirement for GLSL.

I was curious as to whether it would be acceptable to provide a compile-time
check for OpenGL 2.0? It would be no different than checking for any other
dependency, with the only disadvantage being that we can not be sure which
version the user has when distributing binaries. We could get by this by
distributing binaries for ARB_vertex_program and ARB_fragment_program 1
support and requiring a compile for users who want OpenGL 2.0
functionality.

I think it would have to be compile-time because we need to know whether we
can use the GL 2.0 shader methods at that point.

If it is supported, we could then leave the current code in place for OpenGL
< 2.0 Then we could use "#ifdef GL_VERSION_2" or similar to allow linking
to the GL 2.0 shader loading interfaces and define and make use of a
function to convert the shader ASM for versions less than 2.0 straight to
GLSL at runtime, skipping the current issue of beginning to convert to ARB
shaders, hitting a GLSL-requiring opcode and having to start again with
GLSL.

I could have this all wrong so a little guidance and feedback on the
proposal would be very helpful!

Kind Regards,
Phil Costin




More information about the wine-devel mailing list