From ecb115eb3f2eb876a294b66737c91e195e54532a Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 10 Dec 2018 11:01:39 -0800 Subject: [PATCH] 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 Reviewed-by: Jason Ekstrand --- src/compiler/nir/nir_gather_info.c | 5 +++++ src/compiler/shader_info.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index 7eaa4c27c1f..18a74a135d9 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -307,6 +307,11 @@ gather_alu_info(nir_alu_instr *instr, nir_shader *shader) shader->info.uses_fddx_fddy = true; break; 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; } } diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index dc47cd7656d..87a2c805d37 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -121,6 +121,11 @@ typedef struct shader_info { */ 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. */ unsigned clip_distance_array_size; -- 2.30.2