Fixed bug 4533 - Update ANGLE to load d3dcompiler_47.dll instead of d3dcompiler_46.dll
authorSam Lantinga
Sat, 08 Jun 2019 15:10:20 -0700
changeset 1279892061a78e730
parent 12797 a7ce9dc7a31f
child 12799 302904fa669a
Fixed bug 4533 - Update ANGLE to load d3dcompiler_47.dll instead of d3dcompiler_46.dll

msmshazan

Update ANGLE Libraries to support d3dcompiler_47.dll since chrome does not ship with d3dcompiler_46.dll and d3dcompiler_43.dll
src/video/SDL_egl.c
     1.1 --- a/src/video/SDL_egl.c	Mon Mar 04 12:16:43 2019 -0500
     1.2 +++ b/src/video/SDL_egl.c	Sat Jun 08 15:10:20 2019 -0700
     1.3 @@ -279,16 +279,30 @@
     1.4  
     1.5  #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
     1.6      d3dcompiler = SDL_GetHint(SDL_HINT_VIDEO_WIN_D3DCOMPILER);
     1.7 -    if (!d3dcompiler) {
     1.8 +    if (d3dcompiler) {
     1.9 +        if (SDL_strcasecmp(d3dcompiler, "none") != 0) {
    1.10 +            if (SDL_LoadObject(d3dcompiler) == NULL) {
    1.11 +                SDL_ClearError();
    1.12 +            }
    1.13 +        }
    1.14 +    } else {
    1.15          if (WIN_IsWindowsVistaOrGreater()) {
    1.16 -            d3dcompiler = "d3dcompiler_46.dll";
    1.17 +            /* Try the newer d3d compilers first */
    1.18 +            const char *d3dcompiler_list[] = {
    1.19 +                "d3dcompiler_47.dll", "d3dcompiler_46.dll",
    1.20 +            };
    1.21 +            int i;
    1.22 +
    1.23 +            for (i = 0; i < SDL_arraysize(d3dcompiler_list); ++i) {
    1.24 +                if (SDL_LoadObject(d3dcompiler_list[i]) != NULL) {
    1.25 +                    break;
    1.26 +                }
    1.27 +                SDL_ClearError();
    1.28 +            }
    1.29          } else {
    1.30 -            d3dcompiler = "d3dcompiler_43.dll";
    1.31 -        }
    1.32 -    }
    1.33 -    if (SDL_strcasecmp(d3dcompiler, "none") != 0) {
    1.34 -        if (SDL_LoadObject(d3dcompiler) == NULL) {
    1.35 -            SDL_ClearError();
    1.36 +            if (SDL_LoadObject("d3dcompiler_43.dll") == NULL) {
    1.37 +                SDL_ClearError();
    1.38 +            }
    1.39          }
    1.40      }
    1.41  #endif