GPU: Add Intel HD Graphics 530 to the list of buggy intel gpus
[blender.git] / source / blender / gpu / intern / gpu_extensions.c
index 2237a6ea49c722133b8785dcb9800558221058a0..6a65a922d89e837be5788174a2927332588e1200 100644 (file)
@@ -95,6 +95,9 @@ static struct GPUGlobal {
         * GPU_DEPTH32F_STENCIL8. Then Blitting depth will work but blitting stencil will
         * still be broken. */
        bool depth_blitting_workaround;
+       /* Crappy driver don't know how to map framebuffer slot to output vars...
+        * We need to have no "holes" in the output buffer slots. */
+       bool unused_fb_slot_workaround;
 } GG = {1, 0};
 
 
@@ -211,6 +214,11 @@ bool GPU_depth_blitting_workaround(void)
        return GG.depth_blitting_workaround;
 }
 
+bool GPU_unused_fb_slot_workaround(void)
+{
+       return GG.unused_fb_slot_workaround;
+}
+
 void gpu_extensions_init(void)
 {
        /* during 2.8 development each platform has its own OpenGL minimum requirements
@@ -262,8 +270,26 @@ void gpu_extensions_init(void)
                GG.device = GPU_DEVICE_ATI;
                GG.driver = GPU_DRIVER_OFFICIAL;
 
+#ifdef _WIN32
+               if (strstr(version, "4.5.13399") ||
+                   strstr(version, "4.5.13417"))
+               {
+                       /* The renderers include:
+                        *   Mobility Radeon HD 5000;
+                        *   Radeon HD 7500M;
+                        *   Radeon HD 7570M;
+                        *   Radeon HD 7600M;
+                        * And many others... */
+
+                       GG.unused_fb_slot_workaround = true;
+               }
+#endif
+
 #if defined(__APPLE__)
-               if (strstr(renderer, "AMD Radeon Pro") || strstr(renderer, "AMD Radeon R9")) {
+               if (strstr(renderer, "AMD Radeon Pro") ||
+                   strstr(renderer, "AMD Radeon R9") ||
+                   strstr(renderer, "AMD Radeon RX"))
+               {
                        GG.depth_blitting_workaround = true;
                }
 #endif
@@ -279,6 +305,14 @@ void gpu_extensions_init(void)
        {
                GG.device = GPU_DEVICE_INTEL;
                GG.driver = GPU_DRIVER_OFFICIAL;
+
+               if (strstr(renderer, "UHD Graphics") ||
+                   /* Not UHD but affected by the same bugs. */
+                   strstr(renderer, "HD Graphics 530") ||
+                   strstr(renderer, "Kaby Lake GT2"))
+               {
+                       GG.device |= GPU_DEVICE_INTEL_UHD;
+               }
        }
        else if ((strstr(renderer, "Mesa DRI R")) ||
                 (strstr(renderer, "Radeon") && strstr(vendor, "X.Org")) ||
@@ -320,6 +354,18 @@ void gpu_extensions_init(void)
 
        gpu_detect_mip_render_workaround();
 
+       if (G.debug & G_DEBUG_GPU_FORCE_WORKAROUNDS) {
+               printf("\n");
+               printf("GPU: Bypassing workaround detection.\n");
+               printf("GPU: OpenGL indentification strings\n");
+               printf("GPU: vendor: %s\n", vendor);
+               printf("GPU: renderer: %s\n", renderer);
+               printf("GPU: version: %s\n\n", version);
+               GG.mip_render_workaround = true;
+               GG.depth_blitting_workaround = true;
+               GG.unused_fb_slot_workaround = true;
+       }
+
        /* df/dy calculation factors, those are dependent on driver */
        if ((strstr(vendor, "ATI") && strstr(version, "3.3.10750"))) {
                GG.dfdyfactors[0] = 1.0;