radeonsi,driconf: add clamp_div_by_zero option
[mesa.git] / src / gallium / drivers / radeonsi / si_pipe.c
index be73204f13224c8ff58f5446a4f8a41dab5ec7cb..68e6623608b61215ed1cfc478954c2331b12a344 100644 (file)
@@ -907,7 +907,7 @@ static void si_disk_cache_create(struct si_screen *sscreen)
    disk_cache_format_hex_id(cache_id, sha1, 20 * 2);
 
 /* These flags affect shader compilation. */
-#define ALL_FLAGS (DBG(GISEL) | DBG(KILL_PS_INF_INTERP))
+#define ALL_FLAGS (DBG(GISEL) | DBG(KILL_PS_INF_INTERP) | DBG(CLAMP_DIV_BY_ZERO))
    uint64_t shader_debug_flags = sscreen->debug_flags & ALL_FLAGS;
 
    /* Add the high bits of 32-bit addresses, which affects
@@ -1030,9 +1030,10 @@ static struct pipe_screen *radeonsi_screen_create_impl(struct radeon_winsys *ws,
 #include "si_debug_options.h"
    }
 
-   if (sscreen->options.no_infinite_interp) {
+   if (sscreen->options.no_infinite_interp)
       sscreen->debug_flags |= DBG(KILL_PS_INF_INTERP);
-   }
+   if (sscreen->options.clamp_div_by_zero)
+      sscreen->debug_flags |= DBG(CLAMP_DIV_BY_ZERO);
 
    si_disk_cache_create(sscreen);