diff options
author | Kenneth Graunke <[email protected]> | 2017-10-26 15:19:25 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-10-29 20:52:20 -0700 |
commit | 86c68bb88618c5138a22bbbcfe6137d29f9f5f67 (patch) | |
tree | d26686251d0fc3bb27192fa74ec20ad413fb9314 /src/compiler/nir | |
parent | f970e4d481bb459822e8f3b6a9599e661c5ceb0d (diff) |
nir: Make nir_gather_info collect a uses_fddx_fddy flag.
i965 turns fddx/fddy into their coarse/fine variants based on the
ctx->Hint.FragmentShaderDerivative setting. It needs to know whether
this can impact a shader in order to better guess NOS settings.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/nir_gather_info.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index 7ae3ecc4425..13cdae39eca 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -281,10 +281,26 @@ gather_tex_info(nir_tex_instr *instr, nir_shader *shader) } static void +gather_alu_info(nir_alu_instr *instr, nir_shader *shader) +{ + switch (instr->op) { + case nir_op_fddx: + case nir_op_fddy: + shader->info.uses_fddx_fddy = true; + break; + default: + break; + } +} + +static void gather_info_block(nir_block *block, nir_shader *shader) { nir_foreach_instr(instr, block) { switch (instr->type) { + case nir_instr_type_alu: + gather_alu_info(nir_instr_as_alu(instr), shader); + break; case nir_instr_type_intrinsic: gather_intrinsic_info(nir_instr_as_intrinsic(instr), shader); break; |