VirtualBox

Changeset 76266 in vbox for trunk


Ignore:
Timestamp:
Dec 17, 2018 3:36:45 PM (6 years ago)
Author:
vboxsync
Message:

DevVGA-SVGA3d-ogl: a better check for shader version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp

    r76261 r76266  
    941941#endif
    942942    float v = pszShadingLanguageVersion ? atof(pszShadingLanguageVersion) : 0.0f;
    943     if (v >= 3.30f)
    944     {
    945         pState->caps.vertexShaderVersion   = SVGA3DVSVERSION_40;
    946         pState->caps.fragmentShaderVersion = SVGA3DPSVERSION_40;
    947     }
    948     else
    949     if (v >= 1.20f)
    950     {
    951         pState->caps.vertexShaderVersion   = SVGA3DVSVERSION_20;
    952         pState->caps.fragmentShaderVersion = SVGA3DPSVERSION_20;
    953     }
    954     else
    955943    if (   vmsvga3dCheckGLExtension(pState, 0.0f, " GL_NV_gpu_program4 ")
    956944        || strstr(pState->pszOtherExtensions, " GL_NV_gpu_program4 "))
     
    981969        pState->caps.vertexShaderVersion   = SVGA3DVSVERSION_11;
    982970        pState->caps.fragmentShaderVersion = SVGA3DPSVERSION_11;
     971    }
     972
     973    /* Now check the shading language version, in case it indicates a higher supported version. */
     974    if (v >= 3.30f)
     975    {
     976        pState->caps.vertexShaderVersion   = RT_MAX(pState->caps.vertexShaderVersion,   SVGA3DVSVERSION_40);
     977        pState->caps.fragmentShaderVersion = RT_MAX(pState->caps.fragmentShaderVersion, SVGA3DPSVERSION_40);
     978    }
     979    else
     980    if (v >= 1.20f)
     981    {
     982        pState->caps.vertexShaderVersion   = RT_MAX(pState->caps.vertexShaderVersion,   SVGA3DVSVERSION_20);
     983        pState->caps.fragmentShaderVersion = RT_MAX(pState->caps.fragmentShaderVersion, SVGA3DPSVERSION_20);
    983984    }
    984985
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