aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-07-22 21:20:29 -0400
committerMarek Olšák <[email protected]>2019-07-23 15:08:37 -0400
commit264ab6ffcdab90fd0295a06a697a78beb39aedbd (patch)
treef1408f896f02f0003f24c68e1ad92103941b8925 /src/gallium
parent45556731b6e099709a09eb8e65e27d7f709831b2 (diff)
radeonsi/nir: set tgsi_shader_info::uses_fbfetch for KHR_blend_equation_adv.
This doesn't implement the color buffer load. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_nir.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index 0f964bda88f..db40c04eb66 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -52,10 +52,10 @@ static nir_variable* intrinsic_get_var(nir_intrinsic_instr *instr)
return nir_deref_instr_get_variable(nir_src_as_deref(instr->src[0]));
}
-static void gather_intrinsic_load_deref_info(const nir_shader *nir,
- const nir_intrinsic_instr *instr,
- nir_variable *var,
- struct tgsi_shader_info *info)
+static void gather_intrinsic_load_deref_input_info(const nir_shader *nir,
+ const nir_intrinsic_instr *instr,
+ nir_variable *var,
+ struct tgsi_shader_info *info)
{
assert(var && var->data.mode == nir_var_shader_in);
@@ -89,6 +89,22 @@ static void gather_intrinsic_load_deref_info(const nir_shader *nir,
}
}
+static void gather_intrinsic_load_deref_output_info(const nir_shader *nir,
+ const nir_intrinsic_instr *instr,
+ nir_variable *var,
+ struct tgsi_shader_info *info)
+{
+ assert(var && var->data.mode == nir_var_shader_out);
+
+ switch (nir->info.stage) {
+ case MESA_SHADER_FRAGMENT:
+ if (var->data.fb_fetch_output)
+ info->uses_fbfetch = true;
+ break;
+ default:;
+ }
+}
+
static void scan_instruction(const struct nir_shader *nir,
struct tgsi_shader_info *info,
nir_instr *instr)
@@ -257,7 +273,7 @@ static void scan_instruction(const struct nir_shader *nir,
glsl_get_base_type(glsl_without_array(var->type));
if (mode == nir_var_shader_in) {
- gather_intrinsic_load_deref_info(nir, intr, var, info);
+ gather_intrinsic_load_deref_input_info(nir, intr, var, info);
switch (var->data.interpolation) {
case INTERP_MODE_NONE:
@@ -283,6 +299,8 @@ static void scan_instruction(const struct nir_shader *nir,
info->uses_linear_center = true;
break;
}
+ } else if (mode == nir_var_shader_out) {
+ gather_intrinsic_load_deref_output_info(nir, intr, var, info);
}
break;
}