|
|
|
|
@@ -3438,7 +3438,7 @@ Program::makeFromNIR(struct nv50_ir_prog_info *info,
|
|
|
|
|
} // namespace nv50_ir
|
|
|
|
|
|
|
|
|
|
static nir_shader_compiler_options
|
|
|
|
|
nvir_nir_shader_compiler_options(int chipset, uint8_t shader_type)
|
|
|
|
|
nvir_nir_shader_compiler_options(int chipset, uint8_t shader_type, bool prefer_nir)
|
|
|
|
|
{
|
|
|
|
|
nir_shader_compiler_options op = {};
|
|
|
|
|
op.lower_fdiv = (chipset >= NVISA_GV100_CHIPSET);
|
|
|
|
|
@@ -3560,48 +3560,93 @@ nvir_nir_shader_compiler_options(int chipset, uint8_t shader_type)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const nir_shader_compiler_options g80_nir_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_G80_CHIPSET, PIPE_SHADER_TYPES);
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_G80_CHIPSET, PIPE_SHADER_TYPES, true);
|
|
|
|
|
static const nir_shader_compiler_options g80_fs_nir_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_G80_CHIPSET, PIPE_SHADER_FRAGMENT);
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_G80_CHIPSET, PIPE_SHADER_FRAGMENT, true);
|
|
|
|
|
static const nir_shader_compiler_options gf100_nir_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GF100_CHIPSET, PIPE_SHADER_TYPES);
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GF100_CHIPSET, PIPE_SHADER_TYPES, true);
|
|
|
|
|
static const nir_shader_compiler_options gf100_fs_nir_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GF100_CHIPSET, PIPE_SHADER_FRAGMENT);
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GF100_CHIPSET, PIPE_SHADER_FRAGMENT, true);
|
|
|
|
|
static const nir_shader_compiler_options gm107_nir_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GM107_CHIPSET, PIPE_SHADER_TYPES);
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GM107_CHIPSET, PIPE_SHADER_TYPES, true);
|
|
|
|
|
static const nir_shader_compiler_options gm107_fs_nir_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GM107_CHIPSET, PIPE_SHADER_FRAGMENT);
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GM107_CHIPSET, PIPE_SHADER_FRAGMENT, true);
|
|
|
|
|
static const nir_shader_compiler_options gv100_nir_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GV100_CHIPSET, PIPE_SHADER_TYPES);
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GV100_CHIPSET, PIPE_SHADER_TYPES, true);
|
|
|
|
|
static const nir_shader_compiler_options gv100_fs_nir_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GV100_CHIPSET, PIPE_SHADER_FRAGMENT);
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GV100_CHIPSET, PIPE_SHADER_FRAGMENT, true);
|
|
|
|
|
|
|
|
|
|
static const nir_shader_compiler_options g80_tgsi_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_G80_CHIPSET, PIPE_SHADER_TYPES, false);
|
|
|
|
|
static const nir_shader_compiler_options g80_fs_tgsi_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_G80_CHIPSET, PIPE_SHADER_FRAGMENT, false);
|
|
|
|
|
static const nir_shader_compiler_options gf100_tgsi_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GF100_CHIPSET, PIPE_SHADER_TYPES, false);
|
|
|
|
|
static const nir_shader_compiler_options gf100_fs_tgsi_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GF100_CHIPSET, PIPE_SHADER_FRAGMENT, false);
|
|
|
|
|
static const nir_shader_compiler_options gm107_tgsi_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GM107_CHIPSET, PIPE_SHADER_TYPES, false);
|
|
|
|
|
static const nir_shader_compiler_options gm107_fs_tgsi_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GM107_CHIPSET, PIPE_SHADER_FRAGMENT, false);
|
|
|
|
|
static const nir_shader_compiler_options gv100_tgsi_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GV100_CHIPSET, PIPE_SHADER_TYPES, false);
|
|
|
|
|
static const nir_shader_compiler_options gv100_fs_tgsi_shader_compiler_options =
|
|
|
|
|
nvir_nir_shader_compiler_options(NVISA_GV100_CHIPSET, PIPE_SHADER_FRAGMENT, false);
|
|
|
|
|
|
|
|
|
|
const nir_shader_compiler_options *
|
|
|
|
|
nv50_ir_nir_shader_compiler_options(int chipset, uint8_t shader_type)
|
|
|
|
|
nv50_ir_nir_shader_compiler_options(int chipset, uint8_t shader_type, bool prefer_nir)
|
|
|
|
|
{
|
|
|
|
|
if (chipset >= NVISA_GV100_CHIPSET) {
|
|
|
|
|
if (shader_type == PIPE_SHADER_FRAGMENT)
|
|
|
|
|
return &gv100_fs_nir_shader_compiler_options;
|
|
|
|
|
else
|
|
|
|
|
return &gv100_nir_shader_compiler_options;
|
|
|
|
|
if (shader_type == PIPE_SHADER_FRAGMENT) {
|
|
|
|
|
if (prefer_nir)
|
|
|
|
|
return &gv100_fs_nir_shader_compiler_options;
|
|
|
|
|
else
|
|
|
|
|
return &gv100_fs_tgsi_shader_compiler_options;
|
|
|
|
|
} else {
|
|
|
|
|
if (prefer_nir)
|
|
|
|
|
return &gv100_nir_shader_compiler_options;
|
|
|
|
|
else
|
|
|
|
|
return &gv100_tgsi_shader_compiler_options;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (chipset >= NVISA_GM107_CHIPSET) {
|
|
|
|
|
if (shader_type == PIPE_SHADER_FRAGMENT)
|
|
|
|
|
return &gm107_fs_nir_shader_compiler_options;
|
|
|
|
|
else
|
|
|
|
|
return &gm107_nir_shader_compiler_options;
|
|
|
|
|
if (shader_type == PIPE_SHADER_FRAGMENT) {
|
|
|
|
|
if (prefer_nir)
|
|
|
|
|
return &gm107_fs_nir_shader_compiler_options;
|
|
|
|
|
else
|
|
|
|
|
return &gm107_fs_tgsi_shader_compiler_options;
|
|
|
|
|
} else {
|
|
|
|
|
if (prefer_nir)
|
|
|
|
|
return &gm107_nir_shader_compiler_options;
|
|
|
|
|
else
|
|
|
|
|
return &gm107_tgsi_shader_compiler_options;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (chipset >= NVISA_GF100_CHIPSET) {
|
|
|
|
|
if (shader_type == PIPE_SHADER_FRAGMENT)
|
|
|
|
|
return &gf100_fs_nir_shader_compiler_options;
|
|
|
|
|
else
|
|
|
|
|
return &gf100_nir_shader_compiler_options;
|
|
|
|
|
if (shader_type == PIPE_SHADER_FRAGMENT) {
|
|
|
|
|
if (prefer_nir)
|
|
|
|
|
return &gf100_fs_nir_shader_compiler_options;
|
|
|
|
|
else
|
|
|
|
|
return &gf100_fs_tgsi_shader_compiler_options;
|
|
|
|
|
} else {
|
|
|
|
|
if (prefer_nir)
|
|
|
|
|
return &gf100_nir_shader_compiler_options;
|
|
|
|
|
else
|
|
|
|
|
return &gf100_tgsi_shader_compiler_options;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (shader_type == PIPE_SHADER_FRAGMENT)
|
|
|
|
|
return &g80_fs_nir_shader_compiler_options;
|
|
|
|
|
else
|
|
|
|
|
return &g80_nir_shader_compiler_options;
|
|
|
|
|
if (shader_type == PIPE_SHADER_FRAGMENT) {
|
|
|
|
|
if (prefer_nir)
|
|
|
|
|
return &g80_fs_nir_shader_compiler_options;
|
|
|
|
|
else
|
|
|
|
|
return &g80_fs_tgsi_shader_compiler_options;
|
|
|
|
|
} else {
|
|
|
|
|
if (prefer_nir)
|
|
|
|
|
return &g80_nir_shader_compiler_options;
|
|
|
|
|
else
|
|
|
|
|
return &g80_tgsi_shader_compiler_options;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|