]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Disable occlusion query on Intel. Can be force-enabled. Hopefully temporary
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 6 Jun 2020 01:35:55 +0000 (01:35 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 6 Jun 2020 01:35:55 +0000 (01:35 +0000)
The previous occlusion query crash is still occurring on Intel
for reasons totally elusive to me. I'm tempted to think it's a driver
bug, but honestly I'm not sure.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12641 d7cf8633-e32d-0410-b094-e92efae38249

r_shadow.c

index 7426574a27095e829fcd212db93f909e6bacdfa7..20490fd6153f82e37a61b52947ce0b59bcc8478e 100644 (file)
@@ -600,6 +600,31 @@ static void r_shadow_newmap(void)
                R_Shadow_EditLights_Reload_f(&cmd_client);
 }
 
+/*
+ * (Cloudwalk) FIXME: If anyone wants to figure this shit out,
+ * go ahead. Clearing r_shadow_occlusion_buf is enough on AMD
+ * and NVIDIA. But Intel, even if I call glDeleteBuffers, insists
+ * on doing some stupid bullshit, causing a crash in the driver,
+ * when ever it calls glGetQueryObjectiv. In the interest of
+ * maintaining some semblance of stability, no occlusionquery
+ * for Intel.
+ */
+static void R_DisableCoronas_Intel_c(char *string)
+{
+       int value;
+       if(strstr(gl_vendor,"Intel"))
+       {
+               value = atoi(string);
+               if(value == 1)
+               {
+                       Con_Warnf("Occlusion query is not supported on Intel iGPUs at this time. Sorry!\n");
+                       string[0] = '0', string[1] = '\000';
+               }
+               else if (value != 0)
+                       Con_Warnf("Force-enabling occlusion query on Intel. Proceed at your own risk. It *will* crash after a vid_restart!\n");
+       }
+}
+
 void R_Shadow_Init(void)
 {
        Cvar_RegisterVariable(&r_shadow_bumpscale_basetexture);
@@ -697,6 +722,7 @@ void R_Shadow_Init(void)
        Cvar_RegisterVariable(&r_coronas);
        Cvar_RegisterVariable(&r_coronas_occlusionsizescale);
        Cvar_RegisterVariable(&r_coronas_occlusionquery);
+       Cvar_RegisterCallback(&r_coronas_occlusionquery,R_DisableCoronas_Intel_c);
        Cvar_RegisterVariable(&gl_flashblend);
        R_Shadow_EditLights_Init();
        Mem_ExpandableArray_NewArray(&r_shadow_worldlightsarray, r_main_mempool, sizeof(dlight_t), 128);