nir: Add and set info::uses_64bit

Will be used to communicate that a shader uses 64-bit operations to the
concerned lowering passes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Matt Turner
2018-12-10 11:01:39 -08:00
parent 41f3e9e5f5
commit ecb115eb3f
2 changed files with 10 additions and 0 deletions

View File

@@ -307,6 +307,11 @@ gather_alu_info(nir_alu_instr *instr, nir_shader *shader)
shader->info.uses_fddx_fddy = true; shader->info.uses_fddx_fddy = true;
break; break;
default: default:
shader->info.uses_64bit |= instr->dest.dest.ssa.bit_size == 64;
unsigned num_srcs = nir_op_infos[instr->op].num_inputs;
for (unsigned i = 0; i < num_srcs; i++) {
shader->info.uses_64bit |= nir_src_bit_size(instr->src[i].src) == 64;
}
break; break;
} }
} }

View File

@@ -121,6 +121,11 @@ typedef struct shader_info {
*/ */
bool uses_fddx_fddy; bool uses_fddx_fddy;
/**
* True if this shader uses 64-bit ALU operations
*/
bool uses_64bit;
/* The size of the gl_ClipDistance[] array, if declared. */ /* The size of the gl_ClipDistance[] array, if declared. */
unsigned clip_distance_array_size; unsigned clip_distance_array_size;