VirtualBox

Changeset 40480 in vbox for trunk


Ignore:
Timestamp:
Mar 15, 2012 2:18:14 PM (13 years ago)
Author:
vboxsync
Message:

wined3d: build log bugfix, max_uniforms tmp workaround for win8

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  
    24982498        glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, &gl_max);
    24992499        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
    25002521        TRACE_(d3d_caps)("Max ARB_VERTEX_SHADER float constants: %u.\n", gl_info->limits.glsl_vs_float_constants);
    25012522    }
     
    25042525        glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, &gl_max);
    25052526        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
    25062548        TRACE_(d3d_caps)("Max ARB_FRAGMENT_SHADER float constants: %u.\n", gl_info->limits.glsl_ps_float_constants);
    25072549        glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max);
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/glsl_shader.c

    r40125 r40480  
    192192/* Extract a line from the info log.
    193193 * Note that this modifies the source string. */
    194 static char *get_info_log_line(char **ptr)
     194static char *get_info_log_line(char **ptr, int *pcbStr)
    195195{
    196196    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    }
    198210    p = *ptr;
     211    if (!*p)
     212    {
     213        *pcbStr = 0;
     214        return NULL;
     215    }
     216
    199217    if (!(q = strstr(p, "\n")))
    200218    {
    201         if (!*p) return NULL;
     219        /* the string contains a single line! */
    202220        *ptr += strlen(p);
     221        *pcbStr = 0;
    203222        return p;
    204223    }
     224
    205225    *q = '\0';
     226    *pcbStr = cbStr - ((uintptr_t)q) - ((uintptr_t)p) - 1;
     227    Assert((*pcbStr) >= 0);
     228    Assert((*pcbStr) < cbStr);
    206229    *ptr = q + 1;
    207230
     
    244267    {
    245268        char *ptr, *line;
     269        int cbPtr;
    246270
    247271        /* Fglrx doesn't terminate the string properly, but it tells us the proper length.
     
    260284
    261285        ptr = infoLog;
     286        cbPtr = infologLength;
    262287        if (is_spam)
    263288        {
    264289            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));
    266291        }
    267292        else
    268293        {
    269294            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));
    271296        }
    272297        HeapFree(GetProcessHeap(), 0, infoLog);
     
    279304    GLint tmp, source_size;
    280305    char *source = NULL;
     306    int cbPtr;
    281307
    282308    GL_EXTCALL(glGetObjectParameterivARB(shader, GL_OBJECT_SHADER_SOURCE_LENGTH_ARB, &tmp));
     
    299325
    300326    ptr = source;
     327    cbPtr = source_size;
    301328    GL_EXTCALL(glGetShaderSourceARB(shader, source_size, NULL, source));
    302329#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));
    304331#else
    305332    WDLOG(("*****shader source***\n"));
     
    10331060                 * Writing gl_ClipVertex requires one uniform for each clipplane as well.
    10341061                 */
    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                }
    10381078#else
    10391079                max_constantsF = gl_info->limits.glsl_vs_float_constants - 3;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette