Index: ddraw/ShaderGen2D.cpp |
— | — | @@ -837,6 +837,9 @@ |
838 | 838 | OutputDebugStringA("2D blitter vertex shader:\n");
|
839 | 839 | OutputDebugStringA(vsrc->ptr);
|
840 | 840 | OutputDebugStringA("\nCompiling 2D blitter vertex shader:\n");
|
| 841 | + TRACE_STRING("2D blitter vertex shader:\n");
|
| 842 | + TRACE_STRING(vsrc->ptr);
|
| 843 | + TRACE_STRING("\nCompiling 2D blitter vertex shader:\n");
|
841 | 844 | #endif
|
842 | 845 | gen->genshaders2D[index].shader.vs = gen->ext->glCreateShader(GL_VERTEX_SHADER);
|
843 | 846 | GLint srclen = strlen(vsrc->ptr);
|
— | — | @@ -854,6 +857,8 @@ |
855 | 858 | gen->ext->glGetShaderInfoLog(gen->genshaders2D[index].shader.vs, loglen, &result, infolog);
|
856 | 859 | OutputDebugStringA("Compilation failed. Error messages:\n");
|
857 | 860 | OutputDebugStringA(infolog);
|
| 861 | + TRACE_STRING("Compilation failed. Error messages:\n");
|
| 862 | + TRACE_STRING(infolog);
|
858 | 863 | free(infolog);
|
859 | 864 | }
|
860 | 865 | #endif
|
— | — | @@ -926,6 +931,9 @@ |
927 | 932 | OutputDebugStringA("2D blitter fragment shader:\n");
|
928 | 933 | OutputDebugStringA(fsrc->ptr);
|
929 | 934 | OutputDebugStringA("\nCompiling 2D blitter fragment shader:\n");
|
| 935 | + TRACE_STRING("2D blitter fragment shader:\n");
|
| 936 | + TRACE_STRING(fsrc->ptr);
|
| 937 | + TRACE_STRING("\nCompiling 2D blitter fragment shader:\n");
|
930 | 938 | #endif
|
931 | 939 | gen->genshaders2D[index].shader.fs = gen->ext->glCreateShader(GL_FRAGMENT_SHADER);
|
932 | 940 | srclen = strlen(fsrc->ptr);
|
— | — | @@ -940,6 +948,8 @@ |
941 | 949 | gen->ext->glGetShaderInfoLog(gen->genshaders2D[index].shader.fs, loglen, &result, infolog);
|
942 | 950 | OutputDebugStringA("Compilation failed. Error messages:\n");
|
943 | 951 | OutputDebugStringA(infolog);
|
| 952 | + TRACE_STRING("Compilation failed. Error messages:\n");
|
| 953 | + TRACE_STRING(infolog);
|
944 | 954 | free(infolog);
|
945 | 955 | }
|
946 | 956 | #endif
|
— | — | @@ -956,6 +966,8 @@ |
957 | 967 | gen->ext->glGetProgramInfoLog(gen->genshaders2D[index].shader.prog, loglen, &result, infolog);
|
958 | 968 | OutputDebugStringA("Program link failed. Error messages:\n");
|
959 | 969 | OutputDebugStringA(infolog);
|
| 970 | + TRACE_STRING("Program link failed. Error messages:\n");
|
| 971 | + TRACE_STRING(infolog);
|
960 | 972 | free(infolog);
|
961 | 973 | }
|
962 | 974 | #endif
|
Index: ddraw/ShaderGen3D.cpp |
— | — | @@ -695,6 +695,9 @@ |
696 | 696 | OutputDebugStringA("Vertex shader:\n");
|
697 | 697 | OutputDebugStringA(vsrc->ptr);
|
698 | 698 | OutputDebugStringA("\nCompiling vertex shader:\n");
|
| 699 | + TRACE_STRING("Vertex shader:\n");
|
| 700 | + TRACE_STRING(vsrc->ptr);
|
| 701 | + TRACE_STRING("\nCompiling vertex shader:\n");
|
699 | 702 | #endif
|
700 | 703 | genshaders[index].shader.vs = ext->glCreateShader(GL_VERTEX_SHADER);
|
701 | 704 | const char *src = vsrc->ptr;
|
— | — | @@ -713,6 +716,8 @@ |
714 | 717 | ext->glGetShaderInfoLog(genshaders[index].shader.vs,loglen,&result,infolog);
|
715 | 718 | OutputDebugStringA("Compilation failed. Error messages:\n");
|
716 | 719 | OutputDebugStringA(infolog);
|
| 720 | + TRACE_STRING("Compilation failed. Error messages:\n");
|
| 721 | + TRACE_STRING(infolog);
|
717 | 722 | free(infolog);
|
718 | 723 | }
|
719 | 724 | #endif
|
— | — | @@ -1204,6 +1209,9 @@ |
1205 | 1210 | OutputDebugStringA("Fragment shader:\n");
|
1206 | 1211 | OutputDebugStringA(fsrc->ptr);
|
1207 | 1212 | OutputDebugStringA("\nCompiling fragment shader:\n");
|
| 1213 | + TRACE_STRING("Fragment shader:\n");
|
| 1214 | + TRACE_STRING(fsrc->ptr);
|
| 1215 | + TRACE_STRING("\nCompiling fragment shader:\n");
|
1208 | 1216 | #endif
|
1209 | 1217 | genshaders[index].shader.fs = ext->glCreateShader(GL_FRAGMENT_SHADER);
|
1210 | 1218 | src = fsrc->ptr;
|
— | — | @@ -1219,6 +1227,8 @@ |
1220 | 1228 | ext->glGetShaderInfoLog(genshaders[index].shader.fs,loglen,&result,infolog);
|
1221 | 1229 | OutputDebugStringA("Compilation failed. Error messages:\n");
|
1222 | 1230 | OutputDebugStringA(infolog);
|
| 1231 | + TRACE_STRING("Compilation failed. Error messages:\n");
|
| 1232 | + TRACE_STRING(infolog);
|
1223 | 1233 | free(infolog);
|
1224 | 1234 | }
|
1225 | 1235 | OutputDebugStringA("\nLinking program:\n");
|
— | — | @@ -1236,6 +1246,8 @@ |
1237 | 1247 | ext->glGetProgramInfoLog(genshaders[index].shader.prog,loglen,&result,infolog);
|
1238 | 1248 | OutputDebugStringA("Program link failed. Error messages:\n");
|
1239 | 1249 | OutputDebugStringA(infolog);
|
| 1250 | + TRACE_STRING("Program link failed. Error messages:\n");
|
| 1251 | + TRACE_STRING(infolog);
|
1240 | 1252 | free(infolog);
|
1241 | 1253 | }
|
1242 | 1254 | #endif
|
Index: ddraw/trace.c |
— | — | @@ -1135,6 +1135,25 @@ |
1136 | 1136 | LeaveCriticalSection(&trace_cs);
|
1137 | 1137 | }
|
1138 | 1138 |
|
| 1139 | +void trace_string(const char *str)
|
| 1140 | +{
|
| 1141 | + DWORD byteswritten;
|
| 1142 | + unsigned int i;
|
| 1143 | + if (trace_fail) return;
|
| 1144 | + if (!trace_ready) init_trace();
|
| 1145 | + EnterCriticalSection(&trace_cs);
|
| 1146 | + if (trace_end)
|
| 1147 | + {
|
| 1148 | + end_trace();
|
| 1149 | + LeaveCriticalSection(&trace_cs);
|
| 1150 | + return;
|
| 1151 | + }
|
| 1152 | + for (i = 0; i < trace_depth - 1; i++)
|
| 1153 | + WriteFile(outfile, " ", 4, &byteswritten, NULL);
|
| 1154 | + WriteFile(outfile, str, strlen(str), &byteswritten, NULL);
|
| 1155 | + LeaveCriticalSection(&trace_cs);
|
| 1156 | +}
|
| 1157 | +
|
1139 | 1158 | void trace_sysinfo()
|
1140 | 1159 | {
|
1141 | 1160 | DWORD byteswritten;
|
Index: ddraw/trace.h |
— | — | @@ -29,11 +29,13 @@ |
30 | 30 | #define TRACE_ENTER(paramcount,...) trace_enter(__FUNCTION__,paramcount,__VA_ARGS__)
|
31 | 31 | #define TRACE_EXIT(argtype,arg) trace_exit(__FUNCTION__,argtype,(void*)arg)
|
32 | 32 | #define TRACE_VAR(var,argtype,arg) trace_var(__FUNCTION__,var,argtype,(void*)arg)
|
| 33 | +#define TRACE_STRING(str) trace_string(str)
|
33 | 34 | #define TRACE_SYSINFO() trace_sysinfo() // Must be in thread used by OpenGL.
|
34 | 35 | void trace_enter(const char *function, int paramcount, ...);
|
35 | 36 | void trace_exit(const char *function, int argtype, void *arg);
|
36 | 37 | void *trace_ret(const char *function, int argtype, void *arg);
|
37 | 38 | void trace_var(const char *function, const char *var, int argtype, void *arg);
|
| 39 | +void trace_string(const char *str);
|
38 | 40 | void trace_sysinfo();
|
39 | 41 | #define TRACE_RET(type, argtype, arg) return (type)trace_ret(__FUNCTION__,argtype,(void*)arg);
|
40 | 42 | #else
|
— | — | @@ -41,6 +43,7 @@ |
42 | 44 | #define TRACE_EXIT(a,b)
|
43 | 45 | #define TRACE_VAR(a,b,c)
|
44 | 46 | #define TRACE_RET(type, argtype, arg) return arg;
|
| 47 | +#define TRACE_STRING(str)
|
45 | 48 | #define TRACE_SYSINFO()
|
46 | 49 | #endif
|
47 | 50 |
|