diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp index 46d62a55e..ac4828c21 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp @@ -280,7 +280,6 @@ PFNGLLINKPROGRAMPROC nglLinkProgram; PFNGLSHADERSOURCEPROC nglShaderSource; PFNGLUSEPROGRAMPROC nglUseProgram; PFNGLVALIDATEPROGRAMPROC nglValidateProgram; - PFNGLUNIFORM1FPROC nglUniform1f; PFNGLUNIFORM2FPROC nglUniform2f; PFNGLUNIFORM3FPROC nglUniform3f; @@ -301,7 +300,6 @@ PFNGLUNIFORMMATRIX2FVPROC nglUniformMatrix2fv; PFNGLUNIFORMMATRIX3FVPROC nglUniformMatrix3fv; PFNGLUNIFORMMATRIX4FVPROC nglUniformMatrix4fv; PFNGLVERTEXATTRIBPOINTERPROC nglVertexAttribPointer; - PFNGLUNIFORM1UIPROC nglUniform1ui; PFNGLUNIFORM2UIPROC nglUniform2ui; PFNGLUNIFORM3UIPROC nglUniform3ui; @@ -311,6 +309,68 @@ PFNGLUNIFORM2UIVPROC nglUniform2uiv; PFNGLUNIFORM3UIVPROC nglUniform3uiv; PFNGLUNIFORM4UIVPROC nglUniform4uiv; +// GL_ARB_separate_shader_objects +PFNGLUSEPROGRAMSTAGESPROC nglUseProgramStages; +PFNGLACTIVESHADERPROGRAMPROC nglActiveShaderProgram; +PFNGLCREATESHADERPROGRAMVPROC nglCreateShaderProgramv; +PFNGLBINDPROGRAMPIPELINEPROC nglBindProgramPipeline; +PFNGLDELETEPROGRAMPIPELINESPROC nglDeleteProgramPipelines; +PFNGLGENPROGRAMPIPELINESPROC nglGenProgramPipelines; +PFNGLISPROGRAMPIPELINEPROC nglIsProgramPipeline; +PFNGLGETPROGRAMPIPELINEIVPROC nglGetProgramPipelineiv; +PFNGLPROGRAMUNIFORM1IPROC nglProgramUniform1i; +PFNGLPROGRAMUNIFORM1IVPROC nglProgramUniform1iv; +PFNGLPROGRAMUNIFORM1FPROC nglProgramUniform1f; +PFNGLPROGRAMUNIFORM1FVPROC nglProgramUniform1fv; +PFNGLPROGRAMUNIFORM1DPROC nglProgramUniform1d; +PFNGLPROGRAMUNIFORM1DVPROC nglProgramUniform1dv; +PFNGLPROGRAMUNIFORM1UIPROC nglProgramUniform1ui; +PFNGLPROGRAMUNIFORM1UIVPROC nglProgramUniform1uiv; +PFNGLPROGRAMUNIFORM2IPROC nglProgramUniform2i; +PFNGLPROGRAMUNIFORM2IVPROC nglProgramUniform2iv; +PFNGLPROGRAMUNIFORM2FPROC nglProgramUniform2f; +PFNGLPROGRAMUNIFORM2FVPROC nglProgramUniform2fv; +PFNGLPROGRAMUNIFORM2DPROC nglProgramUniform2d; +PFNGLPROGRAMUNIFORM2DVPROC nglProgramUniform2dv; +PFNGLPROGRAMUNIFORM2UIPROC nglProgramUniform2ui; +PFNGLPROGRAMUNIFORM2UIVPROC nglProgramUniform2uiv; +PFNGLPROGRAMUNIFORM3IPROC nglProgramUniform3i; +PFNGLPROGRAMUNIFORM3IVPROC nglProgramUniform3iv; +PFNGLPROGRAMUNIFORM3FPROC nglProgramUniform3f; +PFNGLPROGRAMUNIFORM3FVPROC nglProgramUniform3fv; +PFNGLPROGRAMUNIFORM3DPROC nglProgramUniform3d; +PFNGLPROGRAMUNIFORM3DVPROC nglProgramUniform3dv; +PFNGLPROGRAMUNIFORM3UIPROC nglProgramUniform3ui; +PFNGLPROGRAMUNIFORM3UIVPROC nglProgramUniform3uiv; +PFNGLPROGRAMUNIFORM4IPROC nglProgramUniform4i; +PFNGLPROGRAMUNIFORM4IVPROC nglProgramUniform4iv; +PFNGLPROGRAMUNIFORM4FPROC nglProgramUniform4f; +PFNGLPROGRAMUNIFORM4FVPROC nglProgramUniform4fv; +PFNGLPROGRAMUNIFORM4DPROC nglProgramUniform4d; +PFNGLPROGRAMUNIFORM4DVPROC nglProgramUniform4dv; +PFNGLPROGRAMUNIFORM4UIPROC nglProgramUniform4ui; +PFNGLPROGRAMUNIFORM4UIVPROC nglProgramUniform4uiv; +PFNGLPROGRAMUNIFORMMATRIX2FVPROC nglProgramUniformMatrix2fv; +PFNGLPROGRAMUNIFORMMATRIX3FVPROC nglProgramUniformMatrix3fv; +PFNGLPROGRAMUNIFORMMATRIX4FVPROC nglProgramUniformMatrix4fv; +PFNGLPROGRAMUNIFORMMATRIX2DVPROC nglProgramUniformMatrix2dv; +PFNGLPROGRAMUNIFORMMATRIX3DVPROC nglProgramUniformMatrix3dv; +PFNGLPROGRAMUNIFORMMATRIX4DVPROC nglProgramUniformMatrix4dv; +PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC nglProgramUniformMatrix2x3fv; +PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC nglProgramUniformMatrix3x2fv; +PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC nglProgramUniformMatrix2x4fv; +PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC nglProgramUniformMatrix4x2fv; +PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC nglProgramUniformMatrix3x4fv; +PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC nglProgramUniformMatrix4x3fv; +PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC nglProgramUniformMatrix2x3dv; +PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC nglProgramUniformMatrix3x2dv; +PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC nglProgramUniformMatrix2x4dv; +PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC nglProgramUniformMatrix4x2dv; +PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC nglProgramUniformMatrix3x4dv; +PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC nglProgramUniformMatrix4x3dv; +PFNGLVALIDATEPROGRAMPIPELINEPROC nglValidateProgramPipeline; +PFNGLGETPROGRAMPIPELINEINFOLOGPROC nglGetProgramPipelineInfoLog; + // NV_occlusion_query NEL_PFNGLGENOCCLUSIONQUERIESNVPROC nglGenOcclusionQueriesNV; NEL_PFNGLDELETEOCCLUSIONQUERIESNVPROC nglDeleteOcclusionQueriesNV; @@ -974,6 +1034,74 @@ static bool setupGLSL( const char *glext ) return true; } +static bool setupSeparateShaderObjects( const char *glext ) +{ + CHECK_EXT( "GL_ARB_separate_shader_objects" ); + + CHECK_ADDRESS( PFNGLUSEPROGRAMSTAGESPROC, glUseProgramStages ); + CHECK_ADDRESS( PFNGLACTIVESHADERPROGRAMPROC, glActiveShaderProgram ); + CHECK_ADDRESS( PFNGLCREATESHADERPROGRAMVPROC, glCreateShaderProgramv ); + CHECK_ADDRESS( PFNGLBINDPROGRAMPIPELINEPROC, glBindProgramPipeline ); + CHECK_ADDRESS( PFNGLDELETEPROGRAMPIPELINESPROC, glDeleteProgramPipelines ); + CHECK_ADDRESS( PFNGLGENPROGRAMPIPELINESPROC, glGenProgramPipelines ); + CHECK_ADDRESS( PFNGLISPROGRAMPIPELINEPROC, glIsProgramPipeline ); + CHECK_ADDRESS( PFNGLGETPROGRAMPIPELINEIVPROC, glGetProgramPipelineiv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM1IPROC, glProgramUniform1i ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM1IVPROC, glProgramUniform1iv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM1FPROC, glProgramUniform1f ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM1FVPROC, glProgramUniform1fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM1DPROC, glProgramUniform1d ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM1DVPROC, glProgramUniform1dv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM1UIPROC, glProgramUniform1ui ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM1UIVPROC, glProgramUniform1uiv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM2IPROC, glProgramUniform2i ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM2IVPROC, glProgramUniform2iv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM2FPROC, glProgramUniform2f ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM2FVPROC, glProgramUniform2fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM2DPROC, glProgramUniform2d ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM2DVPROC, glProgramUniform2dv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM2UIPROC, glProgramUniform2ui ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM2UIVPROC, glProgramUniform2uiv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM3IPROC, glProgramUniform3i ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM3IVPROC, glProgramUniform3iv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM3FPROC, glProgramUniform3f ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM3FVPROC, glProgramUniform3fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM3DPROC, glProgramUniform3d ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM3DVPROC, glProgramUniform3dv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM3UIPROC, glProgramUniform3ui ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM3UIVPROC, glProgramUniform3uiv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM4IPROC, glProgramUniform4i ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM4IVPROC, glProgramUniform4iv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM4FPROC, glProgramUniform4f ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM4FVPROC, glProgramUniform4fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM4DPROC, glProgramUniform4d ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM4DVPROC, glProgramUniform4dv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM4UIPROC, glProgramUniform4ui ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORM4UIVPROC, glProgramUniform4uiv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX2FVPROC, glProgramUniformMatrix2fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX3FVPROC, glProgramUniformMatrix3fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX4FVPROC, glProgramUniformMatrix4fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX2DVPROC, glProgramUniformMatrix2dv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX3DVPROC, glProgramUniformMatrix3dv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX4DVPROC, glProgramUniformMatrix4dv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC, glProgramUniformMatrix2x3fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC, glProgramUniformMatrix3x2fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC, glProgramUniformMatrix2x4fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC, glProgramUniformMatrix4x2fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC, glProgramUniformMatrix3x4fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC, glProgramUniformMatrix4x3fv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC, glProgramUniformMatrix2x3dv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC, glProgramUniformMatrix3x2dv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC, glProgramUniformMatrix2x4dv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC, glProgramUniformMatrix4x2dv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC, glProgramUniformMatrix3x4dv ); + CHECK_ADDRESS( PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC, glProgramUniformMatrix4x3dv ); + CHECK_ADDRESS( PFNGLVALIDATEPROGRAMPIPELINEPROC, glValidateProgramPipeline ); + CHECK_ADDRESS( PFNGLGETPROGRAMPIPELINEINFOLOGPROC, glGetProgramPipelineInfoLog ); + + return true; +} + // *************************************************************************** // Extension Check. void registerGlExtensions(CGlExtensions &ext) @@ -1104,6 +1232,12 @@ void registerGlExtensions(CGlExtensions &ext) nlinfo( "Failed to set up GLSL related calls!" ); nlassert( false ); } + + if( !setupSeparateShaderObjects( glext ) ) + { + nlinfo( "Failed to set up separate shader object calls!" ); + nlassert( false ); + } } diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h index aeac00e3c..ca95ffbc9 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h @@ -450,7 +450,6 @@ extern PFNGLLINKPROGRAMPROC nglLinkProgram; extern PFNGLSHADERSOURCEPROC nglShaderSource; extern PFNGLUSEPROGRAMPROC nglUseProgram; extern PFNGLVALIDATEPROGRAMPROC nglValidateProgram; - extern PFNGLUNIFORM1FPROC nglUniform1f; extern PFNGLUNIFORM2FPROC nglUniform2f; extern PFNGLUNIFORM3FPROC nglUniform3f; @@ -471,7 +470,6 @@ extern PFNGLUNIFORMMATRIX2FVPROC nglUniformMatrix2fv; extern PFNGLUNIFORMMATRIX3FVPROC nglUniformMatrix3fv; extern PFNGLUNIFORMMATRIX4FVPROC nglUniformMatrix4fv; extern PFNGLVERTEXATTRIBPOINTERPROC nglVertexAttribPointer; - extern PFNGLUNIFORM1UIPROC nglUniform1ui; extern PFNGLUNIFORM2UIPROC nglUniform2ui; extern PFNGLUNIFORM3UIPROC nglUniform3ui; @@ -481,6 +479,68 @@ extern PFNGLUNIFORM2UIVPROC nglUniform2uiv; extern PFNGLUNIFORM3UIVPROC nglUniform3uiv; extern PFNGLUNIFORM4UIVPROC nglUniform4uiv; +// GL_ARB_separate_shader_objects +extern PFNGLUSEPROGRAMSTAGESPROC nglUseProgramStages; +extern PFNGLACTIVESHADERPROGRAMPROC nglActiveShaderProgram; +extern PFNGLCREATESHADERPROGRAMVPROC nglCreateShaderProgramv; +extern PFNGLBINDPROGRAMPIPELINEPROC nglBindProgramPipeline; +extern PFNGLDELETEPROGRAMPIPELINESPROC nglDeleteProgramPipelines; +extern PFNGLGENPROGRAMPIPELINESPROC nglGenProgramPipelines; +extern PFNGLISPROGRAMPIPELINEPROC nglIsProgramPipeline; +extern PFNGLGETPROGRAMPIPELINEIVPROC nglGetProgramPipelineiv; +extern PFNGLPROGRAMUNIFORM1IPROC nglProgramUniform1i; +extern PFNGLPROGRAMUNIFORM1IVPROC nglProgramUniform1iv; +extern PFNGLPROGRAMUNIFORM1FPROC nglProgramUniform1f; +extern PFNGLPROGRAMUNIFORM1FVPROC nglProgramUniform1fv; +extern PFNGLPROGRAMUNIFORM1DPROC nglProgramUniform1d; +extern PFNGLPROGRAMUNIFORM1DVPROC nglProgramUniform1dv; +extern PFNGLPROGRAMUNIFORM1UIPROC nglProgramUniform1ui; +extern PFNGLPROGRAMUNIFORM1UIVPROC nglProgramUniform1uiv; +extern PFNGLPROGRAMUNIFORM2IPROC nglProgramUniform2i; +extern PFNGLPROGRAMUNIFORM2IVPROC nglProgramUniform2iv; +extern PFNGLPROGRAMUNIFORM2FPROC nglProgramUniform2f; +extern PFNGLPROGRAMUNIFORM2FVPROC nglProgramUniform2fv; +extern PFNGLPROGRAMUNIFORM2DPROC nglProgramUniform2d; +extern PFNGLPROGRAMUNIFORM2DVPROC nglProgramUniform2dv; +extern PFNGLPROGRAMUNIFORM2UIPROC nglProgramUniform2ui; +extern PFNGLPROGRAMUNIFORM2UIVPROC nglProgramUniform2uiv; +extern PFNGLPROGRAMUNIFORM3IPROC nglProgramUniform3i; +extern PFNGLPROGRAMUNIFORM3IVPROC nglProgramUniform3iv; +extern PFNGLPROGRAMUNIFORM3FPROC nglProgramUniform3f; +extern PFNGLPROGRAMUNIFORM3FVPROC nglProgramUniform3fv; +extern PFNGLPROGRAMUNIFORM3DPROC nglProgramUniform3d; +extern PFNGLPROGRAMUNIFORM3DVPROC nglProgramUniform3dv; +extern PFNGLPROGRAMUNIFORM3UIPROC nglProgramUniform3ui; +extern PFNGLPROGRAMUNIFORM3UIVPROC nglProgramUniform3uiv; +extern PFNGLPROGRAMUNIFORM4IPROC nglProgramUniform4i; +extern PFNGLPROGRAMUNIFORM4IVPROC nglProgramUniform4iv; +extern PFNGLPROGRAMUNIFORM4FPROC nglProgramUniform4f; +extern PFNGLPROGRAMUNIFORM4FVPROC nglProgramUniform4fv; +extern PFNGLPROGRAMUNIFORM4DPROC nglProgramUniform4d; +extern PFNGLPROGRAMUNIFORM4DVPROC nglProgramUniform4dv; +extern PFNGLPROGRAMUNIFORM4UIPROC nglProgramUniform4ui; +extern PFNGLPROGRAMUNIFORM4UIVPROC nglProgramUniform4uiv; +extern PFNGLPROGRAMUNIFORMMATRIX2FVPROC nglProgramUniformMatrix2fv; +extern PFNGLPROGRAMUNIFORMMATRIX3FVPROC nglProgramUniformMatrix3fv; +extern PFNGLPROGRAMUNIFORMMATRIX4FVPROC nglProgramUniformMatrix4fv; +extern PFNGLPROGRAMUNIFORMMATRIX2DVPROC nglProgramUniformMatrix2dv; +extern PFNGLPROGRAMUNIFORMMATRIX3DVPROC nglProgramUniformMatrix3dv; +extern PFNGLPROGRAMUNIFORMMATRIX4DVPROC nglProgramUniformMatrix4dv; +extern PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC nglProgramUniformMatrix2x3fv; +extern PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC nglProgramUniformMatrix3x2fv; +extern PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC nglProgramUniformMatrix2x4fv; +extern PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC nglProgramUniformMatrix4x2fv; +extern PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC nglProgramUniformMatrix3x4fv; +extern PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC nglProgramUniformMatrix4x3fv; +extern PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC nglProgramUniformMatrix2x3dv; +extern PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC nglProgramUniformMatrix3x2dv; +extern PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC nglProgramUniformMatrix2x4dv; +extern PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC nglProgramUniformMatrix4x2dv; +extern PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC nglProgramUniformMatrix3x4dv; +extern PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC nglProgramUniformMatrix4x3dv; +extern PFNGLVALIDATEPROGRAMPIPELINEPROC nglValidateProgramPipeline; +extern PFNGLGETPROGRAMPIPELINEINFOLOGPROC nglGetProgramPipelineInfoLog; + // GL_NV_occlusion_query //================================== extern NEL_PFNGLGENOCCLUSIONQUERIESNVPROC nglGenOcclusionQueriesNV; @@ -559,5 +619,9 @@ extern NEL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC nglRenderbufferStorageMul // GL_ARB_multisample extern NEL_PFNGLSAMPLECOVERAGEARBPROC nglSampleCoverageARB; + + + + #endif // NL_OPENGL_EXTENSION_H