summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/include/pipe/p_defines.h6
-rw-r--r--src/gallium/state_trackers/dri/dri_screen.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index b195af44399..2ccdf44bfe2 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -390,6 +390,12 @@ enum pipe_flush_flags
*/
#define PIPE_CONTEXT_PREFER_THREADED (1 << 3)
+/**
+ * Implicit and explicit derivatives after KILL behave as if KILL didn't
+ * happen.
+ */
+#define PIPE_SCREEN_ENABLE_CORRECT_TGSI_DERIVATIVES_AFTER_KILL (1 << 0)
+
/**
* Flags for pipe_context::memory_barrier.
diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
index 1b414b28d1a..aa215b09a2d 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -80,6 +80,7 @@ const __DRIconfigOptionsExtension gallium_config_options = {
DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION("false")
DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION("false")
DRI_CONF_FORCE_GLSL_ABS_SQRT("false")
+ DRI_CONF_GLSL_CORRECT_DERIVATIVES_AFTER_DISCARD("false")
DRI_CONF_SECTION_END
DRI_CONF_SECTION_MISCELLANEOUS
@@ -473,6 +474,10 @@ dri_init_options_get_screen_flags(struct dri_screen *screen,
driver_name);
dri_fill_st_options(screen);
+ if (driQueryOptionb(&screen->optionCache,
+ "glsl_correct_derivatives_after_discard"))
+ flags |= PIPE_SCREEN_ENABLE_CORRECT_TGSI_DERIVATIVES_AFTER_KILL;
+
return flags;
}