diff --git a/src/intel/compiler/brw/brw_compiler.c b/src/intel/compiler/brw/brw_compiler.c index a9c39659953..f655094f68f 100644 --- a/src/intel/compiler/brw/brw_compiler.c +++ b/src/intel/compiler/brw/brw_compiler.c @@ -271,6 +271,11 @@ brw_get_compiler_config_value(const struct brw_compiler *compiler) u_foreach_bit64(bit, mask) insert_u64_bit(&config, (intel_simd & (1ULL << bit)) != 0); + for (unsigned i = 0; i < MESA_VULKAN_SHADER_STAGES; i++) { + insert_u64_bit(&config, intel_use_jay(compiler->devinfo, i) != 0); + bits++; + } + mask = 3; bits += util_bitcount64(mask); diff --git a/src/intel/dev/intel_debug.c b/src/intel/dev/intel_debug.c index 49eae64343c..d98ea35ddc3 100644 --- a/src/intel/dev/intel_debug.c +++ b/src/intel/dev/intel_debug.c @@ -34,6 +34,7 @@ #include #include "dev/intel_debug.h" +#include "dev/intel_device_info.h" #include "util/macros.h" #include "util/u_debug.h" #include "util/u_math.h" @@ -302,6 +303,31 @@ process_intel_debug_variable_once(void) BITSET_CLEAR(intel_debug, DEBUG_NO32); } +static const struct debug_named_value use_jay_options[] = { + { "vs", BITFIELD_BIT(MESA_SHADER_VERTEX), "Use jay for vertex shaders" }, + { "fs", BITFIELD_BIT(MESA_SHADER_FRAGMENT), "Use jay for fragment shaders" }, + { "cs", BITFIELD_BIT(MESA_SHADER_COMPUTE), "Use jay for compute shaders" }, + DEBUG_NAMED_VALUE_END +}; + +DEBUG_GET_ONCE_FLAGS_OPTION(use_jay, "INTEL_JAY", use_jay_options, 0); +static int use_jay = 0; + +bool +intel_use_jay(const struct intel_device_info *devinfo, mesa_shader_stage stage) +{ + if (stage == MESA_SHADER_KERNEL) + stage = MESA_SHADER_COMPUTE; + + return devinfo->ver == 20 && (use_jay & BITFIELD_BIT(stage)); +} + +bool +intel_use_jay_any_stage(const struct intel_device_info *devinfo) +{ + return devinfo->ver == 20 && use_jay; +} + void process_intel_debug_variable(void) { @@ -309,4 +335,6 @@ process_intel_debug_variable(void) call_once(&process_intel_debug_variable_flag, process_intel_debug_variable_once); + + use_jay = debug_get_option_use_jay(); } diff --git a/src/intel/dev/intel_debug.h b/src/intel/dev/intel_debug.h index b10c931dcf6..345749fd5f6 100644 --- a/src/intel/dev/intel_debug.h +++ b/src/intel/dev/intel_debug.h @@ -195,6 +195,12 @@ extern uint32_t intel_shader_dump_filter; extern uint64_t intel_debug_flag_for_shader_stage(mesa_shader_stage stage); +struct intel_device_info; +struct nir_shader; + +extern bool intel_use_jay(const struct intel_device_info *devinfo, + mesa_shader_stage stage); +extern bool intel_use_jay_any_stage(const struct intel_device_info *devinfo); extern void process_intel_debug_variable(void); #ifdef __cplusplus diff --git a/src/intel/dev/intel_device_info.h b/src/intel/dev/intel_device_info.h index 486dfaa9fe4..00a01c414c1 100644 --- a/src/intel/dev/intel_device_info.h +++ b/src/intel/dev/intel_device_info.h @@ -31,6 +31,7 @@ #include "util/bitset.h" #include "util/macros.h" #include "compiler/shader_enums.h" +#include "intel_debug.h" #include "intel_kmd.h" #include "intel/dev/intel_wa.h"