diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a32308c65..e39df1f31b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -466,23 +466,6 @@ else() add_subdirectory(Externals/GLew) include_directories(Externals/GLew/include) endif(NOT GLEW_FOUND) - - if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - check_lib(CG Cg Cg/cg.h) - endif() - if(NOT CG_FOUND) - message("Using static Cg from Externals") - include_directories(Externals) - endif(NOT CG_FOUND) - check_lib(CGGL CgGL Cg/cgGL.h) - if(NOT CG_FOUND) - message("CG not found, Building without") - add_definitions(-DHAVE_CG=0) - set(HAVE_CG 0) - else() - add_definitions(-DHAVE_CG=1) - set(HAVE_CG 1) - endif() endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") diff --git a/Externals/Cg/Cg.framework/Cg b/Externals/Cg/Cg.framework/Cg deleted file mode 100755 index e5c268a826..0000000000 Binary files a/Externals/Cg/Cg.framework/Cg and /dev/null differ diff --git a/Externals/Cg/Cg.framework/Resources/Info.plist b/Externals/Cg/Cg.framework/Resources/Info.plist deleted file mode 100644 index 2c84f20b13..0000000000 --- a/Externals/Cg/Cg.framework/Resources/Info.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - CFBundleGetInfoString - NVIDIA Cg version 3.0.0007 - CFBundleIdentifier - com.nvidia.cg - CFBundleName - NVIDIA Cg - CFBundleShortVersionString - 3.0.0007 - IFMajorVersion - 3 - IFMinorVersion - 0 - IFPkgFlagAllowBackRev - - IFPkgFlagAuthorizationAction - RootAuthorization - IFPkgFlagDefaultLocation - / - IFPkgFlagInstallFat - - IFPkgFlagIsRequired - - IFPkgFlagOverwritePermissions - - IFPkgFlagRelocatable - - IFPkgFlagRestartAction - NoRestart - IFPkgFlagRootVolumeOnly - - IFPkgFlagUpdateInstalledLanguages - - IFPkgFlagUseUserMask - - IFPkgFormatVersion - 0.10000000149011612 - - diff --git a/Externals/Cg/cg.dll b/Externals/Cg/cg.dll deleted file mode 100644 index a640aced33..0000000000 Binary files a/Externals/Cg/cg.dll and /dev/null differ diff --git a/Externals/Cg/cg.h b/Externals/Cg/cg.h deleted file mode 100644 index d1e1c5bc82..0000000000 --- a/Externals/Cg/cg.h +++ /dev/null @@ -1,1354 +0,0 @@ -/* - * - * Copyright (c) 2002-2010, NVIDIA Corporation. - * - * - * - * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration - * of your agreement to the following terms, and your use, installation, - * modification or redistribution of this NVIDIA software constitutes - * acceptance of these terms. If you do not agree with these terms, please do - * not use, install, modify or redistribute this NVIDIA software. - * - * - * - * In consideration of your agreement to abide by the following terms, and - * subject to these terms, NVIDIA grants you a personal, non-exclusive license, - * under NVIDIA's copyrights in this original NVIDIA software (the "NVIDIA - * Software"), to use, reproduce, modify and redistribute the NVIDIA - * Software, with or without modifications, in source and/or binary forms; - * provided that if you redistribute the NVIDIA Software, you must retain the - * copyright notice of NVIDIA, this notice and the following text and - * disclaimers in all such redistributions of the NVIDIA Software. Neither the - * name, trademarks, service marks nor logos of NVIDIA Corporation may be used - * to endorse or promote products derived from the NVIDIA Software without - * specific prior written permission from NVIDIA. Except as expressly stated - * in this notice, no other rights or licenses express or implied, are granted - * by NVIDIA herein, including but not limited to any patent rights that may be - * infringed by your derivative works or by other works in which the NVIDIA - * Software may be incorporated. No hardware is licensed hereunder. - * - * - * - * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING - * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION - * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS. - * - * - * - * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, - * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST - * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE, - * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE, - * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING - * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef _cg_h -#define _cg_h - -/*************************************************************************/ -/*** CG Run-Time Library API ***/ -/*************************************************************************/ - -#define CG_VERSION_NUM 3000 - -#ifdef _WIN32 -# ifndef APIENTRY /* From Win32's */ -# define CG_APIENTRY_DEFINED -# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__) -# define APIENTRY __stdcall -# else -# define APIENTRY -# endif -# endif -# ifndef WINGDIAPI /* From Win32's and */ -# define CG_WINGDIAPI_DEFINED -# define WINGDIAPI __declspec(dllimport) -# endif -#endif /* _WIN32 */ - -/* Set up CG_API for Win32 dllexport or gcc visibility. */ - -#ifndef CG_API -# ifdef CG_EXPORTS -# ifdef _WIN32 -# define CG_API __declspec(dllexport) -# elif defined(__GNUC__) && __GNUC__>=4 -# define CG_API __attribute__ ((visibility("default"))) -# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) -# define CG_API __global -# else -# define CG_API -# endif -# else -# define CG_API -# endif -#endif - -#ifndef CGENTRY -# ifdef _WIN32 -# define CGENTRY __cdecl -# else -# define CGENTRY -# endif -#endif - -/*************************************************************************/ -/*** Data types and enumerants ***/ -/*************************************************************************/ - -typedef int CGbool; -typedef struct _CGcontext *CGcontext; -typedef struct _CGprogram *CGprogram; -typedef struct _CGparameter *CGparameter; -typedef struct _CGobj *CGobj; -typedef struct _CGbuffer *CGbuffer; -typedef struct _CGeffect *CGeffect; -typedef struct _CGtechnique *CGtechnique; -typedef struct _CGpass *CGpass; -typedef struct _CGstate *CGstate; -typedef struct _CGstateassignment *CGstateassignment; -typedef struct _CGannotation *CGannotation; -typedef void *CGhandle; - -#define CG_FALSE ((CGbool)0) -#define CG_TRUE ((CGbool)1) - -typedef enum -{ - CG_BEHAVIOR_UNKNOWN = 0, - CG_BEHAVIOR_LATEST = 1, /* latest behavior supported at runtime */ - CG_BEHAVIOR_2200 = 1000, /* default behavior */ - CG_BEHAVIOR_3000 = 2000, - CG_BEHAVIOR_CURRENT = CG_BEHAVIOR_3000 /* latest behavior supported at compile time */ -} CGbehavior; - -typedef enum -{ - CG_UNKNOWN_TYPE = 0, - CG_ARRAY = 2, - CG_STRING = 1135, - CG_STRUCT = 1, - CG_TYPELESS_STRUCT = 3, - CG_TEXTURE = 1137, - CG_PIXELSHADER_TYPE = 1142, - CG_PROGRAM_TYPE = 1136, - CG_VERTEXSHADER_TYPE = 1141, - CG_TYPE_START_ENUM = 1024, - CG_SAMPLER = 1143, - CG_SAMPLER1D = 1065, - CG_SAMPLER1DARRAY = 1138, - CG_SAMPLER1DSHADOW = 1313, - CG_SAMPLER2D = 1066, - CG_SAMPLER2DARRAY = 1139, - CG_SAMPLER2DSHADOW = 1314, - CG_SAMPLER3D = 1067, - CG_SAMPLERBUF = 1144, - CG_SAMPLERCUBE = 1069, - CG_SAMPLERCUBEARRAY = 1140, - CG_SAMPLERRECT = 1068, - CG_SAMPLERRECTSHADOW = 1315, - CG_BOOL = 1114, - CG_BOOL1 = 1115, - CG_BOOL2 = 1116, - CG_BOOL3 = 1117, - CG_BOOL4 = 1118, - CG_BOOL1x1 = 1119, - CG_BOOL1x2 = 1120, - CG_BOOL1x3 = 1121, - CG_BOOL1x4 = 1122, - CG_BOOL2x1 = 1123, - CG_BOOL2x2 = 1124, - CG_BOOL2x3 = 1125, - CG_BOOL2x4 = 1126, - CG_BOOL3x1 = 1127, - CG_BOOL3x2 = 1128, - CG_BOOL3x3 = 1129, - CG_BOOL3x4 = 1130, - CG_BOOL4x1 = 1131, - CG_BOOL4x2 = 1132, - CG_BOOL4x3 = 1133, - CG_BOOL4x4 = 1134, - CG_CHAR = 1166, - CG_CHAR1 = 1167, - CG_CHAR2 = 1168, - CG_CHAR3 = 1169, - CG_CHAR4 = 1170, - CG_CHAR1x1 = 1171, - CG_CHAR1x2 = 1172, - CG_CHAR1x3 = 1173, - CG_CHAR1x4 = 1174, - CG_CHAR2x1 = 1175, - CG_CHAR2x2 = 1176, - CG_CHAR2x3 = 1177, - CG_CHAR2x4 = 1178, - CG_CHAR3x1 = 1179, - CG_CHAR3x2 = 1180, - CG_CHAR3x3 = 1181, - CG_CHAR3x4 = 1182, - CG_CHAR4x1 = 1183, - CG_CHAR4x2 = 1184, - CG_CHAR4x3 = 1185, - CG_CHAR4x4 = 1186, - CG_DOUBLE = 1145, - CG_DOUBLE1 = 1146, - CG_DOUBLE2 = 1147, - CG_DOUBLE3 = 1148, - CG_DOUBLE4 = 1149, - CG_DOUBLE1x1 = 1150, - CG_DOUBLE1x2 = 1151, - CG_DOUBLE1x3 = 1152, - CG_DOUBLE1x4 = 1153, - CG_DOUBLE2x1 = 1154, - CG_DOUBLE2x2 = 1155, - CG_DOUBLE2x3 = 1156, - CG_DOUBLE2x4 = 1157, - CG_DOUBLE3x1 = 1158, - CG_DOUBLE3x2 = 1159, - CG_DOUBLE3x3 = 1160, - CG_DOUBLE3x4 = 1161, - CG_DOUBLE4x1 = 1162, - CG_DOUBLE4x2 = 1163, - CG_DOUBLE4x3 = 1164, - CG_DOUBLE4x4 = 1165, - CG_FIXED = 1070, - CG_FIXED1 = 1092, - CG_FIXED2 = 1071, - CG_FIXED3 = 1072, - CG_FIXED4 = 1073, - CG_FIXED1x1 = 1074, - CG_FIXED1x2 = 1075, - CG_FIXED1x3 = 1076, - CG_FIXED1x4 = 1077, - CG_FIXED2x1 = 1078, - CG_FIXED2x2 = 1079, - CG_FIXED2x3 = 1080, - CG_FIXED2x4 = 1081, - CG_FIXED3x1 = 1082, - CG_FIXED3x2 = 1083, - CG_FIXED3x3 = 1084, - CG_FIXED3x4 = 1085, - CG_FIXED4x1 = 1086, - CG_FIXED4x2 = 1087, - CG_FIXED4x3 = 1088, - CG_FIXED4x4 = 1089, - CG_FLOAT = 1045, - CG_FLOAT1 = 1091, - CG_FLOAT2 = 1046, - CG_FLOAT3 = 1047, - CG_FLOAT4 = 1048, - CG_FLOAT1x1 = 1049, - CG_FLOAT1x2 = 1050, - CG_FLOAT1x3 = 1051, - CG_FLOAT1x4 = 1052, - CG_FLOAT2x1 = 1053, - CG_FLOAT2x2 = 1054, - CG_FLOAT2x3 = 1055, - CG_FLOAT2x4 = 1056, - CG_FLOAT3x1 = 1057, - CG_FLOAT3x2 = 1058, - CG_FLOAT3x3 = 1059, - CG_FLOAT3x4 = 1060, - CG_FLOAT4x1 = 1061, - CG_FLOAT4x2 = 1062, - CG_FLOAT4x3 = 1063, - CG_FLOAT4x4 = 1064, - CG_HALF = 1025, - CG_HALF1 = 1090, - CG_HALF2 = 1026, - CG_HALF3 = 1027, - CG_HALF4 = 1028, - CG_HALF1x1 = 1029, - CG_HALF1x2 = 1030, - CG_HALF1x3 = 1031, - CG_HALF1x4 = 1032, - CG_HALF2x1 = 1033, - CG_HALF2x2 = 1034, - CG_HALF2x3 = 1035, - CG_HALF2x4 = 1036, - CG_HALF3x1 = 1037, - CG_HALF3x2 = 1038, - CG_HALF3x3 = 1039, - CG_HALF3x4 = 1040, - CG_HALF4x1 = 1041, - CG_HALF4x2 = 1042, - CG_HALF4x3 = 1043, - CG_HALF4x4 = 1044, - CG_INT = 1093, - CG_INT1 = 1094, - CG_INT2 = 1095, - CG_INT3 = 1096, - CG_INT4 = 1097, - CG_INT1x1 = 1098, - CG_INT1x2 = 1099, - CG_INT1x3 = 1100, - CG_INT1x4 = 1101, - CG_INT2x1 = 1102, - CG_INT2x2 = 1103, - CG_INT2x3 = 1104, - CG_INT2x4 = 1105, - CG_INT3x1 = 1106, - CG_INT3x2 = 1107, - CG_INT3x3 = 1108, - CG_INT3x4 = 1109, - CG_INT4x1 = 1110, - CG_INT4x2 = 1111, - CG_INT4x3 = 1112, - CG_INT4x4 = 1113, - CG_LONG = 1271, - CG_LONG1 = 1272, - CG_LONG2 = 1273, - CG_LONG3 = 1274, - CG_LONG4 = 1275, - CG_LONG1x1 = 1276, - CG_LONG1x2 = 1277, - CG_LONG1x3 = 1278, - CG_LONG1x4 = 1279, - CG_LONG2x1 = 1280, - CG_LONG2x2 = 1281, - CG_LONG2x3 = 1282, - CG_LONG2x4 = 1283, - CG_LONG3x1 = 1284, - CG_LONG3x2 = 1285, - CG_LONG3x3 = 1286, - CG_LONG3x4 = 1287, - CG_LONG4x1 = 1288, - CG_LONG4x2 = 1289, - CG_LONG4x3 = 1290, - CG_LONG4x4 = 1291, - CG_SHORT = 1208, - CG_SHORT1 = 1209, - CG_SHORT2 = 1210, - CG_SHORT3 = 1211, - CG_SHORT4 = 1212, - CG_SHORT1x1 = 1213, - CG_SHORT1x2 = 1214, - CG_SHORT1x3 = 1215, - CG_SHORT1x4 = 1216, - CG_SHORT2x1 = 1217, - CG_SHORT2x2 = 1218, - CG_SHORT2x3 = 1219, - CG_SHORT2x4 = 1220, - CG_SHORT3x1 = 1221, - CG_SHORT3x2 = 1222, - CG_SHORT3x3 = 1223, - CG_SHORT3x4 = 1224, - CG_SHORT4x1 = 1225, - CG_SHORT4x2 = 1226, - CG_SHORT4x3 = 1227, - CG_SHORT4x4 = 1228, - CG_UCHAR = 1187, - CG_UCHAR1 = 1188, - CG_UCHAR2 = 1189, - CG_UCHAR3 = 1190, - CG_UCHAR4 = 1191, - CG_UCHAR1x1 = 1192, - CG_UCHAR1x2 = 1193, - CG_UCHAR1x3 = 1194, - CG_UCHAR1x4 = 1195, - CG_UCHAR2x1 = 1196, - CG_UCHAR2x2 = 1197, - CG_UCHAR2x3 = 1198, - CG_UCHAR2x4 = 1199, - CG_UCHAR3x1 = 1200, - CG_UCHAR3x2 = 1201, - CG_UCHAR3x3 = 1202, - CG_UCHAR3x4 = 1203, - CG_UCHAR4x1 = 1204, - CG_UCHAR4x2 = 1205, - CG_UCHAR4x3 = 1206, - CG_UCHAR4x4 = 1207, - CG_UINT = 1250, - CG_UINT1 = 1251, - CG_UINT2 = 1252, - CG_UINT3 = 1253, - CG_UINT4 = 1254, - CG_UINT1x1 = 1255, - CG_UINT1x2 = 1256, - CG_UINT1x3 = 1257, - CG_UINT1x4 = 1258, - CG_UINT2x1 = 1259, - CG_UINT2x2 = 1260, - CG_UINT2x3 = 1261, - CG_UINT2x4 = 1262, - CG_UINT3x1 = 1263, - CG_UINT3x2 = 1264, - CG_UINT3x3 = 1265, - CG_UINT3x4 = 1266, - CG_UINT4x1 = 1267, - CG_UINT4x2 = 1268, - CG_UINT4x3 = 1269, - CG_UINT4x4 = 1270, - CG_ULONG = 1292, - CG_ULONG1 = 1293, - CG_ULONG2 = 1294, - CG_ULONG3 = 1295, - CG_ULONG4 = 1296, - CG_ULONG1x1 = 1297, - CG_ULONG1x2 = 1298, - CG_ULONG1x3 = 1299, - CG_ULONG1x4 = 1300, - CG_ULONG2x1 = 1301, - CG_ULONG2x2 = 1302, - CG_ULONG2x3 = 1303, - CG_ULONG2x4 = 1304, - CG_ULONG3x1 = 1305, - CG_ULONG3x2 = 1306, - CG_ULONG3x3 = 1307, - CG_ULONG3x4 = 1308, - CG_ULONG4x1 = 1309, - CG_ULONG4x2 = 1310, - CG_ULONG4x3 = 1311, - CG_ULONG4x4 = 1312, - CG_USHORT = 1229, - CG_USHORT1 = 1230, - CG_USHORT2 = 1231, - CG_USHORT3 = 1232, - CG_USHORT4 = 1233, - CG_USHORT1x1 = 1234, - CG_USHORT1x2 = 1235, - CG_USHORT1x3 = 1236, - CG_USHORT1x4 = 1237, - CG_USHORT2x1 = 1238, - CG_USHORT2x2 = 1239, - CG_USHORT2x3 = 1240, - CG_USHORT2x4 = 1241, - CG_USHORT3x1 = 1242, - CG_USHORT3x2 = 1243, - CG_USHORT3x3 = 1244, - CG_USHORT3x4 = 1245, - CG_USHORT4x1 = 1246, - CG_USHORT4x2 = 1247, - CG_USHORT4x3 = 1248, - CG_USHORT4x4 = 1249 -} CGtype; - -typedef enum -{ - CG_TEXUNIT0 = 2048, - CG_TEXUNIT1 = 2049, - CG_TEXUNIT2 = 2050, - CG_TEXUNIT3 = 2051, - CG_TEXUNIT4 = 2052, - CG_TEXUNIT5 = 2053, - CG_TEXUNIT6 = 2054, - CG_TEXUNIT7 = 2055, - CG_TEXUNIT8 = 2056, - CG_TEXUNIT9 = 2057, - CG_TEXUNIT10 = 2058, - CG_TEXUNIT11 = 2059, - CG_TEXUNIT12 = 2060, - CG_TEXUNIT13 = 2061, - CG_TEXUNIT14 = 2062, - CG_TEXUNIT15 = 2063, - CG_TEXUNIT16 = 4624, - CG_TEXUNIT17 = 4625, - CG_TEXUNIT18 = 4626, - CG_TEXUNIT19 = 4627, - CG_TEXUNIT20 = 4628, - CG_TEXUNIT21 = 4629, - CG_TEXUNIT22 = 4630, - CG_TEXUNIT23 = 4631, - CG_TEXUNIT24 = 4632, - CG_TEXUNIT25 = 4633, - CG_TEXUNIT26 = 4634, - CG_TEXUNIT27 = 4635, - CG_TEXUNIT28 = 4636, - CG_TEXUNIT29 = 4637, - CG_TEXUNIT30 = 4638, - CG_TEXUNIT31 = 4639, - CG_BUFFER0 = 2064, - CG_BUFFER1 = 2065, - CG_BUFFER2 = 2066, - CG_BUFFER3 = 2067, - CG_BUFFER4 = 2068, - CG_BUFFER5 = 2069, - CG_BUFFER6 = 2070, - CG_BUFFER7 = 2071, - CG_BUFFER8 = 2072, - CG_BUFFER9 = 2073, - CG_BUFFER10 = 2074, - CG_BUFFER11 = 2075, - CG_ATTR0 = 2113, - CG_ATTR1 = 2114, - CG_ATTR2 = 2115, - CG_ATTR3 = 2116, - CG_ATTR4 = 2117, - CG_ATTR5 = 2118, - CG_ATTR6 = 2119, - CG_ATTR7 = 2120, - CG_ATTR8 = 2121, - CG_ATTR9 = 2122, - CG_ATTR10 = 2123, - CG_ATTR11 = 2124, - CG_ATTR12 = 2125, - CG_ATTR13 = 2126, - CG_ATTR14 = 2127, - CG_ATTR15 = 2128, - CG_C = 2178, - CG_TEX0 = 2179, - CG_TEX1 = 2180, - CG_TEX2 = 2181, - CG_TEX3 = 2192, - CG_TEX4 = 2193, - CG_TEX5 = 2194, - CG_TEX6 = 2195, - CG_TEX7 = 2196, - CG_HPOS = 2243, - CG_COL0 = 2245, - CG_COL1 = 2246, - CG_COL2 = 2247, - CG_COL3 = 2248, - CG_PSIZ = 2309, - CG_CLP0 = 2310, - CG_CLP1 = 2311, - CG_CLP2 = 2312, - CG_CLP3 = 2313, - CG_CLP4 = 2314, - CG_CLP5 = 2315, - CG_WPOS = 2373, - CG_POINTCOORD = 2374, - CG_POSITION0 = 2437, - CG_POSITION1 = 2438, - CG_POSITION2 = 2439, - CG_POSITION3 = 2440, - CG_POSITION4 = 2441, - CG_POSITION5 = 2442, - CG_POSITION6 = 2443, - CG_POSITION7 = 2444, - CG_POSITION8 = 2445, - CG_POSITION9 = 2446, - CG_POSITION10 = 2447, - CG_POSITION11 = 2448, - CG_POSITION12 = 2449, - CG_POSITION13 = 2450, - CG_POSITION14 = 2451, - CG_POSITION15 = 2452, - CG_DIFFUSE0 = 2501, - CG_TANGENT0 = 2565, - CG_TANGENT1 = 2566, - CG_TANGENT2 = 2567, - CG_TANGENT3 = 2568, - CG_TANGENT4 = 2569, - CG_TANGENT5 = 2570, - CG_TANGENT6 = 2571, - CG_TANGENT7 = 2572, - CG_TANGENT8 = 2573, - CG_TANGENT9 = 2574, - CG_TANGENT10 = 2575, - CG_TANGENT11 = 2576, - CG_TANGENT12 = 2577, - CG_TANGENT13 = 2578, - CG_TANGENT14 = 2579, - CG_TANGENT15 = 2580, - CG_SPECULAR0 = 2629, - CG_BLENDINDICES0 = 2693, - CG_BLENDINDICES1 = 2694, - CG_BLENDINDICES2 = 2695, - CG_BLENDINDICES3 = 2696, - CG_BLENDINDICES4 = 2697, - CG_BLENDINDICES5 = 2698, - CG_BLENDINDICES6 = 2699, - CG_BLENDINDICES7 = 2700, - CG_BLENDINDICES8 = 2701, - CG_BLENDINDICES9 = 2702, - CG_BLENDINDICES10 = 2703, - CG_BLENDINDICES11 = 2704, - CG_BLENDINDICES12 = 2705, - CG_BLENDINDICES13 = 2706, - CG_BLENDINDICES14 = 2707, - CG_BLENDINDICES15 = 2708, - CG_COLOR0 = 2757, - CG_COLOR1 = 2758, - CG_COLOR2 = 2759, - CG_COLOR3 = 2760, - CG_COLOR4 = 2761, - CG_COLOR5 = 2762, - CG_COLOR6 = 2763, - CG_COLOR7 = 2764, - CG_COLOR8 = 2765, - CG_COLOR9 = 2766, - CG_COLOR10 = 2767, - CG_COLOR11 = 2768, - CG_COLOR12 = 2769, - CG_COLOR13 = 2770, - CG_COLOR14 = 2771, - CG_COLOR15 = 2772, - CG_PSIZE0 = 2821, - CG_PSIZE1 = 2822, - CG_PSIZE2 = 2823, - CG_PSIZE3 = 2824, - CG_PSIZE4 = 2825, - CG_PSIZE5 = 2826, - CG_PSIZE6 = 2827, - CG_PSIZE7 = 2828, - CG_PSIZE8 = 2829, - CG_PSIZE9 = 2830, - CG_PSIZE10 = 2831, - CG_PSIZE11 = 2832, - CG_PSIZE12 = 2833, - CG_PSIZE13 = 2834, - CG_PSIZE14 = 2835, - CG_PSIZE15 = 2836, - CG_BINORMAL0 = 2885, - CG_BINORMAL1 = 2886, - CG_BINORMAL2 = 2887, - CG_BINORMAL3 = 2888, - CG_BINORMAL4 = 2889, - CG_BINORMAL5 = 2890, - CG_BINORMAL6 = 2891, - CG_BINORMAL7 = 2892, - CG_BINORMAL8 = 2893, - CG_BINORMAL9 = 2894, - CG_BINORMAL10 = 2895, - CG_BINORMAL11 = 2896, - CG_BINORMAL12 = 2897, - CG_BINORMAL13 = 2898, - CG_BINORMAL14 = 2899, - CG_BINORMAL15 = 2900, - CG_FOG0 = 2917, - CG_FOG1 = 2918, - CG_FOG2 = 2919, - CG_FOG3 = 2920, - CG_FOG4 = 2921, - CG_FOG5 = 2922, - CG_FOG6 = 2923, - CG_FOG7 = 2924, - CG_FOG8 = 2925, - CG_FOG9 = 2926, - CG_FOG10 = 2927, - CG_FOG11 = 2928, - CG_FOG12 = 2929, - CG_FOG13 = 2930, - CG_FOG14 = 2931, - CG_FOG15 = 2932, - CG_DEPTH0 = 2933, - CG_DEPTH1 = 2934, - CG_DEPTH2 = 2935, - CG_DEPTH3 = 2936, - CG_DEPTH4 = 2937, - CG_DEPTH5 = 2938, - CG_DEPTH6 = 2939, - CG_DEPTH7 = 2940, - CG_DEPTH8 = 2941, - CG_DEPTH9 = 2942, - CG_DEPTH10 = 2943, - CG_DEPTH11 = 2944, - CG_DEPTH12 = 2945, - CG_DEPTH13 = 2946, - CG_DEPTH14 = 2947, - CG_DEPTH15 = 2948, - CG_SAMPLE0 = 2949, - CG_SAMPLE1 = 2950, - CG_SAMPLE2 = 2951, - CG_SAMPLE3 = 2952, - CG_SAMPLE4 = 2953, - CG_SAMPLE5 = 2954, - CG_SAMPLE6 = 2955, - CG_SAMPLE7 = 2956, - CG_SAMPLE8 = 2957, - CG_SAMPLE9 = 2958, - CG_SAMPLE10 = 2959, - CG_SAMPLE11 = 2960, - CG_SAMPLE12 = 2961, - CG_SAMPLE13 = 2962, - CG_SAMPLE14 = 2963, - CG_SAMPLE15 = 2964, - CG_BLENDWEIGHT0 = 3028, - CG_BLENDWEIGHT1 = 3029, - CG_BLENDWEIGHT2 = 3030, - CG_BLENDWEIGHT3 = 3031, - CG_BLENDWEIGHT4 = 3032, - CG_BLENDWEIGHT5 = 3033, - CG_BLENDWEIGHT6 = 3034, - CG_BLENDWEIGHT7 = 3035, - CG_BLENDWEIGHT8 = 3036, - CG_BLENDWEIGHT9 = 3037, - CG_BLENDWEIGHT10 = 3038, - CG_BLENDWEIGHT11 = 3039, - CG_BLENDWEIGHT12 = 3040, - CG_BLENDWEIGHT13 = 3041, - CG_BLENDWEIGHT14 = 3042, - CG_BLENDWEIGHT15 = 3043, - CG_NORMAL0 = 3092, - CG_NORMAL1 = 3093, - CG_NORMAL2 = 3094, - CG_NORMAL3 = 3095, - CG_NORMAL4 = 3096, - CG_NORMAL5 = 3097, - CG_NORMAL6 = 3098, - CG_NORMAL7 = 3099, - CG_NORMAL8 = 3100, - CG_NORMAL9 = 3101, - CG_NORMAL10 = 3102, - CG_NORMAL11 = 3103, - CG_NORMAL12 = 3104, - CG_NORMAL13 = 3105, - CG_NORMAL14 = 3106, - CG_NORMAL15 = 3107, - CG_FOGCOORD = 3156, - CG_TEXCOORD0 = 3220, - CG_TEXCOORD1 = 3221, - CG_TEXCOORD2 = 3222, - CG_TEXCOORD3 = 3223, - CG_TEXCOORD4 = 3224, - CG_TEXCOORD5 = 3225, - CG_TEXCOORD6 = 3226, - CG_TEXCOORD7 = 3227, - CG_TEXCOORD8 = 3228, - CG_TEXCOORD9 = 3229, - CG_TEXCOORD10 = 3230, - CG_TEXCOORD11 = 3231, - CG_TEXCOORD12 = 3232, - CG_TEXCOORD13 = 3233, - CG_TEXCOORD14 = 3234, - CG_TEXCOORD15 = 3235, - CG_COMBINER_CONST0 = 3284, - CG_COMBINER_CONST1 = 3285, - CG_COMBINER_STAGE_CONST0 = 3286, - CG_COMBINER_STAGE_CONST1 = 3287, - CG_OFFSET_TEXTURE_MATRIX = 3288, - CG_OFFSET_TEXTURE_SCALE = 3289, - CG_OFFSET_TEXTURE_BIAS = 3290, - CG_CONST_EYE = 3291, - CG_COVERAGE = 3292, - CG_TESSFACTOR = 3255, - CG_GLSL_UNIFORM = 3300, - CG_GLSL_ATTRIB = 3301, - CG_ENV = 3302, - CG_HLSL_UNIFORM = 3559, - CG_HLSL_VARYING = 3560, - CG_SAMPLER_RES = 3561, - CG_LASTCOL0 = 4400, - CG_LASTCOL1 = 4401, - CG_LASTCOL2 = 4402, - CG_LASTCOL3 = 4403, - CG_LASTCOL4 = 4404, - CG_LASTCOL5 = 4405, - CG_LASTCOL6 = 4406, - CG_LASTCOL7 = 4407, - CG_FACE = 4410, - CG_PRIMITIVEID = 4411, - CG_INSTANCEID = 4412, - CG_SAMPLEID = 4413, - CG_VERTEXID = 4414, - CG_LAYER = 4415, - CG_SAMPLEMASK = 4416, - CG_CONTROLPOINTID = 4417, - CG_EDGETESS = 4418, - CG_INNERTESS = 4419, - CG_UNDEFINED = 3256 -} CGresource; - -typedef enum -{ - CG_PROFILE_UNKNOWN = 6145, - CG_PROFILE_VP20 = 6146, - CG_PROFILE_FP20 = 6147, - CG_PROFILE_VP30 = 6148, - CG_PROFILE_FP30 = 6149, - CG_PROFILE_ARBVP1 = 6150, - CG_PROFILE_FP40 = 6151, - CG_PROFILE_ARBFP1 = 7000, - CG_PROFILE_VP40 = 7001, - CG_PROFILE_GLSLV = 7007, - CG_PROFILE_GLSLF = 7008, - CG_PROFILE_GLSLG = 7016, - CG_PROFILE_GLSLC = 7009, - CG_PROFILE_GPU_FP = 7010, /* Deprecated alias for CG_PROFILE_GP4FP */ - CG_PROFILE_GPU_VP = 7011, /* Deprecated alias for CG_PROFILE_GP4VP */ - CG_PROFILE_GPU_GP = 7012, /* Deprecated alias for CG_PROFILE_GP4GP */ - CG_PROFILE_GP4FP = 7010, - CG_PROFILE_GP4VP = 7011, - CG_PROFILE_GP4GP = 7012, - CG_PROFILE_GP5FP = 7017, /* NV_gpu_program5 */ - CG_PROFILE_GP5VP = 7018, /* NV_gpu_program5 */ - CG_PROFILE_GP5GP = 7019, /* NV_gpu_program5 */ - CG_PROFILE_GP5TCP = 7020, /* NV_tessellation_program5 Tessellation control program */ - CG_PROFILE_GP5TEP = 7021, /* NV_tessellation_program5 Tessellation evaluation program */ - CG_PROFILE_VS_1_1 = 6153, - CG_PROFILE_VS_2_0 = 6154, - CG_PROFILE_VS_2_X = 6155, - CG_PROFILE_VS_2_SW = 6156, - CG_PROFILE_VS_3_0 = 6157, - CG_PROFILE_HLSLV = 6158, - CG_PROFILE_PS_1_1 = 6159, - CG_PROFILE_PS_1_2 = 6160, - CG_PROFILE_PS_1_3 = 6161, - CG_PROFILE_PS_2_0 = 6162, - CG_PROFILE_PS_2_X = 6163, - CG_PROFILE_PS_2_SW = 6164, - CG_PROFILE_PS_3_0 = 6165, - CG_PROFILE_HLSLF = 6166, - CG_PROFILE_VS_4_0 = 6167, - CG_PROFILE_PS_4_0 = 6168, - CG_PROFILE_GS_4_0 = 6169, - CG_PROFILE_VS_5_0 = 6170, - CG_PROFILE_PS_5_0 = 6171, - CG_PROFILE_GS_5_0 = 6172, - CG_PROFILE_HS_5_0 = 6173, - CG_PROFILE_DS_5_0 = 6174, - CG_PROFILE_GENERIC = 7002 -} CGprofile; - -typedef enum -{ - CG_NO_ERROR = 0, - CG_COMPILER_ERROR = 1, - CG_INVALID_PARAMETER_ERROR = 2, - CG_INVALID_PROFILE_ERROR = 3, - CG_PROGRAM_LOAD_ERROR = 4, - CG_PROGRAM_BIND_ERROR = 5, - CG_PROGRAM_NOT_LOADED_ERROR = 6, - CG_UNSUPPORTED_GL_EXTENSION_ERROR = 7, - CG_INVALID_VALUE_TYPE_ERROR = 8, - CG_NOT_MATRIX_PARAM_ERROR = 9, - CG_INVALID_ENUMERANT_ERROR = 10, - CG_NOT_4x4_MATRIX_ERROR = 11, - CG_FILE_READ_ERROR = 12, - CG_FILE_WRITE_ERROR = 13, - CG_NVPARSE_ERROR = 14, - CG_MEMORY_ALLOC_ERROR = 15, - CG_INVALID_CONTEXT_HANDLE_ERROR = 16, - CG_INVALID_PROGRAM_HANDLE_ERROR = 17, - CG_INVALID_PARAM_HANDLE_ERROR = 18, - CG_UNKNOWN_PROFILE_ERROR = 19, - CG_VAR_ARG_ERROR = 20, - CG_INVALID_DIMENSION_ERROR = 21, - CG_ARRAY_PARAM_ERROR = 22, - CG_OUT_OF_ARRAY_BOUNDS_ERROR = 23, - CG_CONFLICTING_TYPES_ERROR = 24, - CG_CONFLICTING_PARAMETER_TYPES_ERROR = 25, - CG_PARAMETER_IS_NOT_SHARED_ERROR = 26, - CG_INVALID_PARAMETER_VARIABILITY_ERROR = 27, - CG_CANNOT_DESTROY_PARAMETER_ERROR = 28, - CG_NOT_ROOT_PARAMETER_ERROR = 29, - CG_PARAMETERS_DO_NOT_MATCH_ERROR = 30, - CG_IS_NOT_PROGRAM_PARAMETER_ERROR = 31, - CG_INVALID_PARAMETER_TYPE_ERROR = 32, - CG_PARAMETER_IS_NOT_RESIZABLE_ARRAY_ERROR = 33, - CG_INVALID_SIZE_ERROR = 34, - CG_BIND_CREATES_CYCLE_ERROR = 35, - CG_ARRAY_TYPES_DO_NOT_MATCH_ERROR = 36, - CG_ARRAY_DIMENSIONS_DO_NOT_MATCH_ERROR = 37, - CG_ARRAY_HAS_WRONG_DIMENSION_ERROR = 38, - CG_TYPE_IS_NOT_DEFINED_IN_PROGRAM_ERROR = 39, - CG_INVALID_EFFECT_HANDLE_ERROR = 40, - CG_INVALID_STATE_HANDLE_ERROR = 41, - CG_INVALID_STATE_ASSIGNMENT_HANDLE_ERROR = 42, - CG_INVALID_PASS_HANDLE_ERROR = 43, - CG_INVALID_ANNOTATION_HANDLE_ERROR = 44, - CG_INVALID_TECHNIQUE_HANDLE_ERROR = 45, - CG_INVALID_PARAMETER_HANDLE_ERROR = 46, - CG_STATE_ASSIGNMENT_TYPE_MISMATCH_ERROR = 47, - CG_INVALID_FUNCTION_HANDLE_ERROR = 48, - CG_INVALID_TECHNIQUE_ERROR = 49, - CG_INVALID_POINTER_ERROR = 50, - CG_NOT_ENOUGH_DATA_ERROR = 51, - CG_NON_NUMERIC_PARAMETER_ERROR = 52, - CG_ARRAY_SIZE_MISMATCH_ERROR = 53, - CG_CANNOT_SET_NON_UNIFORM_PARAMETER_ERROR = 54, - CG_DUPLICATE_NAME_ERROR = 55, - CG_INVALID_OBJ_HANDLE_ERROR = 56, - CG_INVALID_BUFFER_HANDLE_ERROR = 57, - CG_BUFFER_INDEX_OUT_OF_RANGE_ERROR = 58, - CG_BUFFER_ALREADY_MAPPED_ERROR = 59, - CG_BUFFER_UPDATE_NOT_ALLOWED_ERROR = 60, - CG_GLSLG_UNCOMBINED_LOAD_ERROR = 61 -} CGerror; - -typedef enum -{ - CG_UNKNOWN = 4096, - CG_IN = 4097, - CG_OUT = 4098, - CG_INOUT = 4099, - CG_MIXED = 4100, - CG_VARYING = 4101, - CG_UNIFORM = 4102, - CG_CONSTANT = 4103, - CG_PROGRAM_SOURCE = 4104, /* cgGetProgramString */ - CG_PROGRAM_ENTRY = 4105, /* cgGetProgramString */ - CG_COMPILED_PROGRAM = 4106, /* cgGetProgramString */ - CG_PROGRAM_PROFILE = 4107, /* cgGetProgramString */ - CG_GLOBAL = 4108, - CG_PROGRAM = 4109, - CG_DEFAULT = 4110, - CG_ERROR = 4111, - CG_SOURCE = 4112, - CG_OBJECT = 4113, - CG_COMPILE_MANUAL = 4114, - CG_COMPILE_IMMEDIATE = 4115, - CG_COMPILE_LAZY = 4116, - CG_CURRENT = 4117, - CG_LITERAL = 4118, - CG_VERSION = 4119, /* cgGetString */ - CG_ROW_MAJOR = 4120, - CG_COLUMN_MAJOR = 4121, - CG_FRAGMENT = 4122, /* cgGetProgramInput and cgGetProgramOutput */ - CG_VERTEX = 4123, /* cgGetProgramInput and cgGetProgramOutput */ - CG_POINT = 4124, /* Geometry program cgGetProgramInput */ - CG_LINE = 4125, /* Geometry program cgGetProgramInput */ - CG_LINE_ADJ = 4126, /* Geometry program cgGetProgramInput */ - CG_TRIANGLE = 4127, /* Geometry program cgGetProgramInput */ - CG_TRIANGLE_ADJ = 4128, /* Geometry program cgGetProgramInput */ - CG_POINT_OUT = 4129, /* Geometry program cgGetProgramOutput */ - CG_LINE_OUT = 4130, /* Geometry program cgGetProgramOutput */ - CG_TRIANGLE_OUT = 4131, /* Geometry program cgGetProgramOutput */ - CG_IMMEDIATE_PARAMETER_SETTING = 4132, - CG_DEFERRED_PARAMETER_SETTING = 4133, - CG_NO_LOCKS_POLICY = 4134, - CG_THREAD_SAFE_POLICY = 4135, - CG_FORCE_UPPER_CASE_POLICY = 4136, - CG_UNCHANGED_CASE_POLICY = 4137, - CG_IS_OPENGL_PROFILE = 4138, - CG_IS_DIRECT3D_PROFILE = 4139, - CG_IS_DIRECT3D_8_PROFILE = 4140, - CG_IS_DIRECT3D_9_PROFILE = 4141, - CG_IS_DIRECT3D_10_PROFILE = 4142, - CG_IS_VERTEX_PROFILE = 4143, - CG_IS_FRAGMENT_PROFILE = 4144, - CG_IS_GEOMETRY_PROFILE = 4145, - CG_IS_TRANSLATION_PROFILE = 4146, - CG_IS_HLSL_PROFILE = 4147, - CG_IS_GLSL_PROFILE = 4148, - CG_IS_TESSELLATION_CONTROL_PROFILE = 4149, - CG_IS_TESSELLATION_EVALUATION_PROFILE = 4150, - CG_PATCH = 4152, /* cgGetProgramInput and cgGetProgramOutput */ - CG_IS_DIRECT3D_11_PROFILE = 4153 -} CGenum; - -typedef enum -{ - CG_PARAMETERCLASS_UNKNOWN = 0, - CG_PARAMETERCLASS_SCALAR = 1, - CG_PARAMETERCLASS_VECTOR = 2, - CG_PARAMETERCLASS_MATRIX = 3, - CG_PARAMETERCLASS_STRUCT = 4, - CG_PARAMETERCLASS_ARRAY = 5, - CG_PARAMETERCLASS_SAMPLER = 6, - CG_PARAMETERCLASS_OBJECT = 7 -} CGparameterclass; - -typedef enum -{ - CG_UNKNOWN_DOMAIN = 0, - CG_FIRST_DOMAIN = 1, - CG_VERTEX_DOMAIN = 1, - CG_FRAGMENT_DOMAIN = 2, - CG_GEOMETRY_DOMAIN = 3, - CG_TESSELLATION_CONTROL_DOMAIN = 4, - CG_TESSELLATION_EVALUATION_DOMAIN = 5 -} CGdomain; - -typedef enum -{ - CG_MAP_READ = 0, - CG_MAP_WRITE = 1, - CG_MAP_READ_WRITE = 2, - CG_MAP_WRITE_DISCARD = 3, - CG_MAP_WRITE_NO_OVERWRITE = 4 -} CGbufferaccess; - -typedef enum -{ - CG_BUFFER_USAGE_STREAM_DRAW = 0, - CG_BUFFER_USAGE_STREAM_READ = 1, - CG_BUFFER_USAGE_STREAM_COPY = 2, - CG_BUFFER_USAGE_STATIC_DRAW = 3, - CG_BUFFER_USAGE_STATIC_READ = 4, - CG_BUFFER_USAGE_STATIC_COPY = 5, - CG_BUFFER_USAGE_DYNAMIC_DRAW = 6, - CG_BUFFER_USAGE_DYNAMIC_READ = 7, - CG_BUFFER_USAGE_DYNAMIC_COPY = 8 -} CGbufferusage; - -#ifdef __cplusplus -extern "C" -{ -#endif - -typedef CGbool (CGENTRY * CGstatecallback)(CGstateassignment); -typedef void (CGENTRY * CGerrorCallbackFunc)(void); -typedef void (CGENTRY * CGerrorHandlerFunc)(CGcontext, CGerror, void *); -typedef void (CGENTRY * CGIncludeCallbackFunc)(CGcontext, const char *); - -/*************************************************************************/ -/*** Functions ***/ -/*************************************************************************/ - -#ifndef CG_EXPLICIT - -CG_API CGenum CGENTRY cgSetLockingPolicy(CGenum lockingPolicy); -CG_API CGenum CGENTRY cgGetLockingPolicy(void); -CG_API CGenum CGENTRY cgSetSemanticCasePolicy(CGenum casePolicy); -CG_API CGenum CGENTRY cgGetSemanticCasePolicy(void); -CG_API CGcontext CGENTRY cgCreateContext(void); -CG_API void CGENTRY cgSetContextBehavior(CGcontext context, CGbehavior behavior); -CG_API CGbehavior CGENTRY cgGetContextBehavior(CGcontext context); -CG_API const char * CGENTRY cgGetBehaviorString(CGbehavior behavior); -CG_API CGbehavior CGENTRY cgGetBehavior(const char *behavior_string); -CG_API void CGENTRY cgDestroyContext(CGcontext context); -CG_API CGbool CGENTRY cgIsContext(CGcontext context); -CG_API const char * CGENTRY cgGetLastListing(CGcontext context); -CG_API void CGENTRY cgSetLastListing(CGhandle handle, const char *listing); -CG_API void CGENTRY cgSetAutoCompile(CGcontext context, CGenum autoCompileMode); -CG_API CGenum CGENTRY cgGetAutoCompile(CGcontext context); -CG_API void CGENTRY cgSetParameterSettingMode(CGcontext context, CGenum parameterSettingMode); -CG_API CGenum CGENTRY cgGetParameterSettingMode(CGcontext context); -CG_API void CGENTRY cgSetCompilerIncludeString(CGcontext context, const char *name, const char *source); -CG_API void CGENTRY cgSetCompilerIncludeFile(CGcontext context, const char *name, const char *filename); -CG_API void CGENTRY cgSetCompilerIncludeCallback(CGcontext context, CGIncludeCallbackFunc func); -CG_API CGIncludeCallbackFunc CGENTRY cgGetCompilerIncludeCallback(CGcontext context); -CG_API CGprogram CGENTRY cgCreateProgram(CGcontext context, CGenum program_type, const char *program, CGprofile profile, const char *entry, const char **args); -CG_API CGprogram CGENTRY cgCreateProgramFromFile(CGcontext context, CGenum program_type, const char *program_file, CGprofile profile, const char *entry, const char **args); -CG_API CGprogram CGENTRY cgCopyProgram(CGprogram program); -CG_API void CGENTRY cgDestroyProgram(CGprogram program); -CG_API CGprogram CGENTRY cgGetFirstProgram(CGcontext context); -CG_API CGprogram CGENTRY cgGetNextProgram(CGprogram current); -CG_API CGcontext CGENTRY cgGetProgramContext(CGprogram program); -CG_API CGbool CGENTRY cgIsProgram(CGprogram program); -CG_API void CGENTRY cgCompileProgram(CGprogram program); -CG_API CGbool CGENTRY cgIsProgramCompiled(CGprogram program); -CG_API const char * CGENTRY cgGetProgramString(CGprogram program, CGenum pname); -CG_API CGprofile CGENTRY cgGetProgramProfile(CGprogram program); -CG_API char const * const * CGENTRY cgGetProgramOptions(CGprogram program); -CG_API void CGENTRY cgSetProgramProfile(CGprogram program, CGprofile profile); -CG_API CGenum CGENTRY cgGetProgramInput(CGprogram program); -CG_API CGenum CGENTRY cgGetProgramOutput(CGprogram program); -CG_API void CGENTRY cgSetPassProgramParameters(CGprogram program); -CG_API void CGENTRY cgUpdateProgramParameters(CGprogram program); -CG_API void CGENTRY cgUpdatePassParameters(CGpass pass); -CG_API CGparameter CGENTRY cgCreateParameter(CGcontext context, CGtype type); -CG_API CGparameter CGENTRY cgCreateParameterArray(CGcontext context, CGtype type, int length); -CG_API CGparameter CGENTRY cgCreateParameterMultiDimArray(CGcontext context, CGtype type, int dim, const int *lengths); -CG_API void CGENTRY cgDestroyParameter(CGparameter param); -CG_API void CGENTRY cgConnectParameter(CGparameter from, CGparameter to); -CG_API void CGENTRY cgDisconnectParameter(CGparameter param); -CG_API CGparameter CGENTRY cgGetConnectedParameter(CGparameter param); -CG_API int CGENTRY cgGetNumConnectedToParameters(CGparameter param); -CG_API CGparameter CGENTRY cgGetConnectedToParameter(CGparameter param, int index); -CG_API CGparameter CGENTRY cgGetNamedParameter(CGprogram program, const char *name); -CG_API CGparameter CGENTRY cgGetNamedProgramParameter(CGprogram program, CGenum name_space, const char *name); -CG_API CGparameter CGENTRY cgGetFirstParameter(CGprogram program, CGenum name_space); -CG_API CGparameter CGENTRY cgGetNextParameter(CGparameter current); -CG_API CGparameter CGENTRY cgGetFirstLeafParameter(CGprogram program, CGenum name_space); -CG_API CGparameter CGENTRY cgGetNextLeafParameter(CGparameter current); -CG_API CGparameter CGENTRY cgGetFirstStructParameter(CGparameter param); -CG_API CGparameter CGENTRY cgGetNamedStructParameter(CGparameter param, const char *name); -CG_API CGparameter CGENTRY cgGetFirstDependentParameter(CGparameter param); -CG_API CGparameter CGENTRY cgGetArrayParameter(CGparameter aparam, int index); -CG_API int CGENTRY cgGetArrayDimension(CGparameter param); -CG_API CGtype CGENTRY cgGetArrayType(CGparameter param); -CG_API int CGENTRY cgGetArraySize(CGparameter param, int dimension); -CG_API int CGENTRY cgGetArrayTotalSize(CGparameter param); -CG_API void CGENTRY cgSetArraySize(CGparameter param, int size); -CG_API void CGENTRY cgSetMultiDimArraySize(CGparameter param, const int *sizes); -CG_API CGprogram CGENTRY cgGetParameterProgram(CGparameter param); -CG_API CGcontext CGENTRY cgGetParameterContext(CGparameter param); -CG_API CGbool CGENTRY cgIsParameter(CGparameter param); -CG_API const char * CGENTRY cgGetParameterName(CGparameter param); -CG_API CGtype CGENTRY cgGetParameterType(CGparameter param); -CG_API CGtype CGENTRY cgGetParameterBaseType(CGparameter param); -CG_API CGparameterclass CGENTRY cgGetParameterClass(CGparameter param); -CG_API int CGENTRY cgGetParameterRows(CGparameter param); -CG_API int CGENTRY cgGetParameterColumns(CGparameter param); -CG_API CGtype CGENTRY cgGetParameterNamedType(CGparameter param); -CG_API const char * CGENTRY cgGetParameterSemantic(CGparameter param); -CG_API CGresource CGENTRY cgGetParameterResource(CGparameter param); -CG_API CGresource CGENTRY cgGetParameterBaseResource(CGparameter param); -CG_API unsigned long CGENTRY cgGetParameterResourceIndex(CGparameter param); -CG_API CGenum CGENTRY cgGetParameterVariability(CGparameter param); -CG_API CGenum CGENTRY cgGetParameterDirection(CGparameter param); -CG_API CGbool CGENTRY cgIsParameterReferenced(CGparameter param); -CG_API CGbool CGENTRY cgIsParameterUsed(CGparameter param, CGhandle handle); -CG_API const double * CGENTRY cgGetParameterValues(CGparameter param, CGenum value_type, int *nvalues); -CG_API void CGENTRY cgSetParameterValuedr(CGparameter param, int nelements, const double *vals); -CG_API void CGENTRY cgSetParameterValuedc(CGparameter param, int nelements, const double *vals); -CG_API void CGENTRY cgSetParameterValuefr(CGparameter param, int nelements, const float *vals); -CG_API void CGENTRY cgSetParameterValuefc(CGparameter param, int nelements, const float *vals); -CG_API void CGENTRY cgSetParameterValueir(CGparameter param, int nelements, const int *vals); -CG_API void CGENTRY cgSetParameterValueic(CGparameter param, int nelements, const int *vals); -CG_API int CGENTRY cgGetParameterValuedr(CGparameter param, int nelements, double *vals); -CG_API int CGENTRY cgGetParameterValuedc(CGparameter param, int nelements, double *vals); -CG_API int CGENTRY cgGetParameterValuefr(CGparameter param, int nelements, float *vals); -CG_API int CGENTRY cgGetParameterValuefc(CGparameter param, int nelements, float *vals); -CG_API int CGENTRY cgGetParameterValueir(CGparameter param, int nelements, int *vals); -CG_API int CGENTRY cgGetParameterValueic(CGparameter param, int nelements, int *vals); -CG_API int CGENTRY cgGetParameterDefaultValuedr(CGparameter param, int nelements, double *vals); -CG_API int CGENTRY cgGetParameterDefaultValuedc(CGparameter param, int nelements, double *vals); -CG_API int CGENTRY cgGetParameterDefaultValuefr(CGparameter param, int nelements, float *vals); -CG_API int CGENTRY cgGetParameterDefaultValuefc(CGparameter param, int nelements, float *vals); -CG_API int CGENTRY cgGetParameterDefaultValueir(CGparameter param, int nelements, int *vals); -CG_API int CGENTRY cgGetParameterDefaultValueic(CGparameter param, int nelements, int *vals); -CG_API const char * CGENTRY cgGetStringParameterValue(CGparameter param); -CG_API void CGENTRY cgSetStringParameterValue(CGparameter param, const char *str); -CG_API int CGENTRY cgGetParameterOrdinalNumber(CGparameter param); -CG_API CGbool CGENTRY cgIsParameterGlobal(CGparameter param); -CG_API int CGENTRY cgGetParameterIndex(CGparameter param); -CG_API void CGENTRY cgSetParameterVariability(CGparameter param, CGenum vary); -CG_API void CGENTRY cgSetParameterSemantic(CGparameter param, const char *semantic); -CG_API void CGENTRY cgSetParameter1f(CGparameter param, float x); -CG_API void CGENTRY cgSetParameter2f(CGparameter param, float x, float y); -CG_API void CGENTRY cgSetParameter3f(CGparameter param, float x, float y, float z); -CG_API void CGENTRY cgSetParameter4f(CGparameter param, float x, float y, float z, float w); -CG_API void CGENTRY cgSetParameter1d(CGparameter param, double x); -CG_API void CGENTRY cgSetParameter2d(CGparameter param, double x, double y); -CG_API void CGENTRY cgSetParameter3d(CGparameter param, double x, double y, double z); -CG_API void CGENTRY cgSetParameter4d(CGparameter param, double x, double y, double z, double w); -CG_API void CGENTRY cgSetParameter1i(CGparameter param, int x); -CG_API void CGENTRY cgSetParameter2i(CGparameter param, int x, int y); -CG_API void CGENTRY cgSetParameter3i(CGparameter param, int x, int y, int z); -CG_API void CGENTRY cgSetParameter4i(CGparameter param, int x, int y, int z, int w); -CG_API void CGENTRY cgSetParameter1iv(CGparameter param, const int *v); -CG_API void CGENTRY cgSetParameter2iv(CGparameter param, const int *v); -CG_API void CGENTRY cgSetParameter3iv(CGparameter param, const int *v); -CG_API void CGENTRY cgSetParameter4iv(CGparameter param, const int *v); -CG_API void CGENTRY cgSetParameter1fv(CGparameter param, const float *v); -CG_API void CGENTRY cgSetParameter2fv(CGparameter param, const float *v); -CG_API void CGENTRY cgSetParameter3fv(CGparameter param, const float *v); -CG_API void CGENTRY cgSetParameter4fv(CGparameter param, const float *v); -CG_API void CGENTRY cgSetParameter1dv(CGparameter param, const double *v); -CG_API void CGENTRY cgSetParameter2dv(CGparameter param, const double *v); -CG_API void CGENTRY cgSetParameter3dv(CGparameter param, const double *v); -CG_API void CGENTRY cgSetParameter4dv(CGparameter param, const double *v); -CG_API void CGENTRY cgSetMatrixParameterir(CGparameter param, const int *matrix); -CG_API void CGENTRY cgSetMatrixParameterdr(CGparameter param, const double *matrix); -CG_API void CGENTRY cgSetMatrixParameterfr(CGparameter param, const float *matrix); -CG_API void CGENTRY cgSetMatrixParameteric(CGparameter param, const int *matrix); -CG_API void CGENTRY cgSetMatrixParameterdc(CGparameter param, const double *matrix); -CG_API void CGENTRY cgSetMatrixParameterfc(CGparameter param, const float *matrix); -CG_API void CGENTRY cgGetMatrixParameterir(CGparameter param, int *matrix); -CG_API void CGENTRY cgGetMatrixParameterdr(CGparameter param, double *matrix); -CG_API void CGENTRY cgGetMatrixParameterfr(CGparameter param, float *matrix); -CG_API void CGENTRY cgGetMatrixParameteric(CGparameter param, int *matrix); -CG_API void CGENTRY cgGetMatrixParameterdc(CGparameter param, double *matrix); -CG_API void CGENTRY cgGetMatrixParameterfc(CGparameter param, float *matrix); -CG_API CGenum CGENTRY cgGetMatrixParameterOrder(CGparameter param); -CG_API CGparameter CGENTRY cgGetNamedSubParameter(CGparameter param, const char *name); -CG_API const char * CGENTRY cgGetTypeString(CGtype type); -CG_API CGtype CGENTRY cgGetType(const char *type_string); -CG_API CGtype CGENTRY cgGetNamedUserType(CGhandle handle, const char *name); -CG_API int CGENTRY cgGetNumUserTypes(CGhandle handle); -CG_API CGtype CGENTRY cgGetUserType(CGhandle handle, int index); -CG_API int CGENTRY cgGetNumParentTypes(CGtype type); -CG_API CGtype CGENTRY cgGetParentType(CGtype type, int index); -CG_API CGbool CGENTRY cgIsParentType(CGtype parent, CGtype child); -CG_API CGbool CGENTRY cgIsInterfaceType(CGtype type); -CG_API const char * CGENTRY cgGetResourceString(CGresource resource); -CG_API CGresource CGENTRY cgGetResource(const char *resource_string); -CG_API const char * CGENTRY cgGetEnumString(CGenum en); -CG_API CGenum CGENTRY cgGetEnum(const char *enum_string); -CG_API const char * CGENTRY cgGetProfileString(CGprofile profile); -CG_API CGprofile CGENTRY cgGetProfile(const char *profile_string); -CG_API int CGENTRY cgGetNumSupportedProfiles(void); -CG_API CGprofile CGENTRY cgGetSupportedProfile(int index); -CG_API CGbool CGENTRY cgIsProfileSupported(CGprofile profile); -CG_API CGbool CGENTRY cgGetProfileProperty(CGprofile profile, CGenum query); -CG_API const char * CGENTRY cgGetParameterClassString(CGparameterclass pc); -CG_API CGparameterclass CGENTRY cgGetParameterClassEnum(const char *pString); -CG_API const char * CGENTRY cgGetDomainString(CGdomain domain); -CG_API CGdomain CGENTRY cgGetDomain(const char *domain_string); -CG_API CGdomain CGENTRY cgGetProgramDomain(CGprogram program); -CG_API CGerror CGENTRY cgGetError(void); -CG_API CGerror CGENTRY cgGetFirstError(void); -CG_API const char * CGENTRY cgGetErrorString(CGerror error); -CG_API const char * CGENTRY cgGetLastErrorString(CGerror *error); -CG_API void CGENTRY cgSetErrorCallback(CGerrorCallbackFunc func); -CG_API CGerrorCallbackFunc CGENTRY cgGetErrorCallback(void); -CG_API void CGENTRY cgSetErrorHandler(CGerrorHandlerFunc func, void *data); -CG_API CGerrorHandlerFunc CGENTRY cgGetErrorHandler(void **data); -CG_API const char * CGENTRY cgGetString(CGenum sname); -CG_API CGeffect CGENTRY cgCreateEffect(CGcontext context, const char *code, const char **args); -CG_API CGeffect CGENTRY cgCreateEffectFromFile(CGcontext context, const char *filename, const char **args); -CG_API CGeffect CGENTRY cgCopyEffect(CGeffect effect); -CG_API void CGENTRY cgDestroyEffect(CGeffect effect); -CG_API CGcontext CGENTRY cgGetEffectContext(CGeffect effect); -CG_API CGbool CGENTRY cgIsEffect(CGeffect effect); -CG_API CGeffect CGENTRY cgGetFirstEffect(CGcontext context); -CG_API CGeffect CGENTRY cgGetNextEffect(CGeffect effect); -CG_API CGprogram CGENTRY cgCreateProgramFromEffect(CGeffect effect, CGprofile profile, const char *entry, const char **args); -CG_API CGtechnique CGENTRY cgGetFirstTechnique(CGeffect effect); -CG_API CGtechnique CGENTRY cgGetNextTechnique(CGtechnique tech); -CG_API CGtechnique CGENTRY cgGetNamedTechnique(CGeffect effect, const char *name); -CG_API const char * CGENTRY cgGetTechniqueName(CGtechnique tech); -CG_API CGbool CGENTRY cgIsTechnique(CGtechnique tech); -CG_API CGbool CGENTRY cgValidateTechnique(CGtechnique tech); -CG_API CGbool CGENTRY cgIsTechniqueValidated(CGtechnique tech); -CG_API CGeffect CGENTRY cgGetTechniqueEffect(CGtechnique tech); -CG_API CGpass CGENTRY cgGetFirstPass(CGtechnique tech); -CG_API CGpass CGENTRY cgGetNamedPass(CGtechnique tech, const char *name); -CG_API CGpass CGENTRY cgGetNextPass(CGpass pass); -CG_API CGbool CGENTRY cgIsPass(CGpass pass); -CG_API const char * CGENTRY cgGetPassName(CGpass pass); -CG_API CGtechnique CGENTRY cgGetPassTechnique(CGpass pass); -CG_API CGprogram CGENTRY cgGetPassProgram(CGpass pass, CGdomain domain); -CG_API void CGENTRY cgSetPassState(CGpass pass); -CG_API void CGENTRY cgResetPassState(CGpass pass); -CG_API CGstateassignment CGENTRY cgGetFirstStateAssignment(CGpass pass); -CG_API CGstateassignment CGENTRY cgGetNamedStateAssignment(CGpass pass, const char *name); -CG_API CGstateassignment CGENTRY cgGetNextStateAssignment(CGstateassignment sa); -CG_API CGbool CGENTRY cgIsStateAssignment(CGstateassignment sa); -CG_API CGbool CGENTRY cgCallStateSetCallback(CGstateassignment sa); -CG_API CGbool CGENTRY cgCallStateValidateCallback(CGstateassignment sa); -CG_API CGbool CGENTRY cgCallStateResetCallback(CGstateassignment sa); -CG_API CGpass CGENTRY cgGetStateAssignmentPass(CGstateassignment sa); -CG_API CGparameter CGENTRY cgGetSamplerStateAssignmentParameter(CGstateassignment sa); -CG_API const float * CGENTRY cgGetFloatStateAssignmentValues(CGstateassignment sa, int *nvalues); -CG_API const int * CGENTRY cgGetIntStateAssignmentValues(CGstateassignment sa, int *nvalues); -CG_API const CGbool * CGENTRY cgGetBoolStateAssignmentValues(CGstateassignment sa, int *nvalues); -CG_API const char * CGENTRY cgGetStringStateAssignmentValue(CGstateassignment sa); -CG_API CGprogram CGENTRY cgGetProgramStateAssignmentValue(CGstateassignment sa); -CG_API CGparameter CGENTRY cgGetTextureStateAssignmentValue(CGstateassignment sa); -CG_API CGparameter CGENTRY cgGetSamplerStateAssignmentValue(CGstateassignment sa); -CG_API int CGENTRY cgGetStateAssignmentIndex(CGstateassignment sa); -CG_API int CGENTRY cgGetNumDependentStateAssignmentParameters(CGstateassignment sa); -CG_API CGparameter CGENTRY cgGetDependentStateAssignmentParameter(CGstateassignment sa, int index); -CG_API int CGENTRY cgGetNumDependentProgramArrayStateAssignmentParameters(CGstateassignment sa); -CG_API CGparameter CGENTRY cgGetDependentProgramArrayStateAssignmentParameter(CGstateassignment sa, int index); -CG_API CGparameter CGENTRY cgGetConnectedStateAssignmentParameter(CGstateassignment sa); -CG_API CGstate CGENTRY cgGetStateAssignmentState(CGstateassignment sa); -CG_API CGstate CGENTRY cgGetSamplerStateAssignmentState(CGstateassignment sa); -CG_API CGstate CGENTRY cgCreateState(CGcontext context, const char *name, CGtype type); -CG_API CGstate CGENTRY cgCreateArrayState(CGcontext context, const char *name, CGtype type, int nelements); -CG_API void CGENTRY cgSetStateCallbacks(CGstate state, CGstatecallback set, CGstatecallback reset, CGstatecallback validate); -CG_API void CGENTRY cgSetStateLatestProfile(CGstate state, CGprofile profile); -CG_API CGstatecallback CGENTRY cgGetStateSetCallback(CGstate state); -CG_API CGstatecallback CGENTRY cgGetStateResetCallback(CGstate state); -CG_API CGstatecallback CGENTRY cgGetStateValidateCallback(CGstate state); -CG_API CGprofile CGENTRY cgGetStateLatestProfile(CGstate state); -CG_API CGcontext CGENTRY cgGetStateContext(CGstate state); -CG_API CGtype CGENTRY cgGetStateType(CGstate state); -CG_API const char * CGENTRY cgGetStateName(CGstate state); -CG_API CGstate CGENTRY cgGetNamedState(CGcontext context, const char *name); -CG_API CGstate CGENTRY cgGetFirstState(CGcontext context); -CG_API CGstate CGENTRY cgGetNextState(CGstate state); -CG_API CGbool CGENTRY cgIsState(CGstate state); -CG_API void CGENTRY cgAddStateEnumerant(CGstate state, const char *name, int value); -CG_API CGstate CGENTRY cgCreateSamplerState(CGcontext context, const char *name, CGtype type); -CG_API CGstate CGENTRY cgCreateArraySamplerState(CGcontext context, const char *name, CGtype type, int nelements); -CG_API CGstate CGENTRY cgGetNamedSamplerState(CGcontext context, const char *name); -CG_API CGstate CGENTRY cgGetFirstSamplerState(CGcontext context); -CG_API CGstateassignment CGENTRY cgGetFirstSamplerStateAssignment(CGparameter param); -CG_API CGstateassignment CGENTRY cgGetNamedSamplerStateAssignment(CGparameter param, const char *name); -CG_API void CGENTRY cgSetSamplerState(CGparameter param); -CG_API CGparameter CGENTRY cgGetNamedEffectParameter(CGeffect effect, const char *name); -CG_API CGparameter CGENTRY cgGetFirstLeafEffectParameter(CGeffect effect); -CG_API CGparameter CGENTRY cgGetFirstEffectParameter(CGeffect effect); -CG_API CGparameter CGENTRY cgGetEffectParameterBySemantic(CGeffect effect, const char *semantic); -CG_API CGannotation CGENTRY cgGetFirstTechniqueAnnotation(CGtechnique tech); -CG_API CGannotation CGENTRY cgGetFirstPassAnnotation(CGpass pass); -CG_API CGannotation CGENTRY cgGetFirstParameterAnnotation(CGparameter param); -CG_API CGannotation CGENTRY cgGetFirstProgramAnnotation(CGprogram program); -CG_API CGannotation CGENTRY cgGetFirstEffectAnnotation(CGeffect effect); -CG_API CGannotation CGENTRY cgGetNextAnnotation(CGannotation ann); -CG_API CGannotation CGENTRY cgGetNamedTechniqueAnnotation(CGtechnique tech, const char *name); -CG_API CGannotation CGENTRY cgGetNamedPassAnnotation(CGpass pass, const char *name); -CG_API CGannotation CGENTRY cgGetNamedParameterAnnotation(CGparameter param, const char *name); -CG_API CGannotation CGENTRY cgGetNamedProgramAnnotation(CGprogram program, const char *name); -CG_API CGannotation CGENTRY cgGetNamedEffectAnnotation(CGeffect effect, const char *name); -CG_API CGbool CGENTRY cgIsAnnotation(CGannotation ann); -CG_API const char * CGENTRY cgGetAnnotationName(CGannotation ann); -CG_API CGtype CGENTRY cgGetAnnotationType(CGannotation ann); -CG_API const float * CGENTRY cgGetFloatAnnotationValues(CGannotation ann, int *nvalues); -CG_API const int * CGENTRY cgGetIntAnnotationValues(CGannotation ann, int *nvalues); -CG_API const char * CGENTRY cgGetStringAnnotationValue(CGannotation ann); -CG_API const char * const * CGENTRY cgGetStringAnnotationValues(CGannotation ann, int *nvalues); -CG_API const CGbool * CGENTRY cgGetBoolAnnotationValues(CGannotation ann, int *nvalues); -CG_API const int * CGENTRY cgGetBooleanAnnotationValues(CGannotation ann, int *nvalues); -CG_API int CGENTRY cgGetNumDependentAnnotationParameters(CGannotation ann); -CG_API CGparameter CGENTRY cgGetDependentAnnotationParameter(CGannotation ann, int index); -CG_API void CGENTRY cgEvaluateProgram(CGprogram program, float *buf, int ncomps, int nx, int ny, int nz); -CG_API CGbool CGENTRY cgSetEffectName(CGeffect effect, const char *name); -CG_API const char * CGENTRY cgGetEffectName(CGeffect effect); -CG_API CGeffect CGENTRY cgGetNamedEffect(CGcontext context, const char *name); -CG_API CGparameter CGENTRY cgCreateEffectParameter(CGeffect effect, const char *name, CGtype type); -CG_API CGtechnique CGENTRY cgCreateTechnique(CGeffect effect, const char *name); -CG_API CGparameter CGENTRY cgCreateEffectParameterArray(CGeffect effect, const char *name, CGtype type, int length); -CG_API CGparameter CGENTRY cgCreateEffectParameterMultiDimArray(CGeffect effect, const char *name, CGtype type, int dim, const int *lengths); -CG_API CGpass CGENTRY cgCreatePass(CGtechnique tech, const char *name); -CG_API CGstateassignment CGENTRY cgCreateStateAssignment(CGpass pass, CGstate state); -CG_API CGstateassignment CGENTRY cgCreateStateAssignmentIndex(CGpass pass, CGstate state, int index); -CG_API CGstateassignment CGENTRY cgCreateSamplerStateAssignment(CGparameter param, CGstate state); -CG_API CGbool CGENTRY cgSetFloatStateAssignment(CGstateassignment sa, float value); -CG_API CGbool CGENTRY cgSetIntStateAssignment(CGstateassignment sa, int value); -CG_API CGbool CGENTRY cgSetBoolStateAssignment(CGstateassignment sa, CGbool value); -CG_API CGbool CGENTRY cgSetStringStateAssignment(CGstateassignment sa, const char *value); -CG_API CGbool CGENTRY cgSetProgramStateAssignment(CGstateassignment sa, CGprogram program); -CG_API CGbool CGENTRY cgSetSamplerStateAssignment(CGstateassignment sa, CGparameter param); -CG_API CGbool CGENTRY cgSetTextureStateAssignment(CGstateassignment sa, CGparameter param); -CG_API CGbool CGENTRY cgSetFloatArrayStateAssignment(CGstateassignment sa, const float *vals); -CG_API CGbool CGENTRY cgSetIntArrayStateAssignment(CGstateassignment sa, const int *vals); -CG_API CGbool CGENTRY cgSetBoolArrayStateAssignment(CGstateassignment sa, const CGbool *vals); -CG_API CGannotation CGENTRY cgCreateTechniqueAnnotation(CGtechnique tech, const char *name, CGtype type); -CG_API CGannotation CGENTRY cgCreatePassAnnotation(CGpass pass, const char *name, CGtype type); -CG_API CGannotation CGENTRY cgCreateParameterAnnotation(CGparameter param, const char *name, CGtype type); -CG_API CGannotation CGENTRY cgCreateProgramAnnotation(CGprogram program, const char *name, CGtype type); -CG_API CGannotation CGENTRY cgCreateEffectAnnotation(CGeffect effect, const char *name, CGtype type); -CG_API CGbool CGENTRY cgSetIntAnnotation(CGannotation ann, int value); -CG_API CGbool CGENTRY cgSetFloatAnnotation(CGannotation ann, float value); -CG_API CGbool CGENTRY cgSetBoolAnnotation(CGannotation ann, CGbool value); -CG_API CGbool CGENTRY cgSetStringAnnotation(CGannotation ann, const char *value); -CG_API int CGENTRY cgGetNumStateEnumerants(CGstate state); -CG_API const char * CGENTRY cgGetStateEnumerant(CGstate state, int index, int *value); -CG_API const char * CGENTRY cgGetStateEnumerantName(CGstate state, int value); -CG_API int CGENTRY cgGetStateEnumerantValue(CGstate state, const char *name); -CG_API CGeffect CGENTRY cgGetParameterEffect(CGparameter param); -CG_API CGparameterclass CGENTRY cgGetTypeClass(CGtype type); -CG_API CGtype CGENTRY cgGetTypeBase(CGtype type); -CG_API CGbool CGENTRY cgGetTypeSizes(CGtype type, int *nrows, int *ncols); -CG_API void CGENTRY cgGetMatrixSize(CGtype type, int *nrows, int *ncols); -CG_API int CGENTRY cgGetNumProgramDomains(CGprogram program); -CG_API CGdomain CGENTRY cgGetProfileDomain(CGprofile profile); -CG_API CGprogram CGENTRY cgCombinePrograms(int n, const CGprogram *exeList); -CG_API CGprogram CGENTRY cgCombinePrograms2(const CGprogram exe1, const CGprogram exe2); -CG_API CGprogram CGENTRY cgCombinePrograms3(const CGprogram exe1, const CGprogram exe2, const CGprogram exe3); -CG_API CGprogram CGENTRY cgCombinePrograms4(const CGprogram exe1, const CGprogram exe2, const CGprogram exe3, const CGprogram exe4); -CG_API CGprogram CGENTRY cgCombinePrograms5(const CGprogram exe1, const CGprogram exe2, const CGprogram exe3, const CGprogram exe4, const CGprogram exe5); -CG_API CGprofile CGENTRY cgGetProgramDomainProfile(CGprogram program, int index); -CG_API CGprogram CGENTRY cgGetProgramDomainProgram(CGprogram program, int index); -CG_API CGobj CGENTRY cgCreateObj(CGcontext context, CGenum program_type, const char *source, CGprofile profile, const char **args); -CG_API CGobj CGENTRY cgCreateObjFromFile(CGcontext context, CGenum program_type, const char *source_file, CGprofile profile, const char **args); -CG_API void CGENTRY cgDestroyObj(CGobj obj); -CG_API long CGENTRY cgGetParameterResourceSize(CGparameter param); -CG_API CGtype CGENTRY cgGetParameterResourceType(CGparameter param); -CG_API const char * CGENTRY cgGetParameterResourceName(CGparameter param); -CG_API int CGENTRY cgGetParameterBufferIndex(CGparameter param); -CG_API int CGENTRY cgGetParameterBufferOffset(CGparameter param); -CG_API CGbuffer CGENTRY cgCreateBuffer(CGcontext context, int size, const void *data, CGbufferusage bufferUsage); -CG_API void CGENTRY cgSetBufferData(CGbuffer buffer, int size, const void *data); -CG_API void CGENTRY cgSetBufferSubData(CGbuffer buffer, int offset, int size, const void *data); -CG_API void CGENTRY cgSetProgramBuffer(CGprogram program, int bufferIndex, CGbuffer buffer); -CG_API void * CGENTRY cgMapBuffer(CGbuffer buffer, CGbufferaccess access); -CG_API void CGENTRY cgUnmapBuffer(CGbuffer buffer); -CG_API void CGENTRY cgDestroyBuffer(CGbuffer buffer); -CG_API CGbuffer CGENTRY cgGetProgramBuffer(CGprogram program, int bufferIndex); -CG_API int CGENTRY cgGetBufferSize(CGbuffer buffer); -CG_API int CGENTRY cgGetProgramBufferMaxSize(CGprofile profile); -CG_API int CGENTRY cgGetProgramBufferMaxIndex(CGprofile profile); -CG_API CGbuffer CGENTRY cgGetEffectParameterBuffer(CGparameter param); -CG_API void CGENTRY cgSetEffectParameterBuffer(CGparameter param, CGbuffer buffer); - -#endif - -#ifdef __cplusplus -} -#endif - -#ifdef CG_APIENTRY_DEFINED -# undef CG_APIENTRY_DEFINED -# undef APIENTRY -#endif - -#ifdef CG_WINGDIAPI_DEFINED -# undef CG_WINGDIAPI_DEFINED -# undef WINGDIAPI -#endif - -#endif diff --git a/Externals/Cg/cg.lib b/Externals/Cg/cg.lib deleted file mode 100644 index ec8b5c81ac..0000000000 Binary files a/Externals/Cg/cg.lib and /dev/null differ diff --git a/Externals/Cg/cgGL.dll b/Externals/Cg/cgGL.dll deleted file mode 100644 index 1285c6b2b7..0000000000 Binary files a/Externals/Cg/cgGL.dll and /dev/null differ diff --git a/Externals/Cg/cgGL.h b/Externals/Cg/cgGL.h deleted file mode 100644 index e27c2ae340..0000000000 --- a/Externals/Cg/cgGL.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * - * Copyright (c) 2002-2010, NVIDIA Corporation. - * - * - * - * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration - * of your agreement to the following terms, and your use, installation, - * modification or redistribution of this NVIDIA software constitutes - * acceptance of these terms. If you do not agree with these terms, please do - * not use, install, modify or redistribute this NVIDIA software. - * - * - * - * In consideration of your agreement to abide by the following terms, and - * subject to these terms, NVIDIA grants you a personal, non-exclusive license, - * under NVIDIA's copyrights in this original NVIDIA software (the "NVIDIA - * Software"), to use, reproduce, modify and redistribute the NVIDIA - * Software, with or without modifications, in source and/or binary forms; - * provided that if you redistribute the NVIDIA Software, you must retain the - * copyright notice of NVIDIA, this notice and the following text and - * disclaimers in all such redistributions of the NVIDIA Software. Neither the - * name, trademarks, service marks nor logos of NVIDIA Corporation may be used - * to endorse or promote products derived from the NVIDIA Software without - * specific prior written permission from NVIDIA. Except as expressly stated - * in this notice, no other rights or licenses express or implied, are granted - * by NVIDIA herein, including but not limited to any patent rights that may be - * infringed by your derivative works or by other works in which the NVIDIA - * Software may be incorporated. No hardware is licensed hereunder. - * - * - * - * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING - * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION - * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS. - * - * - * - * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, - * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST - * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE, - * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE, - * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING - * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef _cggl_h -#define _cggl_h - -/*************************************************************************/ -/*** CGGL Run-Time Library API ***/ -/*************************************************************************/ - -#include - -#ifdef _WIN32 -# ifndef APIENTRY /* From Win32's */ -# define CGGL_APIENTRY_DEFINED -# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__) -# define APIENTRY __stdcall -# else -# define APIENTRY -# endif -# endif -# ifndef WINGDIAPI /* From Win32's and */ -# define CGGL_WINGDIAPI_DEFINED -# define WINGDIAPI __declspec(dllimport) -# endif -#endif /* _WIN32 */ - -/* Set up CGGL_API for Win32 dllexport or gcc visibility. */ - -#ifndef CGGL_API -# ifdef CGGL_EXPORTS -# ifdef _WIN32 -# define CGGL_API __declspec(dllexport) -# elif defined(__GNUC__) && __GNUC__>=4 -# define CGGL_API __attribute__ ((visibility("default"))) -# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) -# define CGGL_API __global -# else -# define CGGL_API -# endif -# else -# define CGGL_API -# endif -#endif - -#ifndef CGGLENTRY -# ifdef _WIN32 -# define CGGLENTRY __cdecl -# else -# define CGGLENTRY -# endif -#endif - -#ifdef __APPLE__ -#include -#else -#include -#endif - -/*************************************************************************/ -/*** Data types and enumerants ***/ -/*************************************************************************/ - -typedef enum -{ - CG_GL_MATRIX_IDENTITY = 0, - CG_GL_MATRIX_TRANSPOSE = 1, - CG_GL_MATRIX_INVERSE = 2, - CG_GL_MATRIX_INVERSE_TRANSPOSE = 3, - CG_GL_MODELVIEW_MATRIX = 4, - CG_GL_PROJECTION_MATRIX = 5, - CG_GL_TEXTURE_MATRIX = 6, - CG_GL_MODELVIEW_PROJECTION_MATRIX = 7, - CG_GL_VERTEX = 8, - CG_GL_FRAGMENT = 9, - CG_GL_GEOMETRY = 10, - CG_GL_TESSELLATION_CONTROL = 11, - CG_GL_TESSELLATION_EVALUATION = 12 -} CGGLenum; - -#ifdef __cplusplus -extern "C" -{ -#endif - -/*************************************************************************/ -/*** Functions ***/ -/*************************************************************************/ - -#ifndef CGGL_EXPLICIT - -CGGL_API CGbool CGGLENTRY cgGLIsProfileSupported(CGprofile profile); -CGGL_API void CGGLENTRY cgGLEnableProfile(CGprofile profile); -CGGL_API void CGGLENTRY cgGLDisableProfile(CGprofile profile); -CGGL_API CGprofile CGGLENTRY cgGLGetLatestProfile(CGGLenum profile_type); -CGGL_API void CGGLENTRY cgGLSetOptimalOptions(CGprofile profile); -CGGL_API char const ** CGGLENTRY cgGLGetOptimalOptions(CGprofile profile); -CGGL_API void CGGLENTRY cgGLLoadProgram(CGprogram program); -CGGL_API void CGGLENTRY cgGLUnloadProgram(CGprogram program); -CGGL_API CGbool CGGLENTRY cgGLIsProgramLoaded(CGprogram program); -CGGL_API void CGGLENTRY cgGLBindProgram(CGprogram program); -CGGL_API void CGGLENTRY cgGLUnbindProgram(CGprofile profile); -CGGL_API GLuint CGGLENTRY cgGLGetProgramID(CGprogram program); -CGGL_API void CGGLENTRY cgGLSetParameter1f(CGparameter param, float x); -CGGL_API void CGGLENTRY cgGLSetParameter2f(CGparameter param, float x, float y); -CGGL_API void CGGLENTRY cgGLSetParameter3f(CGparameter param, float x, float y, float z); -CGGL_API void CGGLENTRY cgGLSetParameter4f(CGparameter param, float x, float y, float z, float w); -CGGL_API void CGGLENTRY cgGLSetParameter1fv(CGparameter param, const float *v); -CGGL_API void CGGLENTRY cgGLSetParameter2fv(CGparameter param, const float *v); -CGGL_API void CGGLENTRY cgGLSetParameter3fv(CGparameter param, const float *v); -CGGL_API void CGGLENTRY cgGLSetParameter4fv(CGparameter param, const float *v); -CGGL_API void CGGLENTRY cgGLSetParameter1d(CGparameter param, double x); -CGGL_API void CGGLENTRY cgGLSetParameter2d(CGparameter param, double x, double y); -CGGL_API void CGGLENTRY cgGLSetParameter3d(CGparameter param, double x, double y, double z); -CGGL_API void CGGLENTRY cgGLSetParameter4d(CGparameter param, double x, double y, double z, double w); -CGGL_API void CGGLENTRY cgGLSetParameter1dv(CGparameter param, const double *v); -CGGL_API void CGGLENTRY cgGLSetParameter2dv(CGparameter param, const double *v); -CGGL_API void CGGLENTRY cgGLSetParameter3dv(CGparameter param, const double *v); -CGGL_API void CGGLENTRY cgGLSetParameter4dv(CGparameter param, const double *v); -CGGL_API void CGGLENTRY cgGLGetParameter1f(CGparameter param, float *v); -CGGL_API void CGGLENTRY cgGLGetParameter2f(CGparameter param, float *v); -CGGL_API void CGGLENTRY cgGLGetParameter3f(CGparameter param, float *v); -CGGL_API void CGGLENTRY cgGLGetParameter4f(CGparameter param, float *v); -CGGL_API void CGGLENTRY cgGLGetParameter1d(CGparameter param, double *v); -CGGL_API void CGGLENTRY cgGLGetParameter2d(CGparameter param, double *v); -CGGL_API void CGGLENTRY cgGLGetParameter3d(CGparameter param, double *v); -CGGL_API void CGGLENTRY cgGLGetParameter4d(CGparameter param, double *v); -CGGL_API void CGGLENTRY cgGLSetParameterArray1f(CGparameter param, long offset, long nelements, const float *v); -CGGL_API void CGGLENTRY cgGLSetParameterArray2f(CGparameter param, long offset, long nelements, const float *v); -CGGL_API void CGGLENTRY cgGLSetParameterArray3f(CGparameter param, long offset, long nelements, const float *v); -CGGL_API void CGGLENTRY cgGLSetParameterArray4f(CGparameter param, long offset, long nelements, const float *v); -CGGL_API void CGGLENTRY cgGLSetParameterArray1d(CGparameter param, long offset, long nelements, const double *v); -CGGL_API void CGGLENTRY cgGLSetParameterArray2d(CGparameter param, long offset, long nelements, const double *v); -CGGL_API void CGGLENTRY cgGLSetParameterArray3d(CGparameter param, long offset, long nelements, const double *v); -CGGL_API void CGGLENTRY cgGLSetParameterArray4d(CGparameter param, long offset, long nelements, const double *v); -CGGL_API void CGGLENTRY cgGLGetParameterArray1f(CGparameter param, long offset, long nelements, float *v); -CGGL_API void CGGLENTRY cgGLGetParameterArray2f(CGparameter param, long offset, long nelements, float *v); -CGGL_API void CGGLENTRY cgGLGetParameterArray3f(CGparameter param, long offset, long nelements, float *v); -CGGL_API void CGGLENTRY cgGLGetParameterArray4f(CGparameter param, long offset, long nelements, float *v); -CGGL_API void CGGLENTRY cgGLGetParameterArray1d(CGparameter param, long offset, long nelements, double *v); -CGGL_API void CGGLENTRY cgGLGetParameterArray2d(CGparameter param, long offset, long nelements, double *v); -CGGL_API void CGGLENTRY cgGLGetParameterArray3d(CGparameter param, long offset, long nelements, double *v); -CGGL_API void CGGLENTRY cgGLGetParameterArray4d(CGparameter param, long offset, long nelements, double *v); -CGGL_API void CGGLENTRY cgGLSetParameterPointer(CGparameter param, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); -CGGL_API void CGGLENTRY cgGLEnableClientState(CGparameter param); -CGGL_API void CGGLENTRY cgGLDisableClientState(CGparameter param); -CGGL_API void CGGLENTRY cgGLSetMatrixParameterdr(CGparameter param, const double *matrix); -CGGL_API void CGGLENTRY cgGLSetMatrixParameterfr(CGparameter param, const float *matrix); -CGGL_API void CGGLENTRY cgGLSetMatrixParameterdc(CGparameter param, const double *matrix); -CGGL_API void CGGLENTRY cgGLSetMatrixParameterfc(CGparameter param, const float *matrix); -CGGL_API void CGGLENTRY cgGLGetMatrixParameterdr(CGparameter param, double *matrix); -CGGL_API void CGGLENTRY cgGLGetMatrixParameterfr(CGparameter param, float *matrix); -CGGL_API void CGGLENTRY cgGLGetMatrixParameterdc(CGparameter param, double *matrix); -CGGL_API void CGGLENTRY cgGLGetMatrixParameterfc(CGparameter param, float *matrix); -CGGL_API void CGGLENTRY cgGLSetStateMatrixParameter(CGparameter param, CGGLenum matrix, CGGLenum transform); -CGGL_API void CGGLENTRY cgGLSetMatrixParameterArrayfc(CGparameter param, long offset, long nelements, const float *matrices); -CGGL_API void CGGLENTRY cgGLSetMatrixParameterArrayfr(CGparameter param, long offset, long nelements, const float *matrices); -CGGL_API void CGGLENTRY cgGLSetMatrixParameterArraydc(CGparameter param, long offset, long nelements, const double *matrices); -CGGL_API void CGGLENTRY cgGLSetMatrixParameterArraydr(CGparameter param, long offset, long nelements, const double *matrices); -CGGL_API void CGGLENTRY cgGLGetMatrixParameterArrayfc(CGparameter param, long offset, long nelements, float *matrices); -CGGL_API void CGGLENTRY cgGLGetMatrixParameterArrayfr(CGparameter param, long offset, long nelements, float *matrices); -CGGL_API void CGGLENTRY cgGLGetMatrixParameterArraydc(CGparameter param, long offset, long nelements, double *matrices); -CGGL_API void CGGLENTRY cgGLGetMatrixParameterArraydr(CGparameter param, long offset, long nelements, double *matrices); -CGGL_API void CGGLENTRY cgGLSetTextureParameter(CGparameter param, GLuint texobj); -CGGL_API GLuint CGGLENTRY cgGLGetTextureParameter(CGparameter param); -CGGL_API void CGGLENTRY cgGLEnableTextureParameter(CGparameter param); -CGGL_API void CGGLENTRY cgGLDisableTextureParameter(CGparameter param); -CGGL_API GLenum CGGLENTRY cgGLGetTextureEnum(CGparameter param); -CGGL_API void CGGLENTRY cgGLSetManageTextureParameters(CGcontext ctx, CGbool flag); -CGGL_API CGbool CGGLENTRY cgGLGetManageTextureParameters(CGcontext ctx); -CGGL_API void CGGLENTRY cgGLSetupSampler(CGparameter param, GLuint texobj); -CGGL_API void CGGLENTRY cgGLRegisterStates(CGcontext ctx); -CGGL_API void CGGLENTRY cgGLEnableProgramProfiles(CGprogram program); -CGGL_API void CGGLENTRY cgGLDisableProgramProfiles(CGprogram program); -CGGL_API void CGGLENTRY cgGLSetDebugMode(CGbool debug); -CGGL_API CGbuffer CGGLENTRY cgGLCreateBuffer(CGcontext context, int size, const void *data, GLenum bufferUsage); -CGGL_API GLuint CGGLENTRY cgGLGetBufferObject(CGbuffer buffer); - -#endif - -#ifdef __cplusplus -} -#endif - -#ifdef CGGL_APIENTRY_DEFINED -# undef CGGL_APIENTRY_DEFINED -# undef APIENTRY -#endif - -#ifdef CGGL_WINGDIAPI_DEFINED -# undef CGGL_WINGDIAPI_DEFINED -# undef WINGDIAPI -#endif - -#endif diff --git a/Externals/Cg/cgGL.lib b/Externals/Cg/cgGL.lib deleted file mode 100644 index 8430501358..0000000000 Binary files a/Externals/Cg/cgGL.lib and /dev/null differ diff --git a/Externals/Cg64/cg.dll b/Externals/Cg64/cg.dll deleted file mode 100644 index 9ac5675348..0000000000 Binary files a/Externals/Cg64/cg.dll and /dev/null differ diff --git a/Externals/Cg64/cg.lib b/Externals/Cg64/cg.lib deleted file mode 100644 index 806a0c84db..0000000000 Binary files a/Externals/Cg64/cg.lib and /dev/null differ diff --git a/Externals/Cg64/cgGL.dll b/Externals/Cg64/cgGL.dll deleted file mode 100644 index d43ade7349..0000000000 Binary files a/Externals/Cg64/cgGL.dll and /dev/null differ diff --git a/Externals/Cg64/cgGL.lib b/Externals/Cg64/cgGL.lib deleted file mode 100644 index ef88576344..0000000000 Binary files a/Externals/Cg64/cgGL.lib and /dev/null differ diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp index 10399b159f..e7086da7b3 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp @@ -85,7 +85,7 @@ void PixelShaderManager::Shutdown() void PixelShaderManager::SetConstants() { - if (g_ActiveConfig.bUseGLSL && !g_ActiveConfig.backend_info.bSupportsGLSLUBO) + if (!g_ActiveConfig.backend_info.bSupportsGLSLUBO) Dirty(); for (int i = 0; i < 2; ++i) { diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index 5d62686ac9..fbd5d9e779 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -184,7 +184,7 @@ void VertexShaderManager::Dirty() // TODO: A cleaner way to control the matricies without making a mess in the parameters field void VertexShaderManager::SetConstants() { - if (g_ActiveConfig.bUseGLSL && !g_ActiveConfig.backend_info.bSupportsGLSLUBO) + if (!g_ActiveConfig.backend_info.bSupportsGLSLUBO) Dirty(); if (nTransformMatricesChanged[0] >= 0) { diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp index 08b3daca94..c4aa1cc2b0 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.cpp +++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp @@ -87,7 +87,6 @@ void VideoConfig::Load(const char *ini_file) iniFile.Get("Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0); iniFile.Get("Settings", "WireFrame", &bWireFrame, 0); iniFile.Get("Settings", "DisableFog", &bDisableFog, 0); - iniFile.Get("Settings", "UseGLSL", &bUseGLSL, true); iniFile.Get("Settings", "EnableOpenCL", &bEnableOpenCL, false); iniFile.Get("Settings", "OMPDecoder", &bOMPDecoder, false); @@ -143,7 +142,6 @@ void VideoConfig::GameIniLoad(const char *ini_file) iniFile.GetIfExists("Video_Settings", "DisableFog", &bDisableFog); iniFile.GetIfExists("Video_Settings", "EnableOpenCL", &bEnableOpenCL); iniFile.GetIfExists("Video_Settings", "OMPDecoder", &bOMPDecoder); - iniFile.GetIfExists("Video_Settings", "UseGLSL", &bUseGLSL); iniFile.GetIfExists("Video_Enhancements", "ForceFiltering", &bForceFiltering); iniFile.GetIfExists("Video_Enhancements", "MaxAnisotropy", &iMaxAnisotropy); // NOTE - this is x in (1 << x) @@ -176,7 +174,6 @@ void VideoConfig::VerifyValidity() if (!backend_info.bSupports3DVision) b3DVision = false; if (!backend_info.bSupportsFormatReinterpretation) bEFBEmulateFormatChanges = false; if (!backend_info.bSupportsPixelLighting) bEnablePixelLighting = false; - if (!backend_info.bSupportsGLSL) bUseGLSL = false; } void VideoConfig::Save(const char *ini_file) @@ -218,7 +215,6 @@ void VideoConfig::Save(const char *ini_file) iniFile.Set("Settings", "Wireframe", bWireFrame); iniFile.Set("Settings", "DstAlphaPass", bDstAlphaPass); iniFile.Set("Settings", "DisableFog", bDisableFog); - iniFile.Set("Settings", "UseGLSL", bUseGLSL); iniFile.Set("Settings", "EnableOpenCL", bEnableOpenCL); iniFile.Set("Settings", "OMPDecoder", bOMPDecoder); @@ -281,7 +277,6 @@ void VideoConfig::GameIniSave(const char* default_ini, const char* game_ini) SET_IF_DIFFERS("Video_Settings", "DisableFog", bDisableFog); SET_IF_DIFFERS("Video_Settings", "EnableOpenCL", bEnableOpenCL); SET_IF_DIFFERS("Video_Settings", "OMPDecoder", bOMPDecoder); - SET_IF_DIFFERS("Video_Settings", "UseGLSL", bUseGLSL); SET_IF_DIFFERS("Video_Enhancements", "ForceFiltering", bForceFiltering); SET_IF_DIFFERS("Video_Enhancements", "MaxAnisotropy", iMaxAnisotropy); // NOTE - this is x in (1 << x) diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h index 92afaa313d..064f8278a7 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.h +++ b/Source/Core/VideoCommon/Src/VideoConfig.h @@ -103,7 +103,6 @@ struct VideoConfig bool bWireFrame; bool bDstAlphaPass; bool bDisableFog; - bool bUseGLSL; // Utility bool bDumpTextures; diff --git a/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt b/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt index 2a43a85b92..ef41dd35af 100644 --- a/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt +++ b/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt @@ -23,12 +23,6 @@ if(wxWidgets_FOUND) set(LIBS ${LIBS} ${wxWidgets_LIBRARIES}) endif(wxWidgets_FOUND) -if(HAVE_CG AND (APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux")) - set(LIBS ${LIBS} Cg CgGL) -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - list(APPEND LIBS "${CMAKE_SOURCE_DIR}/Externals/Cg/Cg.framework") -endif() - if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(LIBS ${LIBS} clrun) endif() diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h index db7cf822e4..3a1e5d84e3 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h @@ -113,13 +113,6 @@ bool OpenGL_ReportFBOError(const char *function, const char *file, int line); #define GL_REPORT_PROGRAM_ERROR() (void)0 #endif -#if HAVE_CG && (defined __APPLE__ || defined __linux__ || defined _WIN32) -#include -#include -extern CGcontext g_cgcontext; -extern CGprofile g_cgvProf, g_cgfProf; -#endif - // Isn't defined if we aren't using GLEW 1.6 #ifndef GL_ONE_MINUS_SRC1_ALPHA #define GL_ONE_MINUS_SRC1_ALPHA 0x88FB diff --git a/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp index e682da83c2..6bc91b005c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp @@ -50,11 +50,6 @@ bool PixelShaderCache::ShaderEnabled; PixelShaderCache::PSCacheEntry* PixelShaderCache::last_entry = NULL; PIXELSHADERUID PixelShaderCache::last_uid; -void (*pSetPSConstant4f)(unsigned int, float, float, float, float); -void (*pSetPSConstant4fv)(unsigned int, const float*); -void (*pSetMultiPSConstant4fv)(unsigned int, unsigned int, const float*); -bool (*pCompilePixelShader)(FRAGMENTSHADER&, const char*); - GLuint PixelShaderCache::GetDepthMatrixProgram() { return s_DepthMatrixProgram.glprogid; @@ -73,207 +68,88 @@ void PixelShaderCache::Init() GL_REPORT_ERRORD(); s_displayCompileAlert = true; + + char pmatrixprog[2048]; + sprintf(pmatrixprog, "#version %s\n" + "#extension GL_ARB_texture_rectangle : enable\n" + "%s\n" + "%suniform sampler2DRect samp0;\n" + "%s\n" + "%svec4 " I_COLORS"[7];\n" + "%s\n" + "void main(){\n" + "vec4 Temp0, Temp1;\n" + "vec4 K0 = vec4(0.5, 0.5, 0.5, 0.5);\n" + "Temp0 = texture2DRect(samp0, gl_TexCoord[0].xy);\n" + "Temp0 = Temp0 * " I_COLORS"[%d];\n" + "Temp0 = Temp0 + K0;\n" + "Temp0 = floor(Temp0);\n" + "Temp0 = Temp0 * " I_COLORS"[%d];\n" + "Temp1.x = dot(Temp0, " I_COLORS"[%d]);\n" + "Temp1.y = dot(Temp0, " I_COLORS"[%d]);\n" + "Temp1.z = dot(Temp0, " I_COLORS"[%d]);\n" + "Temp1.w = dot(Temp0, " I_COLORS"[%d]);\n" + "gl_FragData[0] = Temp1 + " I_COLORS"[%d];\n" + "}\n", + (g_ActiveConfig.backend_info.bSupportsGLSLUBO || g_ActiveConfig.backend_info.bSupportsGLSLBinding) ? "330 compatibility" : "120", + g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "#extension GL_ARB_shading_language_420pack : enable" : "", + g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "layout(binding = 0) " : "", + g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "layout(std140) uniform PSBlock {" : "", + g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "" : "uniform ", + g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "};" : "", + C_COLORS+5, C_COLORS+6, C_COLORS, C_COLORS+1, C_COLORS+2, C_COLORS+3, C_COLORS+4); - if (g_ActiveConfig.bUseGLSL) + + if (!PixelShaderCache::CompilePixelShader(s_ColorMatrixProgram, pmatrixprog)) { - pSetPSConstant4f = SetGLSLPSConstant4f; - pSetPSConstant4fv = SetGLSLPSConstant4fv; - pSetMultiPSConstant4fv = SetMultiGLSLPSConstant4fv; - pCompilePixelShader = CompileGLSLPixelShader; - } - else - { - pSetPSConstant4f = SetCGPSConstant4f; - pSetPSConstant4fv = SetCGPSConstant4fv; - pSetMultiPSConstant4fv = SetMultiCGPSConstant4fv; - pCompilePixelShader = CompileCGPixelShader; - glEnable(GL_FRAGMENT_PROGRAM_ARB); + ERROR_LOG(VIDEO, "Failed to create color matrix fragment program"); + s_ColorMatrixProgram.Destroy(); } - glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB, (GLint *)&s_nMaxPixelInstructions); + sprintf(pmatrixprog, "#version %s\n" + "#extension GL_ARB_texture_rectangle : enable\n" + "%s\n" + "%suniform sampler2DRect samp0;\n" + "%s\n" + "%svec4 " I_COLORS"[5];\n" + "%s\n" + "void main(){\n" + "vec4 R0, R1, R2;\n" + "vec4 K0 = vec4(255.99998474121, 0.003921568627451, 256.0, 0.0);\n" + "vec4 K1 = vec4(15.0, 0.066666666666, 0.0, 0.0);\n" + "R2 = texture2DRect(samp0, gl_TexCoord[0].xy);\n" + "R0.x = R2.x * K0.x;\n" + "R0.x = floor(R0).x;\n" + "R0.yzw = (R0 - R0.x).yzw;\n" + "R0.yzw = (R0 * K0.z).yzw;\n" + "R0.y = floor(R0).y;\n" + "R0.zw = (R0 - R0.y).zw;\n" + "R0.zw = (R0 * K0.z).zw;\n" + "R0.z = floor(R0).z;\n" + "R0.w = R0.x;\n" + "R0 = R0 * K0.y;\n" + "R0.w = (R0 * K1.x).w;\n" + "R0.w = floor(R0).w;\n" + "R0.w = (R0 * K1.y).w;\n" + "R1.x = dot(R0, " I_COLORS"[%d]);\n" + "R1.y = dot(R0, " I_COLORS"[%d]);\n" + "R1.z = dot(R0, " I_COLORS"[%d]);\n" + "R1.w = dot(R0, " I_COLORS"[%d]);\n" + "gl_FragData[0] = R1 * " I_COLORS"[%d];\n" + "}\n", + (g_ActiveConfig.backend_info.bSupportsGLSLUBO || g_ActiveConfig.backend_info.bSupportsGLSLBinding) ? "330 compatibility" : "120", + g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "#extension GL_ARB_shading_language_420pack : enable" : "", + g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "layout(binding = 0) " : "", + g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "layout(std140) uniform PSBlock {" : "", + g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "" : "uniform ", + g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "};" : "", + C_COLORS, C_COLORS+1, C_COLORS+2, C_COLORS+3, C_COLORS+4); - if (s_nMaxPixelInstructions == 0) // Some combination of drivers and hardware returns zero for some reason. - s_nMaxPixelInstructions = 4096; - if (strstr((const char*)glGetString(GL_VENDOR), "Humper") != NULL) s_nMaxPixelInstructions = 4096; -#if CG_VERSION_NUM == 2100 - if (strstr((const char*)glGetString(GL_VENDOR), "ATI") != NULL) + if (!PixelShaderCache::CompilePixelShader(s_DepthMatrixProgram, pmatrixprog)) { - s_nMaxPixelInstructions = 4096; + ERROR_LOG(VIDEO, "Failed to create depth matrix fragment program"); + s_DepthMatrixProgram.Destroy(); } -#endif - - int maxinst, maxattribs; - glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, (GLint *)&maxinst); - glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB, (GLint *)&maxattribs); - INFO_LOG(VIDEO, "pixel max_alu=%d, max_inst=%d, max_attrib=%d", s_nMaxPixelInstructions, maxinst, maxattribs); - if (g_ActiveConfig.bUseGLSL) - { - char pmatrixprog[2048]; - sprintf(pmatrixprog, "#version %s\n" - "#extension GL_ARB_texture_rectangle : enable\n" - "%s\n" - "%suniform sampler2DRect samp0;\n" - "%s\n" - "%svec4 " I_COLORS"[7];\n" - "%s\n" - "void main(){\n" - "vec4 Temp0, Temp1;\n" - "vec4 K0 = vec4(0.5, 0.5, 0.5, 0.5);\n" - "Temp0 = texture2DRect(samp0, gl_TexCoord[0].xy);\n" - "Temp0 = Temp0 * " I_COLORS"[%d];\n" - "Temp0 = Temp0 + K0;\n" - "Temp0 = floor(Temp0);\n" - "Temp0 = Temp0 * " I_COLORS"[%d];\n" - "Temp1.x = dot(Temp0, " I_COLORS"[%d]);\n" - "Temp1.y = dot(Temp0, " I_COLORS"[%d]);\n" - "Temp1.z = dot(Temp0, " I_COLORS"[%d]);\n" - "Temp1.w = dot(Temp0, " I_COLORS"[%d]);\n" - "gl_FragData[0] = Temp1 + " I_COLORS"[%d];\n" - "}\n", - (g_ActiveConfig.backend_info.bSupportsGLSLUBO || g_ActiveConfig.backend_info.bSupportsGLSLBinding) ? "330 compatibility" : "120", - g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "#extension GL_ARB_shading_language_420pack : enable" : "", - g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "layout(binding = 0) " : "", - g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "layout(std140) uniform PSBlock {" : "", - g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "" : "uniform ", - g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "};" : "", - C_COLORS+5, C_COLORS+6, C_COLORS, C_COLORS+1, C_COLORS+2, C_COLORS+3, C_COLORS+4); - - - if (!PixelShaderCache::CompilePixelShader(s_ColorMatrixProgram, pmatrixprog)) - { - ERROR_LOG(VIDEO, "Failed to create color matrix fragment program"); - s_ColorMatrixProgram.Destroy(); - } - - sprintf(pmatrixprog, "#version %s\n" - "#extension GL_ARB_texture_rectangle : enable\n" - "%s\n" - "%suniform sampler2DRect samp0;\n" - "%s\n" - "%svec4 " I_COLORS"[5];\n" - "%s\n" - "void main(){\n" - "vec4 R0, R1, R2;\n" - "vec4 K0 = vec4(255.99998474121, 0.003921568627451, 256.0, 0.0);\n" - "vec4 K1 = vec4(15.0, 0.066666666666, 0.0, 0.0);\n" - "R2 = texture2DRect(samp0, gl_TexCoord[0].xy);\n" - "R0.x = R2.x * K0.x;\n" - "R0.x = floor(R0).x;\n" - "R0.yzw = (R0 - R0.x).yzw;\n" - "R0.yzw = (R0 * K0.z).yzw;\n" - "R0.y = floor(R0).y;\n" - "R0.zw = (R0 - R0.y).zw;\n" - "R0.zw = (R0 * K0.z).zw;\n" - "R0.z = floor(R0).z;\n" - "R0.w = R0.x;\n" - "R0 = R0 * K0.y;\n" - "R0.w = (R0 * K1.x).w;\n" - "R0.w = floor(R0).w;\n" - "R0.w = (R0 * K1.y).w;\n" - "R1.x = dot(R0, " I_COLORS"[%d]);\n" - "R1.y = dot(R0, " I_COLORS"[%d]);\n" - "R1.z = dot(R0, " I_COLORS"[%d]);\n" - "R1.w = dot(R0, " I_COLORS"[%d]);\n" - "gl_FragData[0] = R1 * " I_COLORS"[%d];\n" - "}\n", - (g_ActiveConfig.backend_info.bSupportsGLSLUBO || g_ActiveConfig.backend_info.bSupportsGLSLBinding) ? "330 compatibility" : "120", - g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "#extension GL_ARB_shading_language_420pack : enable" : "", - g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "layout(binding = 0) " : "", - g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "layout(std140) uniform PSBlock {" : "", - g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "" : "uniform ", - g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "};" : "", - C_COLORS, C_COLORS+1, C_COLORS+2, C_COLORS+3, C_COLORS+4); - - if (!PixelShaderCache::CompilePixelShader(s_DepthMatrixProgram, pmatrixprog)) - { - ERROR_LOG(VIDEO, "Failed to create depth matrix fragment program"); - s_DepthMatrixProgram.Destroy(); - } - } - else - { - char pmatrixprog[2048]; - sprintf(pmatrixprog, "!!ARBfp1.0" - "TEMP R0;\n" - "TEMP R1;\n" - "PARAM K0 = { 0.5, 0.5, 0.5, 0.5};\n" - "TEX R0, fragment.texcoord[0], texture[0], RECT;\n" - "MUL R0, R0, program.env[%d];\n" - "ADD R0, R0, K0;\n" - "FLR R0, R0;\n" - "MUL R0, R0, program.env[%d];\n" - "DP4 R1.x, R0, program.env[%d];\n" - "DP4 R1.y, R0, program.env[%d];\n" - "DP4 R1.z, R0, program.env[%d];\n" - "DP4 R1.w, R0, program.env[%d];\n" - "ADD result.color, R1, program.env[%d];\n" - "END\n",C_COLORS+5,C_COLORS+6, C_COLORS, C_COLORS+1, C_COLORS+2, C_COLORS+3, C_COLORS+4); - glGenProgramsARB(1, &s_ColorMatrixProgram.glprogid); - SetCurrentShader(s_ColorMatrixProgram.glprogid); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, (GLsizei)strlen(pmatrixprog), pmatrixprog); - - GLenum err = GL_REPORT_ERROR(); - if (err != GL_NO_ERROR) { - ERROR_LOG(VIDEO, "Failed to create color matrix fragment program"); - s_ColorMatrixProgram.Destroy(); - } - - sprintf(pmatrixprog, "!!ARBfp1.0\n" - "TEMP R0;\n" - "TEMP R1;\n" - "TEMP R2;\n" - //16777215/16777216*256, 1/255, 256, 0 - "PARAM K0 = { 255.99998474121, 0.003921568627451, 256.0, 0.0};\n" - "PARAM K1 = { 15.0, 0.066666666666, 0.0, 0.0};\n" - //sample the depth value - "TEX R2, fragment.texcoord[0], texture[0], RECT;\n" - - //scale from [0*16777216..1*16777216] to - //[0*16777215..1*16777215], multiply by 256 - "MUL R0, R2.x, K0.x;\n" // *16777215/16777216*256 - - //It is easy to get bad results due to low precision - //here, for example converting like this: - //MUL R0,R0,{ 65536, 256, 1, 16777216 } - //FRC R0,R0 - //gives {?, 128/255, 254/255, ?} for depth value 254/255 - //on some gpus - - "FLR R0.x,R0;\n" //bits 31..24 - - "SUB R0.yzw,R0,R0.x;\n" //subtract bits 31..24 from rest - "MUL R0.yzw,R0,K0.z;\n" // *256 - "FLR R0.y,R0;\n" //bits 23..16 - - "SUB R0.zw,R0,R0.y;\n" //subtract bits 23..16 from rest - "MUL R0.zw,R0,K0.z;\n" // *256 - "FLR R0.z,R0;\n" //bits 15..8 - - "MOV R0.w,R0.x;\n" //duplicate bit 31..24 - - "MUL R0,R0,K0.y;\n" // /255 - - "MUL R0.w,R0,K1.x;\n" // *15 - "FLR R0.w,R0;\n" //bits 31..28 - "MUL R0.w,R0,K1.y;\n" // /15 - - "DP4 R1.x, R0, program.env[%d];\n" - "DP4 R1.y, R0, program.env[%d];\n" - "DP4 R1.z, R0, program.env[%d];\n" - "DP4 R1.w, R0, program.env[%d];\n" - "ADD result.color, R1, program.env[%d];\n" - "END\n", C_COLORS, C_COLORS+1, C_COLORS+2, C_COLORS+3, C_COLORS+4); - glGenProgramsARB(1, &s_DepthMatrixProgram.glprogid); - SetCurrentShader(s_DepthMatrixProgram.glprogid); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, (GLsizei)strlen(pmatrixprog), pmatrixprog); - - err = GL_REPORT_ERROR(); - if (err != GL_NO_ERROR) { - ERROR_LOG(VIDEO, "Failed to create depth matrix fragment program"); - s_DepthMatrixProgram.Destroy(); - } - } - } void PixelShaderCache::Shutdown() @@ -318,7 +194,7 @@ FRAGMENTSHADER* PixelShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 comp // Make an entry in the table PSCacheEntry& newentry = PixelShaders[uid]; last_entry = &newentry; - const char *code = GeneratePixelShaderCode(dstAlphaMode, g_ActiveConfig.bUseGLSL ? API_GLSL : API_OPENGL, components); + const char *code = GeneratePixelShaderCode(dstAlphaMode, API_GLSL, components); if (g_ActiveConfig.bEnableShaderDebugging && code) { @@ -348,38 +224,6 @@ FRAGMENTSHADER* PixelShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 comp } bool PixelShaderCache::CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrprogram) -{ - return pCompilePixelShader(ps, pstrprogram); -} - -// Disable Fragment programs and reset the selected Program -void PixelShaderCache::DisableShader() -{ - if (ShaderEnabled) - { - glDisable(GL_FRAGMENT_PROGRAM_ARB); - ShaderEnabled = false; - } -} - -// bind a program if is different from the binded oone -void PixelShaderCache::SetCurrentShader(GLuint Shader) -{ - if (!ShaderEnabled) - { - glEnable(GL_FRAGMENT_PROGRAM_ARB); - ShaderEnabled = true; - } - if (CurrentShader != Shader) - { - if (Shader != 0) - CurrentShader = Shader; - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, CurrentShader); - } -} - -// GLSL Specific -bool CompileGLSLPixelShader(FRAGMENTSHADER& ps, const char* pstrprogram) { GLuint result = glCreateShader(GL_FRAGMENT_SHADER); @@ -415,7 +259,6 @@ bool CompileGLSLPixelShader(FRAGMENTSHADER& ps, const char* pstrprogram) (void)GL_REPORT_ERROR(); ps.glprogid = result; - ps.bGLSL = true; return true; } @@ -437,7 +280,8 @@ void SetPSConstant4fvByName(const char * name, unsigned int offset, const float } } -void SetGLSLPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4) +// Renderer functions +void Renderer::SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4) { float const f[4] = {f1, f2, f3, f4}; @@ -457,7 +301,7 @@ void SetGLSLPSConstant4f(unsigned int const_number, float f1, float f2, float f3 } } -void SetGLSLPSConstant4fv(unsigned int const_number, const float *f) +void Renderer::SetPSConstant4fv(unsigned int const_number, const float *f) { if (g_ActiveConfig.backend_info.bSupportsGLSLUBO) { @@ -475,7 +319,7 @@ void SetGLSLPSConstant4fv(unsigned int const_number, const float *f) } } -void SetMultiGLSLPSConstant4fv(unsigned int const_number, unsigned int count, const float *f) +void Renderer::SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f) { if (g_ActiveConfig.backend_info.bSupportsGLSLUBO) { @@ -492,120 +336,4 @@ void SetMultiGLSLPSConstant4fv(unsigned int const_number, unsigned int count, co } } } - -// CG Specific -bool CompileCGPixelShader(FRAGMENTSHADER& ps, const char* pstrprogram) -{ - GLenum err = GL_REPORT_ERROR(); - if (err != GL_NO_ERROR) - { - ERROR_LOG(VIDEO, "glError %08x before PS!", err); - } - -#if defined HAVE_CG && HAVE_CG - CGprogram tempprog = cgCreateProgram(g_cgcontext, CG_SOURCE, pstrprogram, g_cgfProf, "main", NULL); - - // handle errors - if (!cgIsProgram(tempprog)) - { - cgDestroyProgram(tempprog); - - static int num_failures = 0; - char szTemp[MAX_PATH]; - sprintf(szTemp, "bad_ps_%04i.txt", num_failures++); - std::ofstream file(szTemp); - file << pstrprogram; - file.close(); - - PanicAlert("Failed to compile pixel shader %d!\nThis usually happens when trying to use Dolphin with an outdated GPU or integrated GPU like the Intel GMA series.\n\nIf you're sure this is Dolphin's error anyway, post the contents of %s along with this error message at the forums.\n\nDebug info (%d):\n%s", - num_failures - 1, szTemp, - g_cgfProf, - cgGetLastListing(g_cgcontext)); - - return false; - } - - // handle warnings - if (cgGetError() != CG_NO_ERROR) - { - WARN_LOG(VIDEO, "Warnings on compile ps %s:", cgGetLastListing(g_cgcontext)); - WARN_LOG(VIDEO, "%s", pstrprogram); - } - - // This looks evil - we modify the program through the const char * we got from cgGetProgramString! - // It SHOULD not have any nasty side effects though - but you never know... - char *pcompiledprog = (char*)cgGetProgramString(tempprog, CG_COMPILED_PROGRAM); - char *plocal = strstr(pcompiledprog, "program.local"); - while (plocal != NULL) - { - const char *penv = " program.env"; - memcpy(plocal, penv, 13); - plocal = strstr(plocal+13, "program.local"); - } - - glGenProgramsARB(1, &ps.glprogid); - ps.bGLSL = false; - PixelShaderCache::SetCurrentShader(ps.glprogid); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, (GLsizei)strlen(pcompiledprog), pcompiledprog); - - err = GL_REPORT_ERROR(); - if (err != GL_NO_ERROR) - { - GLint error_pos, native_limit; - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &error_pos); - glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native_limit); - // Error occur - if (error_pos != -1) { - const char *program_error = (const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB); - char line[256]; - strncpy(line, (const char *)pcompiledprog + error_pos, 255); - line[255] = 0; - ERROR_LOG(VIDEO, "Error at %i: %s", error_pos, program_error); - ERROR_LOG(VIDEO, "Line dump: \n%s", line); - } else if (native_limit != -1) { - ERROR_LOG(VIDEO, "Hit limit? %i", native_limit); - // TODO - } - ERROR_LOG(VIDEO, "%s", pstrprogram); - ERROR_LOG(VIDEO, "%s", pcompiledprog); - } - - cgDestroyProgram(tempprog); -#endif - - return true; -} - -void SetCGPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4) -{ - float f[4] = { f1, f2, f3, f4 }; - glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, const_number, f); -} - -void SetCGPSConstant4fv(unsigned int const_number, const float *f) -{ - glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, const_number, f); -} - -void SetMultiCGPSConstant4fv(unsigned int const_number, unsigned int count, const float *f) -{ - for (unsigned int i = 0; i < count; i++,f+=4) - glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, const_number + i, f); -} - -// Renderer functions -void Renderer::SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4) -{ - pSetPSConstant4f(const_number, f1, f2, f3, f4); -} - -void Renderer::SetPSConstant4fv(unsigned int const_number, const float *f) -{ - pSetPSConstant4fv(const_number, f); -} - -void Renderer::SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f) -{ - pSetMultiPSConstant4fv(const_number, count, f); -} } // namespace OGL diff --git a/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.h b/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.h index c9a6ca6791..4a42249497 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.h @@ -29,21 +29,17 @@ namespace OGL struct FRAGMENTSHADER { - FRAGMENTSHADER() : glprogid(0), bGLSL(0) { } + FRAGMENTSHADER() : glprogid(0) { } void Destroy() { if (glprogid) { - if (bGLSL) - glDeleteShader(glprogid); - else - glDeleteProgramsARB(1, &glprogid); + glDeleteShader(glprogid); glprogid = 0; } } GLuint glprogid; // opengl program id - bool bGLSL; std::string strprog; }; @@ -85,22 +81,7 @@ public: static GLuint GetColorMatrixProgram(); static GLuint GetDepthMatrixProgram(); - - static void SetCurrentShader(GLuint Shader); - - static void DisableShader(); }; -// GLSL Specific -void SetGLSLPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4); -void SetGLSLPSConstant4fv(unsigned int const_number, const float *f); -void SetMultiGLSLPSConstant4fv(unsigned int const_number, unsigned int count, const float *f); -bool CompileGLSLPixelShader(FRAGMENTSHADER& ps, const char* pstrprogram); - -//CG Specific -void SetCGPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4); -void SetCGPSConstant4fv(unsigned int const_number, const float *f); -void SetMultiCGPSConstant4fv(unsigned int const_number, unsigned int count, const float *f); -bool CompileCGPixelShader(FRAGMENTSHADER& ps, const char* pstrprogram); } // namespace OGL #endif // _PIXELSHADERCACHE_H_ diff --git a/Source/Plugins/Plugin_VideoOGL/Src/PostProcessing.cpp b/Source/Plugins/Plugin_VideoOGL/Src/PostProcessing.cpp index 7442e5d294..531af03aa2 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/PostProcessing.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/PostProcessing.cpp @@ -75,14 +75,14 @@ bool ApplyShader() } } + // TODO: Convert PP shaders to GLSL if (s_shader.glprogid != 0) { - PixelShaderCache::SetCurrentShader(s_shader.glprogid); + // SetBothShaders(s_shader, 0); return true; } else { - PixelShaderCache::DisableShader(); return false; } } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index b1a3c8c6dd..fe73c29314 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -94,11 +94,6 @@ typedef struct } ScrStrct; #endif -#if defined HAVE_CG && HAVE_CG -CGcontext g_cgcontext; -CGprofile g_cgvProf; -CGprofile g_cgfProf; -#endif int OSDInternalW, OSDInternalH; @@ -185,16 +180,6 @@ static const GLenum glLogicOpCodes[16] = { GL_SET }; -#if defined HAVE_CG && HAVE_CG -void HandleCgError(CGcontext ctx, CGerror err, void* appdata) -{ - DEBUG_LOG(VIDEO, "Cg error: %s", cgGetErrorString(err)); - const char* listing = cgGetLastListing(g_cgcontext); - if (listing != NULL) - DEBUG_LOG(VIDEO, " last listing: %s", listing); -} -#endif - int GetNumMSAASamples(int MSAAMode) { // required for MSAA @@ -255,12 +240,6 @@ Renderer::Renderer() InitFPSCounter(); -#if defined HAVE_CG && HAVE_CG - g_cgcontext = cgCreateContext(); - cgGetError(); - cgSetErrorHandler(HandleCgError, NULL); -#endif - // Look for required extensions. const char *ptoken = (const char*)glGetString(GL_EXTENSIONS); if (!ptoken) @@ -314,26 +293,23 @@ Renderer::Renderer() s_bHaveFramebufferBlit = strstr(ptoken, "GL_EXT_framebuffer_blit") != NULL; s_bHaveCoverageMSAA = strstr(ptoken, "GL_NV_framebuffer_multisample_coverage") != NULL; - if(g_ActiveConfig.bUseGLSL) - { - // TODO: Switch over to using glew once 1.6/1.7 becomes more mainstream, seems most people are stuck in 1.5 - if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_shading_language_420pack") != NULL) - g_Config.backend_info.bSupportsGLSLBinding = true; - if (glewIsSupported("GL_ARB_blend_func_extended")) - g_Config.backend_info.bSupportsGLSLBlend = true; - if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_uniform_buffer_object") != NULL) - g_Config.backend_info.bSupportsGLSLUBO = true; - if ((g_Config.backend_info.bSupportsGLSLBinding || g_Config.backend_info.bSupportsGLSLUBO) && strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_explicit_attrib_location") != NULL) - g_Config.backend_info.bSupportsGLSLATTRBind = true; - if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_get_program_binary") != NULL) - g_Config.backend_info.bSupportsGLSLCache = true; + + if (glewIsSupported("GL_ARB_shading_language_420pack")) + g_Config.backend_info.bSupportsGLSLBinding = true; + if (glewIsSupported("GL_ARB_blend_func_extended")) + g_Config.backend_info.bSupportsGLSLBlend = true; + if (glewIsSupported("GL_ARB_uniform_buffer_object")) + g_Config.backend_info.bSupportsGLSLUBO = true; + if ((g_Config.backend_info.bSupportsGLSLBinding || g_Config.backend_info.bSupportsGLSLUBO) && glewIsSupported("GL_ARB_explicit_attrib_location")) + g_Config.backend_info.bSupportsGLSLATTRBind = true; + if (glewIsSupported("GL_ARB_get_program_binary")) + g_Config.backend_info.bSupportsGLSLCache = true; UpdateActiveConfig(); - OSD::AddMessage(StringFromFormat("Using GLSL. Supports Binding: %s UBOs: %s Cache: %s", + OSD::AddMessage(StringFromFormat("Supports Binding: %s UBOs: %s Cache: %s", g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "True" : "False", g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "True" : "False", g_ActiveConfig.backend_info.bSupportsGLSLCache ? "True" : "False").c_str(), 5000); - } s_LastMultisampleMode = g_ActiveConfig.iMultisampleMode; s_MSAASamples = GetNumMSAASamples(s_LastMultisampleMode); @@ -411,74 +387,7 @@ Renderer::Renderer() bSuccess = false; s_pfont = new RasterFont(); - -#if defined HAVE_CG && HAVE_CG - // load the effect, find the best profiles (if any) - if (cgGLIsProfileSupported(CG_PROFILE_ARBVP1) != CG_TRUE) - { - ERROR_LOG(VIDEO, "arbvp1 not supported"); - return; // TODO: fail - } - - if (cgGLIsProfileSupported(CG_PROFILE_ARBFP1) != CG_TRUE) - { - ERROR_LOG(VIDEO, "arbfp1 not supported"); - return; // TODO: fail - } - - g_cgvProf = cgGLGetLatestProfile(CG_GL_VERTEX); - g_cgfProf = cgGLGetLatestProfile(CG_GL_FRAGMENT); - if (strstr((const char*)glGetString(GL_VENDOR), "Humper") == NULL) - { -#if CG_VERSION_NUM == 2100 - // A bug was introduced in Cg2.1's handling of very large profile option values - // so this will not work on ATI. ATI returns MAXINT = 2147483647 (0x7fffffff) - // which is correct in OpenGL but Cg fails to handle it properly. As a result - // -1 is used by Cg resulting (signedness incorrect) and compilation fails. - if (strstr((const char*)glGetString(GL_VENDOR), "ATI") == NULL) -#endif - { - cgGLSetOptimalOptions(g_cgvProf); - cgGLSetOptimalOptions(g_cgfProf); - } - } -#else - // If we don't have Nvidia CG, we HAVE to use GLSL - g_Config.bUseGLSL = true; - UpdateActiveConfig(); - INFO_LOG(VIDEO, "CG not found, switching to GLSL"); -#endif // HAVE_CG - - int nenvvertparams, nenvfragparams, naddrregisters[2]; - glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, - GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, - (GLint *)&nenvvertparams); - glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, - GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, - (GLint *)&nenvfragparams); - glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, - GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB, - (GLint *)&naddrregisters[0]); - glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, - GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB, - (GLint *)&naddrregisters[1]); - DEBUG_LOG(VIDEO, "Max program env parameters: vert=%d, frag=%d", - nenvvertparams, nenvfragparams); - DEBUG_LOG(VIDEO, "Max program address register parameters: vert=%d, frag=%d", - naddrregisters[0], naddrregisters[1]); - - if (nenvvertparams < 238) - ERROR_LOG(VIDEO, "Not enough vertex shader environment constants!!"); - -#if defined HAVE_CG && HAVE_CG - INFO_LOG(VIDEO, "Max buffer sizes: %d %d", - cgGetProgramBufferMaxSize(g_cgvProf), - cgGetProgramBufferMaxSize(g_cgfProf)); -#ifndef _DEBUG - cgGLSetDebugMode(GL_FALSE); -#endif -#endif - + glStencilFunc(GL_ALWAYS, 0, 0); glBlendFunc(GL_ONE, GL_ONE); @@ -528,14 +437,6 @@ Renderer::~Renderer() delete s_pfont; s_pfont = 0; -#if defined HAVE_CG && HAVE_CG - if (g_cgcontext) - { - cgDestroyContext(g_cgcontext); - g_cgcontext = 0; - } -#endif - #if defined(HAVE_WX) && HAVE_WX if (scrshotThread.joinable()) scrshotThread.join(); @@ -962,7 +863,7 @@ void Renderer::SetBlendMode(bool forceUpdate) bool useDstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate && bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24; - bool useDualSource = useDstAlpha && g_ActiveConfig.bUseGLSL && g_ActiveConfig.backend_info.bSupportsGLSLBlend; + bool useDualSource = useDstAlpha && g_ActiveConfig.backend_info.bSupportsGLSLBlend; if (changes & 1) // blend enable change @@ -1139,7 +1040,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons // It takes care of disabling it in that case. It returns false in // case of no post processing. if (applyShader) - PixelShaderCache::DisableShader(); + ProgramShaderCache::SetBothShaders(0, 0); } } else @@ -1168,7 +1069,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons glMultiTexCoord2fARB(GL_TEXTURE1, 1, 0); glVertex2f( 1, -1); glEnd(); - PixelShaderCache::DisableShader(); + ProgramShaderCache::SetBothShaders(0, 0); } else { @@ -1432,13 +1333,8 @@ void Renderer::ResetAPIState() { // Gets us to a reasonably sane state where it's possible to do things like // image copies with textured quads, etc. - if (g_ActiveConfig.bUseGLSL) - ProgramShaderCache::SetBothShaders(0, 0); - else - { - VertexShaderCache::DisableShader(); - PixelShaderCache::DisableShader(); - } + ProgramShaderCache::SetBothShaders(0, 0); + glDisable(GL_SCISSOR_TEST); glDisable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); @@ -1460,13 +1356,7 @@ void Renderer::RestoreAPIState() glPolygonMode(GL_FRONT_AND_BACK, g_ActiveConfig.bWireFrame ? GL_LINE : GL_FILL); - if(g_ActiveConfig.bUseGLSL) - ProgramShaderCache::SetBothShaders(0, 0); - else - { - VertexShaderCache::SetCurrentShader(0); - PixelShaderCache::SetCurrentShader(0); - } + ProgramShaderCache::SetBothShaders(0, 0); } void Renderer::SetGenerationMode() diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp index 2f0e940aa2..157714f779 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp @@ -300,10 +300,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo glViewport(0, 0, virtual_width, virtual_height); - if (g_ActiveConfig.bUseGLSL) - ProgramShaderCache::SetBothShaders((srcFormat == PIXELFMT_Z24) ? PixelShaderCache::GetDepthMatrixProgram() : PixelShaderCache::GetColorMatrixProgram(), 0); - else - PixelShaderCache::SetCurrentShader((srcFormat == PIXELFMT_Z24) ? PixelShaderCache::GetDepthMatrixProgram() : PixelShaderCache::GetColorMatrixProgram()); + ProgramShaderCache::SetBothShaders((srcFormat == PIXELFMT_Z24) ? PixelShaderCache::GetDepthMatrixProgram() : PixelShaderCache::GetColorMatrixProgram(), 0); PixelShaderManager::SetColorMatrix(colmat); // set transformation GL_REPORT_ERRORD(); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp index 3bdb9f7f34..c8e54d1323 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp @@ -61,69 +61,45 @@ static FRAGMENTSHADER s_encodingPrograms[NUM_ENCODING_PROGRAMS]; void CreateRgbToYuyvProgram() { // Output is BGRA because that is slightly faster than RGBA. - if (g_ActiveConfig.bUseGLSL) + if (g_ActiveConfig.backend_info.bSupportsGLSLBinding) { - if (g_ActiveConfig.backend_info.bSupportsGLSLBinding) - { - const char *FProgram = - "#version 330 compatibility\n" - "#extension GL_ARB_texture_rectangle : enable\n" - "#extension GL_ARB_shading_language_420pack : enable\n" - "layout(binding = 0) uniform sampler2DRect samp0;\n" - "void main()\n" - "{\n" - " vec2 uv1 = vec2(gl_TexCoord[0].x + 1.0f, gl_TexCoord[0].y);\n" - " vec3 c0 = texture2DRect(samp0, gl_TexCoord[0].xy).rgb;\n" - " vec3 c1 = texture2DRect(samp0, uv1).rgb;\n" - " vec3 y_const = vec3(0.257f,0.504f,0.098f);\n" - " vec3 u_const = vec3(-0.148f,-0.291f,0.439f);\n" - " vec3 v_const = vec3(0.439f,-0.368f,-0.071f);\n" - " vec4 const3 = vec4(0.0625f,0.5f,0.0625f,0.5f);\n" - " vec3 c01 = (c0 + c1) * 0.5f;\n" - " gl_FragData[0] = vec4(dot(c1,y_const),dot(c01,u_const),dot(c0,y_const),dot(c01, v_const)) + const3;\n" - "}\n"; - if (!PixelShaderCache::CompilePixelShader(s_rgbToYuyvProgram, FProgram)) - ERROR_LOG(VIDEO, "Failed to create RGB to YUYV fragment program."); - } - else - { - const char *FProgram = - "#version 120\n" - "#extension GL_ARB_texture_rectangle : enable\n" - "uniform sampler2DRect samp0;\n" - "void main()\n" - "{\n" - " vec2 uv1 = vec2(gl_TexCoord[0].x + 1.0f, gl_TexCoord[0].y);\n" - " vec3 c0 = texture2DRect(samp0, gl_TexCoord[0].xy).rgb;\n" - " vec3 c1 = texture2DRect(samp0, uv1).rgb;\n" - " vec3 y_const = vec3(0.257f,0.504f,0.098f);\n" - " vec3 u_const = vec3(-0.148f,-0.291f,0.439f);\n" - " vec3 v_const = vec3(0.439f,-0.368f,-0.071f);\n" - " vec4 const3 = vec4(0.0625f,0.5f,0.0625f,0.5f);\n" - " vec3 c01 = (c0 + c1) * 0.5f;\n" - " gl_FragData[0] = vec4(dot(c1,y_const),dot(c01,u_const),dot(c0,y_const),dot(c01, v_const)) + const3;\n" - "}\n"; - if (!PixelShaderCache::CompilePixelShader(s_rgbToYuyvProgram, FProgram)) - ERROR_LOG(VIDEO, "Failed to create RGB to YUYV fragment program."); - } + const char *FProgram = + "#version 330 compatibility\n" + "#extension GL_ARB_texture_rectangle : enable\n" + "#extension GL_ARB_shading_language_420pack : enable\n" + "layout(binding = 0) uniform sampler2DRect samp0;\n" + "void main()\n" + "{\n" + " vec2 uv1 = vec2(gl_TexCoord[0].x + 1.0f, gl_TexCoord[0].y);\n" + " vec3 c0 = texture2DRect(samp0, gl_TexCoord[0].xy).rgb;\n" + " vec3 c1 = texture2DRect(samp0, uv1).rgb;\n" + " vec3 y_const = vec3(0.257f,0.504f,0.098f);\n" + " vec3 u_const = vec3(-0.148f,-0.291f,0.439f);\n" + " vec3 v_const = vec3(0.439f,-0.368f,-0.071f);\n" + " vec4 const3 = vec4(0.0625f,0.5f,0.0625f,0.5f);\n" + " vec3 c01 = (c0 + c1) * 0.5f;\n" + " gl_FragData[0] = vec4(dot(c1,y_const),dot(c01,u_const),dot(c0,y_const),dot(c01, v_const)) + const3;\n" + "}\n"; + if (!PixelShaderCache::CompilePixelShader(s_rgbToYuyvProgram, FProgram)) + ERROR_LOG(VIDEO, "Failed to create RGB to YUYV fragment program."); } else { const char *FProgram = - "uniform samplerRECT samp0 : register(s0);\n" - "void main(\n" - " out float4 ocol0 : COLOR0,\n" - " in float2 uv0 : TEXCOORD0)\n" + "#version 120\n" + "#extension GL_ARB_texture_rectangle : enable\n" + "uniform sampler2DRect samp0;\n" + "void main()\n" "{\n" - " float2 uv1 = float2(uv0.x + 1.0f, uv0.y);\n" - " float3 c0 = texRECT(samp0, uv0).rgb;\n" - " float3 c1 = texRECT(samp0, uv1).rgb;\n" - " float3 y_const = float3(0.257f,0.504f,0.098f);\n" - " float3 u_const = float3(-0.148f,-0.291f,0.439f);\n" - " float3 v_const = float3(0.439f,-0.368f,-0.071f);\n" - " float4 const3 = float4(0.0625f,0.5f,0.0625f,0.5f);\n" - " float3 c01 = (c0 + c1) * 0.5f;\n" - " ocol0 = float4(dot(c1,y_const),dot(c01,u_const),dot(c0,y_const),dot(c01, v_const)) + const3;\n" + " vec2 uv1 = vec2(gl_TexCoord[0].x + 1.0f, gl_TexCoord[0].y);\n" + " vec3 c0 = texture2DRect(samp0, gl_TexCoord[0].xy).rgb;\n" + " vec3 c1 = texture2DRect(samp0, uv1).rgb;\n" + " vec3 y_const = vec3(0.257f,0.504f,0.098f);\n" + " vec3 u_const = vec3(-0.148f,-0.291f,0.439f);\n" + " vec3 v_const = vec3(0.439f,-0.368f,-0.071f);\n" + " vec4 const3 = vec4(0.0625f,0.5f,0.0625f,0.5f);\n" + " vec3 c01 = (c0 + c1) * 0.5f;\n" + " gl_FragData[0] = vec4(dot(c1,y_const),dot(c01,u_const),dot(c0,y_const),dot(c01, v_const)) + const3;\n" "}\n"; if (!PixelShaderCache::CompilePixelShader(s_rgbToYuyvProgram, FProgram)) ERROR_LOG(VIDEO, "Failed to create RGB to YUYV fragment program."); @@ -132,82 +108,54 @@ void CreateRgbToYuyvProgram() void CreateYuyvToRgbProgram() { - if (g_ActiveConfig.bUseGLSL) + if (g_ActiveConfig.backend_info.bSupportsGLSLBinding) { - if (g_ActiveConfig.backend_info.bSupportsGLSLBinding) - { - const char *FProgram = - "#version 330 compatibility\n" - "#extension GL_ARB_texture_rectangle : enable\n" - "#extension GL_ARB_shading_language_420pack : enable\n" - "layout(binding = 0) uniform sampler2DRect samp0;\n" - "void main()\n" - "{\n" - " vec4 c0 = texture2DRect(samp0, gl_TexCoord[0].xy).rgba;\n" + const char *FProgram = + "#version 330 compatibility\n" + "#extension GL_ARB_texture_rectangle : enable\n" + "#extension GL_ARB_shading_language_420pack : enable\n" + "layout(binding = 0) uniform sampler2DRect samp0;\n" + "void main()\n" + "{\n" + " vec4 c0 = texture2DRect(samp0, gl_TexCoord[0].xy).rgba;\n" - " float f = step(0.5, fract(gl_TexCoord[0].x));\n" - " float y = mix(c0.b, c0.r, f);\n" - " float yComp = 1.164f * (y - 0.0625f);\n" - " float uComp = c0.g - 0.5f;\n" - " float vComp = c0.a - 0.5f;\n" + " float f = step(0.5, fract(gl_TexCoord[0].x));\n" + " float y = mix(c0.b, c0.r, f);\n" + " float yComp = 1.164f * (y - 0.0625f);\n" + " float uComp = c0.g - 0.5f;\n" + " float vComp = c0.a - 0.5f;\n" - " gl_FragData[0] = vec4(yComp + (1.596f * vComp),\n" - " yComp - (0.813f * vComp) - (0.391f * uComp),\n" - " yComp + (2.018f * uComp),\n" - " 1.0f);\n" - "}\n"; - if (!PixelShaderCache::CompilePixelShader(s_yuyvToRgbProgram, FProgram)) - ERROR_LOG(VIDEO, "Failed to create YUYV to RGB fragment program."); - } - else - { - const char *FProgram = - "#version 120\n" - "#ifdef GL_ARB_texture_rectangle\n" - "#extension GL_ARB_texture_rectangle : require\n" - "#endif\n" - "uniform sampler2DRect samp0;\n" - "void main()\n" - "{\n" - " vec4 c0 = texture2DRect(samp0, gl_TexCoord[0].xy).rgba;\n" - - " float f = step(0.5, fract(gl_TexCoord[0].x));\n" - " float y = mix(c0.b, c0.r, f);\n" - " float yComp = 1.164f * (y - 0.0625f);\n" - " float uComp = c0.g - 0.5f;\n" - " float vComp = c0.a - 0.5f;\n" - - " gl_FragData[0] = vec4(yComp + (1.596f * vComp),\n" - " yComp - (0.813f * vComp) - (0.391f * uComp),\n" - " yComp + (2.018f * uComp),\n" - " 1.0f);\n" - "}\n"; - if (!PixelShaderCache::CompilePixelShader(s_yuyvToRgbProgram, FProgram)) - ERROR_LOG(VIDEO, "Failed to create YUYV to RGB fragment program."); - } + " gl_FragData[0] = vec4(yComp + (1.596f * vComp),\n" + " yComp - (0.813f * vComp) - (0.391f * uComp),\n" + " yComp + (2.018f * uComp),\n" + " 1.0f);\n" + "}\n"; + if (!PixelShaderCache::CompilePixelShader(s_yuyvToRgbProgram, FProgram)) + ERROR_LOG(VIDEO, "Failed to create YUYV to RGB fragment program."); } else { const char *FProgram = - "uniform samplerRECT samp0 : register(s0);\n" - "void main(\n" - " out float4 ocol0 : COLOR0,\n" - " in float2 uv0 : TEXCOORD0)\n" - "{\n" - " float4 c0 = texRECT(samp0, uv0).rgba;\n" + "#version 120\n" + "#ifdef GL_ARB_texture_rectangle\n" + "#extension GL_ARB_texture_rectangle : require\n" + "#endif\n" + "uniform sampler2DRect samp0;\n" + "void main()\n" + "{\n" + " vec4 c0 = texture2DRect(samp0, gl_TexCoord[0].xy).rgba;\n" - " float f = step(0.5, frac(uv0.x));\n" - " float y = lerp(c0.b, c0.r, f);\n" - " float yComp = 1.164f * (y - 0.0625f);\n" - " float uComp = c0.g - 0.5f;\n" - " float vComp = c0.a - 0.5f;\n" - - " ocol0 = float4(yComp + (1.596f * vComp),\n" - " yComp - (0.813f * vComp) - (0.391f * uComp),\n" - " yComp + (2.018f * uComp),\n" - " 1.0f);\n" - "}\n"; + " float f = step(0.5, fract(gl_TexCoord[0].x));\n" + " float y = mix(c0.b, c0.r, f);\n" + " float yComp = 1.164f * (y - 0.0625f);\n" + " float uComp = c0.g - 0.5f;\n" + " float vComp = c0.a - 0.5f;\n" + " gl_FragData[0] = vec4(yComp + (1.596f * vComp),\n" + " yComp - (0.813f * vComp) - (0.391f * uComp),\n" + " yComp + (2.018f * uComp),\n" + " 1.0f);\n" + "}\n"; if (!PixelShaderCache::CompilePixelShader(s_yuyvToRgbProgram, FProgram)) ERROR_LOG(VIDEO, "Failed to create YUYV to RGB fragment program."); } @@ -223,7 +171,7 @@ FRAGMENTSHADER &GetOrCreateEncodingShader(u32 format) if (s_encodingPrograms[format].glprogid == 0) { - const char* shader = TextureConversionShader::GenerateEncodingShader(format, g_ActiveConfig.bUseGLSL ? API_GLSL : API_OPENGL); + const char* shader = TextureConversionShader::GenerateEncodingShader(format, API_GLSL); #if defined(_DEBUG) || defined(DEBUGFAST) if (g_ActiveConfig.iLog & CONF_SAVESHADERS && shader) @@ -390,10 +338,7 @@ int EncodeToRamFromTexture(u32 address,GLuint source_texture, bool bFromZBuffer, s32 expandedWidth = (width + blkW) & (~blkW); s32 expandedHeight = (height + blkH) & (~blkH); - if (g_ActiveConfig.bUseGLSL) - ProgramShaderCache::SetBothShaders(texconv_shader.glprogid, 0); - else - PixelShaderCache::SetCurrentShader(texconv_shader.glprogid); + ProgramShaderCache::SetBothShaders(texconv_shader.glprogid, 0); float sampleStride = bScaleByHalf ? 2.f : 1.f; TextureConversionShader::SetShaderParameters((float)expandedWidth, @@ -425,10 +370,7 @@ void EncodeToRamYUYV(GLuint srcTexture, const TargetRectangle& sourceRc, u8* des { g_renderer->ResetAPIState(); - if (g_ActiveConfig.bUseGLSL) - ProgramShaderCache::SetBothShaders(s_rgbToYuyvProgram.glprogid, 0); - else - PixelShaderCache::SetCurrentShader(s_rgbToYuyvProgram.glprogid); + ProgramShaderCache::SetBothShaders(s_rgbToYuyvProgram.glprogid, 0); EncodeToRamUsingShader(srcTexture, sourceRc, destAddr, dstWidth / 2, dstHeight, 0, false, false); FramebufferManager::SetFramebuffer(0); @@ -486,10 +428,7 @@ void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTextur } glViewport(0, 0, srcWidth, srcHeight); - if (g_ActiveConfig.bUseGLSL) - ProgramShaderCache::SetBothShaders(s_yuyvToRgbProgram.glprogid, 0); - else - PixelShaderCache::SetCurrentShader(s_yuyvToRgbProgram.glprogid); + ProgramShaderCache::SetBothShaders(s_yuyvToRgbProgram.glprogid, 0); GL_REPORT_ERRORD(); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp index 4c28a28c7c..034c3d593a 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp @@ -170,7 +170,7 @@ void VertexManager::vFlush() && bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24; // Makes sure we can actually do Dual source blending - bool dualSourcePossible = g_ActiveConfig.bUseGLSL && g_ActiveConfig.backend_info.bSupportsGLSLBlend; + bool dualSourcePossible = g_ActiveConfig.backend_info.bSupportsGLSLBlend; // finally bind FRAGMENTSHADER* ps; @@ -195,13 +195,7 @@ void VertexManager::vFlush() } VERTEXSHADER* vs = VertexShaderCache::SetShader(g_nativeVertexFmt->m_components); - if (g_ActiveConfig.bUseGLSL) - ProgramShaderCache::SetBothShaders(ps->glprogid, vs->glprogid); - else - { - if (ps) PixelShaderCache::SetCurrentShader(ps->glprogid); // Lego Star Wars crashes here. - if (vs) VertexShaderCache::SetCurrentShader(vs->glprogid); - } + ProgramShaderCache::SetBothShaders(ps->glprogid, vs->glprogid); // set global constants VertexShaderManager::SetConstants(); @@ -218,17 +212,12 @@ void VertexManager::vFlush() if (useDstAlpha && !dualSourcePossible) { ps = PixelShaderCache::SetShader(DSTALPHA_ALPHA_PASS,g_nativeVertexFmt->m_components); - if (g_ActiveConfig.bUseGLSL) - { - ProgramShaderCache::SetBothShaders(ps->glprogid, 0); - if (!g_ActiveConfig.backend_info.bSupportsGLSLUBO) - PixelShaderManager::SetConstants(); // Need to set these again, if we don't support UBO - if (g_nativeVertexFmt) - g_nativeVertexFmt->SetupVertexPointers(); - } - else - if (ps) PixelShaderCache::SetCurrentShader(ps->glprogid); - + ProgramShaderCache::SetBothShaders(ps->glprogid, 0); + if (!g_ActiveConfig.backend_info.bSupportsGLSLUBO) + PixelShaderManager::SetConstants(); // Need to set these again, if we don't support UBO + if (g_nativeVertexFmt) + g_nativeVertexFmt->SetupVertexPointers(); + // only update alpha glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp index 810cd4c54a..96fe0232ef 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp @@ -45,45 +45,11 @@ bool VertexShaderCache::ShaderEnabled; VertexShaderCache::VSCacheEntry* VertexShaderCache::last_entry = NULL; VERTEXSHADERUID VertexShaderCache::last_uid; -static int s_nMaxVertexInstructions; -void (*pSetVSConstant4f)(unsigned int, float, float, float, float); -void (*pSetVSConstant4fv)(unsigned int, const float*); -void (*pSetMultiVSConstant4fv)(unsigned int, unsigned int, const float*); -void (*pSetMultiVSConstant3fv)(unsigned int, unsigned int, const float*); -bool (*pCompileVertexShader)(VERTEXSHADER&, const char*); - void VertexShaderCache::Init() { ShaderEnabled = true; CurrentShader = 0; last_entry = NULL; - - if (g_ActiveConfig.bUseGLSL) - { - pSetVSConstant4f = SetGLSLVSConstant4f; - pSetVSConstant4fv = SetGLSLVSConstant4fv; - pSetMultiVSConstant4fv = SetMultiGLSLVSConstant4fv; - pSetMultiVSConstant3fv = SetMultiGLSLVSConstant3fv; - pCompileVertexShader = CompileGLSLVertexShader; - } - else - { - pSetVSConstant4f = SetCGVSConstant4f; - pSetVSConstant4fv = SetCGVSConstant4fv; - pSetMultiVSConstant4fv = SetMultiCGVSConstant4fv; - pSetMultiVSConstant3fv = SetMultiCGVSConstant3fv; - pCompileVertexShader = CompileCGVertexShader; - glEnable(GL_VERTEX_PROGRAM_ARB); - } - - glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, (GLint *)&s_nMaxVertexInstructions); - if (strstr((const char*)glGetString(GL_VENDOR), "Humper") != NULL) s_nMaxVertexInstructions = 4096; -#if CG_VERSION_NUM == 2100 - if (strstr((const char*)glGetString(GL_VENDOR), "ATI") != NULL) - { - s_nMaxVertexInstructions = 4096; - } -#endif } void VertexShaderCache::Shutdown() @@ -123,7 +89,7 @@ VERTEXSHADER* VertexShaderCache::SetShader(u32 components) // Make an entry in the table VSCacheEntry& entry = vshaders[uid]; last_entry = &entry; - const char *code = GenerateVertexShaderCode(components, g_ActiveConfig.bUseGLSL ? API_GLSL : API_OPENGL); + const char *code = GenerateVertexShaderCode(components, API_GLSL); GetSafeVertexShaderId(&entry.safe_uid, components); #if defined(_DEBUG) || defined(DEBUGFAST) @@ -148,36 +114,6 @@ VERTEXSHADER* VertexShaderCache::SetShader(u32 components) } bool VertexShaderCache::CompileVertexShader(VERTEXSHADER& vs, const char* pstrprogram) -{ - return pCompileVertexShader(vs, pstrprogram); -} - -void VertexShaderCache::DisableShader() -{ - if (ShaderEnabled) - { - glDisable(GL_VERTEX_PROGRAM_ARB); - ShaderEnabled = false; - } -} - -void VertexShaderCache::SetCurrentShader(GLuint Shader) -{ - if (!ShaderEnabled) - { - glEnable(GL_VERTEX_PROGRAM_ARB); - ShaderEnabled= true; - } - if (CurrentShader != Shader) - { - if (Shader != 0) - CurrentShader = Shader; - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, CurrentShader); - } -} - -// GLSL Specific -bool CompileGLSLVertexShader(VERTEXSHADER& vs, const char* pstrprogram) { GLuint result = glCreateShader(GL_VERTEX_SHADER); @@ -212,7 +148,6 @@ bool CompileGLSLVertexShader(VERTEXSHADER& vs, const char* pstrprogram) } (void)GL_REPORT_ERROR(); vs.glprogid = result; - vs.bGLSL = true; return true; } @@ -234,7 +169,7 @@ void SetVSConstant4fvByName(const char * name, unsigned int offset, const float } } -void SetGLSLVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4) +void Renderer::SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4) { float const buf[4] = {f1, f2, f3, f4}; @@ -254,7 +189,7 @@ void SetGLSLVSConstant4f(unsigned int const_number, float f1, float f2, float f3 } } -void SetGLSLVSConstant4fv(unsigned int const_number, const float *f) +void Renderer::SetVSConstant4fv(unsigned int const_number, const float *f) { if (g_ActiveConfig.backend_info.bSupportsGLSLUBO) { @@ -272,7 +207,7 @@ void SetGLSLVSConstant4fv(unsigned int const_number, const float *f) } } -void SetMultiGLSLVSConstant4fv(unsigned int const_number, unsigned int count, const float *f) +void Renderer::SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float *f) { if (g_ActiveConfig.backend_info.bSupportsGLSLUBO) { @@ -290,7 +225,7 @@ void SetMultiGLSLVSConstant4fv(unsigned int const_number, unsigned int count, co } } -void SetMultiGLSLVSConstant3fv(unsigned int const_number, unsigned int count, const float *f) +void Renderer::SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float *f) { float buf[4 * C_VENVCONST_END]; for (unsigned int i = 0; i < count; i++) @@ -316,141 +251,4 @@ void SetMultiGLSLVSConstant3fv(unsigned int const_number, unsigned int count, co } } -// CG Specific -bool CompileCGVertexShader(VERTEXSHADER& vs, const char* pstrprogram) -{ - // Reset GL error before compiling shaders. Yeah, we need to investigate the causes of these. - GLenum err = GL_REPORT_ERROR(); - if (err != GL_NO_ERROR) - { - ERROR_LOG(VIDEO, "glError %08x before VS!", err); - } - -#if defined HAVE_CG && HAVE_CG - CGprogram tempprog = cgCreateProgram(g_cgcontext, CG_SOURCE, pstrprogram, g_cgvProf, "main", NULL); - if (!cgIsProgram(tempprog)) { - static int num_failures = 0; - char szTemp[MAX_PATH]; - sprintf(szTemp, "bad_vs_%04i.txt", num_failures++); - std::ofstream file(szTemp); - file << pstrprogram; - file.close(); - - PanicAlert("Failed to compile vertex shader %d!\nThis usually happens when trying to use Dolphin with an outdated GPU or integrated GPU like the Intel GMA series.\n\nIf you're sure this is Dolphin's error anyway, post the contents of %s along with this error message at the forums.\n\nDebug info (%d):\n%s", - num_failures - 1, szTemp, - g_cgfProf, - cgGetLastListing(g_cgcontext)); - - cgDestroyProgram(tempprog); - ERROR_LOG(VIDEO, "Failed to load vs %s:", cgGetLastListing(g_cgcontext)); - ERROR_LOG(VIDEO, "%s", pstrprogram); - return false; - } - - if (cgGetError() != CG_NO_ERROR) - { - WARN_LOG(VIDEO, "Failed to load vs %s:", cgGetLastListing(g_cgcontext)); - WARN_LOG(VIDEO, "%s", pstrprogram); - } - - // This looks evil - we modify the program through the const char * we got from cgGetProgramString! - // It SHOULD not have any nasty side effects though - but you never know... - char *pcompiledprog = (char*)cgGetProgramString(tempprog, CG_COMPILED_PROGRAM); - char *plocal = strstr(pcompiledprog, "program.local"); - while (plocal != NULL) { - const char* penv = " program.env"; - memcpy(plocal, penv, 13); - plocal = strstr(plocal + 13, "program.local"); - } - glGenProgramsARB(1, &vs.glprogid); - vs.bGLSL = false; - VertexShaderCache::SetCurrentShader(vs.glprogid); - - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, (GLsizei)strlen(pcompiledprog), pcompiledprog); - err = GL_REPORT_ERROR(); - if (err != GL_NO_ERROR) { - ERROR_LOG(VIDEO, "%s", pstrprogram); - ERROR_LOG(VIDEO, "%s", pcompiledprog); - } - - cgDestroyProgram(tempprog); -#endif - - if (g_ActiveConfig.bEnableShaderDebugging) - vs.strprog = pstrprogram; - - return true; -} -void SetCGVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4) -{ - glProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, const_number, f1, f2, f3, f4); -} - -void SetCGVSConstant4fv(unsigned int const_number, const float *f) -{ - glProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, const_number, f); -} - -void SetMultiCGVSConstant4fv(unsigned int const_number, unsigned int count, const float *f) -{ - if (GLEW_EXT_gpu_program_parameters) - { - glProgramEnvParameters4fvEXT(GL_VERTEX_PROGRAM_ARB, const_number, count, f); - } - else - { - for (unsigned int i = 0; i < count; i++,f+=4) - glProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, const_number + i, f); - } -} - -void SetMultiCGVSConstant3fv(unsigned int const_number, unsigned int count, const float *f) -{ - if (GLEW_EXT_gpu_program_parameters) - { - float buf[4 * C_VENVCONST_END]; - for (unsigned int i = 0; i < count; i++) - { - buf[4*i ] = *f++; - buf[4*i+1] = *f++; - buf[4*i+2] = *f++; - buf[4*i+3] = 0.f; - } - glProgramEnvParameters4fvEXT(GL_VERTEX_PROGRAM_ARB, const_number, count, buf); - } - else - { - for (unsigned int i = 0; i < count; i++) - { - float buf[4]; - buf[0] = *f++; - buf[1] = *f++; - buf[2] = *f++; - buf[3] = 0.f; - glProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, const_number + i, buf); - } - } -} - -// Renderer Functions -void Renderer::SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4) -{ - pSetVSConstant4f(const_number, f1, f2, f3, f4); -} - -void Renderer::SetVSConstant4fv(unsigned int const_number, const float *f) -{ - pSetVSConstant4fv(const_number, f); -} - -void Renderer::SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float *f) -{ - pSetMultiVSConstant4fv(const_number, count, f); -} - -void Renderer::SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float *f) -{ - pSetMultiVSConstant3fv(const_number, count, f); -} - } // namespace OGL diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.h b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.h index 8922311613..9fd2a8ee9f 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.h @@ -29,18 +29,14 @@ namespace OGL struct VERTEXSHADER { - VERTEXSHADER() : glprogid(0), bGLSL(0) {} + VERTEXSHADER() : glprogid(0) {} void Destroy() { - if (bGLSL) - glDeleteShader(glprogid); - else - glDeleteProgramsARB(1, &glprogid); + glDeleteShader(glprogid); glprogid = 0; } GLuint glprogid; // opengl program id - bool bGLSL; std::string strprog; }; @@ -73,23 +69,7 @@ public: static VERTEXSHADER* SetShader(u32 components); static bool CompileVertexShader(VERTEXSHADER& ps, const char* pstrprogram); - static void SetCurrentShader(GLuint Shader); - static void DisableShader(); - }; -// GLSL Specific -void SetGLSLVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4); -void SetGLSLVSConstant4fv(unsigned int const_number, const float *f); -void SetMultiGLSLVSConstant4fv(unsigned int const_number, unsigned int count, const float *f); -void SetMultiGLSLVSConstant3fv(unsigned int const_number, unsigned int count, const float *f); -bool CompileGLSLVertexShader(VERTEXSHADER& vs, const char* pstrprogram); - -// CG Specific -void SetCGVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4); -void SetCGVSConstant4fv(unsigned int const_number, const float *f); -void SetMultiCGVSConstant4fv(unsigned int const_number, unsigned int count, const float *f); -void SetMultiCGVSConstant3fv(unsigned int const_number, unsigned int count, const float *f); -bool CompileCGVertexShader(VERTEXSHADER& vs, const char* pstrprogram); } // namespace OGL #endif // _VERTEXSHADERCACHE_H_