- Timestamp:
- Mar 15, 2012 2:18:14 PM (13 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/directx.c
r40125 r40480 2498 2498 glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, &gl_max); 2499 2499 gl_info->limits.glsl_vs_float_constants = gl_max / 4; 2500 #ifdef VBOX_WITH_WDDM 2501 /* AFAICT the " / 4" here comes from that we're going to use the glsl_vs/ps_float_constants to create vec4 arrays, 2502 * thus each array element has 4 components, so the actual number of vec4 arrays is GL_MAX_VERTEX/FRAGMENT_UNIFORM_COMPONENTS_ARB / 4 2503 * win8 Aero won't properly work with this constant < 256 in any way, 2504 * while Intel drivers I've encountered this problem with supports vec4 arrays of size > GL_MAX_VERTEX/FRAGMENT_UNIFORM_COMPONENTS_ARB / 4 2505 * so use it here. 2506 * @todo: add logging 2507 * @todo: perhaps should be movet to quirks? 2508 * */ 2509 if (gl_info->limits.glsl_vs_float_constants < 256 && gl_max >= 256) 2510 { 2511 DWORD dwVersion = GetVersion(); 2512 DWORD dwMajor = (DWORD)(LOBYTE(LOWORD(dwVersion))); 2513 DWORD dwMinor = (DWORD)(HIBYTE(LOWORD(dwVersion))); 2514 /* tmp workaround Win8 Aero requirement for 256 */ 2515 if (dwMajor > 6 || dwMinor > 1) 2516 { 2517 gl_info->limits.glsl_vs_float_constants = 256; 2518 } 2519 } 2520 #endif 2500 2521 TRACE_(d3d_caps)("Max ARB_VERTEX_SHADER float constants: %u.\n", gl_info->limits.glsl_vs_float_constants); 2501 2522 } … … 2504 2525 glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, &gl_max); 2505 2526 gl_info->limits.glsl_ps_float_constants = gl_max / 4; 2527 #ifdef VBOX_WITH_WDDM 2528 /* AFAICT the " / 4" here comes from that we're going to use the glsl_vs/ps_float_constants to create vec4 arrays, 2529 * thus each array element has 4 components, so the actual number of vec4 arrays is GL_MAX_VERTEX/FRAGMENT_UNIFORM_COMPONENTS_ARB / 4 2530 * win8 Aero won't properly work with this constant < 256 in any way, 2531 * while Intel drivers I've encountered this problem with supports vec4 arrays of size > GL_MAX_VERTEX/FRAGMENT_UNIFORM_COMPONENTS_ARB / 4 2532 * so use it here. 2533 * @todo: add logging 2534 * @todo: perhaps should be movet to quirks? 2535 * */ 2536 if (gl_info->limits.glsl_ps_float_constants < 256 && gl_max >= 256) 2537 { 2538 DWORD dwVersion = GetVersion(); 2539 DWORD dwMajor = (DWORD)(LOBYTE(LOWORD(dwVersion))); 2540 DWORD dwMinor = (DWORD)(HIBYTE(LOWORD(dwVersion))); 2541 /* tmp workaround Win8 Aero requirement for 256 */ 2542 if (dwMajor > 6 || dwMinor > 1) 2543 { 2544 gl_info->limits.glsl_ps_float_constants = 256; 2545 } 2546 } 2547 #endif 2506 2548 TRACE_(d3d_caps)("Max ARB_FRAGMENT_SHADER float constants: %u.\n", gl_info->limits.glsl_ps_float_constants); 2507 2549 glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/glsl_shader.c
r40125 r40480 192 192 /* Extract a line from the info log. 193 193 * Note that this modifies the source string. */ 194 static char *get_info_log_line(char **ptr )194 static char *get_info_log_line(char **ptr, int *pcbStr) 195 195 { 196 196 char *p, *q; 197 197 const int cbStr = *pcbStr; 198 199 if (!cbStr) 200 { 201 /* zero-length string */ 202 return NULL; 203 } 204 205 if ((*ptr)[cbStr-1] != '\0') 206 { 207 ERR("string should be null-rerminated, forcing it!"); 208 (*ptr)[cbStr-1] = '\0'; 209 } 198 210 p = *ptr; 211 if (!*p) 212 { 213 *pcbStr = 0; 214 return NULL; 215 } 216 199 217 if (!(q = strstr(p, "\n"))) 200 218 { 201 if (!*p) return NULL;219 /* the string contains a single line! */ 202 220 *ptr += strlen(p); 221 *pcbStr = 0; 203 222 return p; 204 223 } 224 205 225 *q = '\0'; 226 *pcbStr = cbStr - ((uintptr_t)q) - ((uintptr_t)p) - 1; 227 Assert((*pcbStr) >= 0); 228 Assert((*pcbStr) < cbStr); 206 229 *ptr = q + 1; 207 230 … … 244 267 { 245 268 char *ptr, *line; 269 int cbPtr; 246 270 247 271 /* Fglrx doesn't terminate the string properly, but it tells us the proper length. … … 260 284 261 285 ptr = infoLog; 286 cbPtr = infologLength; 262 287 if (is_spam) 263 288 { 264 289 WDLOG(("Spam received from GLSL shader #%u:\n", obj)); 265 while ((line = get_info_log_line(&ptr ))) WDLOG((" %s\n", line));290 while ((line = get_info_log_line(&ptr, &cbPtr))) WDLOG((" %s\n", line)); 266 291 } 267 292 else 268 293 { 269 294 WDLOG(("Error received from GLSL shader #%u:\n", obj)); 270 while ((line = get_info_log_line(&ptr ))) WDLOG((" %s\n", line));295 while ((line = get_info_log_line(&ptr, &cbPtr))) WDLOG((" %s\n", line)); 271 296 } 272 297 HeapFree(GetProcessHeap(), 0, infoLog); … … 279 304 GLint tmp, source_size; 280 305 char *source = NULL; 306 int cbPtr; 281 307 282 308 GL_EXTCALL(glGetObjectParameterivARB(shader, GL_OBJECT_SHADER_SOURCE_LENGTH_ARB, &tmp)); … … 299 325 300 326 ptr = source; 327 cbPtr = source_size; 301 328 GL_EXTCALL(glGetShaderSourceARB(shader, source_size, NULL, source)); 302 329 #if 0 303 while ((line = get_info_log_line(&ptr ))) WDLOG((" %s\n", line));330 while ((line = get_info_log_line(&ptr, &cbPtr))) WDLOG((" %s\n", line)); 304 331 #else 305 332 WDLOG(("*****shader source***\n")); … … 1033 1060 * Writing gl_ClipVertex requires one uniform for each clipplane as well. 1034 1061 */ 1035 #ifdef DEBUG_misha 1036 /* tmp work-around to make Internet Explorer in win8 work with GPU supporting only with 256 shader uniform vars */ 1037 max_constantsF = gl_info->limits.glsl_vs_float_constants - 1; 1062 #ifdef VBOX_WITH_WDDM 1063 if (gl_info->limits.glsl_vs_float_constants == 256) 1064 { 1065 DWORD dwVersion = GetVersion(); 1066 DWORD dwMajor = (DWORD)(LOBYTE(LOWORD(dwVersion))); 1067 DWORD dwMinor = (DWORD)(HIBYTE(LOWORD(dwVersion))); 1068 /* tmp workaround Win8 Aero requirement for 256 */ 1069 if (dwMajor > 6 || dwMinor > 1) 1070 { 1071 /* tmp work-around to make Internet Explorer in win8 work with GPU supporting only with 256 shader uniform vars 1072 * @todo: make it more robust */ 1073 max_constantsF = gl_info->limits.glsl_vs_float_constants - 1; 1074 } 1075 else 1076 max_constantsF = gl_info->limits.glsl_vs_float_constants - 3; 1077 } 1038 1078 #else 1039 1079 max_constantsF = gl_info->limits.glsl_vs_float_constants - 3;
Note:
See TracChangeset
for help on using the changeset viewer.