summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/ir3/ir3_nir.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-03-28 10:28:29 -0400
committerRob Clark <[email protected]>2016-05-15 17:25:47 -0400
commit784086f3c1f50ca78fe62f925dfe66fb3aa5f22c (patch)
tree02e20d20517870c1cf5114f0c2c12a7fa261638a /src/gallium/drivers/freedreno/ir3/ir3_nir.c
parent8b24f7b440f80cc2cba272b3b479ddd14a07602b (diff)
freedreno/ir3: add support for NIR as preferred IR
For now under debug flag, since only suitable for debugging/testing. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/ir3_nir.c')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_nir.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
index d93765cdd32..eda8ce20472 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
@@ -35,25 +35,32 @@
#include "nir/tgsi_to_nir.h"
+static const nir_shader_compiler_options options = {
+ .lower_fpow = true,
+ .lower_fsat = true,
+ .lower_scmp = true,
+ .lower_flrp32 = true,
+ .lower_flrp64 = true,
+ .lower_ffract = true,
+ .fuse_ffma = true,
+ .native_integers = true,
+ .vertex_id_zero_based = true,
+ .lower_extract_byte = true,
+ .lower_extract_word = true,
+};
+
struct nir_shader *
ir3_tgsi_to_nir(const struct tgsi_token *tokens)
{
- static const nir_shader_compiler_options options = {
- .lower_fpow = true,
- .lower_fsat = true,
- .lower_scmp = true,
- .lower_flrp32 = true,
- .lower_flrp64 = true,
- .lower_ffract = true,
- .fuse_ffma = true,
- .native_integers = true,
- .vertex_id_zero_based = true,
- .lower_extract_byte = true,
- .lower_extract_word = true,
- };
return tgsi_to_nir(tokens, &options);
}
+const nir_shader_compiler_options *
+ir3_get_compiler_options(void)
+{
+ return &options;
+}
+
/* for given shader key, are any steps handled in nir? */
bool
ir3_key_lowers_nir(const struct ir3_shader_key *key)