vertex_id_zero_based differs..
Signed-off-by: Rob Clark <robdclark@gmail.com>
struct fd_screen *screen = fd_screen(pscreen);
if (is_ir3(screen))
- return ir3_get_compiler_options();
+ return ir3_get_compiler_options(screen->compiler);
return NULL;
}
}
}
+static struct ir3_compiler *compiler;
+
static nir_shader *
load_glsl(unsigned num_files, char* const* files, gl_shader_stage stage)
{
if (!prog)
errx(1, "couldn't parse `%s'", files[0]);
- nir_shader *nir = glsl_to_nir(prog, stage, ir3_get_compiler_options());
+ nir_shader *nir = glsl_to_nir(prog, stage, ir3_get_compiler_options(compiler));
standalone_compiler_cleanup(prog);
nir_shader *nir;
+ compiler = ir3_compiler_create(NULL, gpu_id);
+
if (s.from_tgsi) {
struct tgsi_token toks[65536];
return -1;
}
- s.compiler = ir3_compiler_create(NULL, gpu_id);
+ s.compiler = compiler;
s.nir = ir3_optimize_nir(&s, nir, NULL);
v.key = key;
.lower_extract_word = true,
};
+static const nir_shader_compiler_options options_5xx = {
+ .lower_fpow = true,
+ .lower_fsat = true,
+ .lower_scmp = true,
+ .lower_flrp32 = true,
+ .lower_flrp64 = true,
+ .lower_ffract = true,
+ .lower_fmod32 = true,
+ .lower_fmod64 = true,
+ .lower_fdiv = true,
+ .fuse_ffma = true,
+ .native_integers = true,
+ .vertex_id_zero_based = false,
+ .lower_extract_byte = true,
+ .lower_extract_word = true,
+};
+
struct nir_shader *
ir3_tgsi_to_nir(const struct tgsi_token *tokens)
{
}
const nir_shader_compiler_options *
-ir3_get_compiler_options(void)
+ir3_get_compiler_options(struct ir3_compiler *compiler)
{
+ if (compiler->gpu_id >= 500)
+ return &options_5xx;
return &options;
}
bool ir3_nir_apply_trig_workarounds(nir_shader *shader);
struct nir_shader * ir3_tgsi_to_nir(const struct tgsi_token *tokens);
-const nir_shader_compiler_options * ir3_get_compiler_options(void);
+const nir_shader_compiler_options * ir3_get_compiler_options(struct ir3_compiler *compiler);
bool ir3_key_lowers_nir(const struct ir3_shader_key *key);
struct nir_shader * ir3_optimize_nir(struct ir3_shader *shader, nir_shader *s,
const struct ir3_shader_key *key);