nir: Add and set info::uses_64bit
authorMatt Turner <mattst88@gmail.com>
Mon, 10 Dec 2018 19:01:39 +0000 (11:01 -0800)
committerMatt Turner <mattst88@gmail.com>
Thu, 10 Jan 2019 00:42:40 +0000 (16:42 -0800)
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>
src/compiler/nir/nir_gather_info.c
src/compiler/shader_info.h

index 7eaa4c27c1f224b8d171de20048bcae0f3a8d689..18a74a135d927634f72796ce422652af7a8f4db2 100644 (file)
@@ -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;
    }
 }
index dc47cd7656d95809085b0a0ef7d863250dc9c858..87a2c805d378cbe9a1f5f4b79fabf31150f84936 100644 (file)
@@ -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;