Merge branch 'nir-spirv' into vulkan
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 5 Sep 2015 01:54:15 +0000 (18:54 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 5 Sep 2015 01:54:15 +0000 (18:54 -0700)
1  2 
src/glsl/nir/nir.h
src/glsl/nir/spirv_to_nir.c

diff --combined src/glsl/nir/nir.h
index a5abc0438674e8a51b3c1c033dcbe1348def4cd6,415dda7712dbea55aea5f8fdf56652ff1a7d8800..7b188fa8ed19354284792aca1cea1bb9ad16e059
@@@ -520,11 -520,7 +520,11 @@@ typedef struct nir_src 
     bool is_ssa;
  } nir_src;
  
 -#define NIR_SRC_INIT (nir_src) { { NULL } }
 +#ifdef __cplusplus
 +#  define NIR_SRC_INIT nir_src()
 +#else
 +#  define NIR_SRC_INIT (nir_src) { { NULL } }
 +#endif
  
  #define nir_foreach_use(reg_or_ssa_def, src) \
     list_for_each_entry(nir_src, src, &(reg_or_ssa_def)->uses, use_link)
@@@ -547,11 -543,7 +547,11 @@@ typedef struct 
     bool is_ssa;
  } nir_dest;
  
 -#define NIR_DEST_INIT (nir_dest) { { { NULL } } }
 +#ifdef __cplusplus
 +#  define NIR_DEST_INIT nir_dest()
 +#else
 +#  define NIR_DEST_INIT (nir_dest) { { { NULL } } }
 +#endif
  
  #define nir_foreach_def(reg, dest) \
     list_for_each_entry(nir_dest, dest, &(reg)->defs, reg.def_link)
@@@ -993,9 -985,6 +993,9 @@@ typedef struct 
     /* gather component selector */
     unsigned component : 2;
  
 +   /* The descriptor set containing this texture */
 +   unsigned sampler_set;
 +
     /** The sampler index
      *
      * If this texture instruction has a nir_tex_src_sampler_offset source,
@@@ -1444,6 -1433,7 +1444,7 @@@ typedef struct nir_function 
  
  typedef struct nir_shader_compiler_options {
     bool lower_ffma;
+    bool lower_fdiv;
     bool lower_flrp;
     bool lower_fpow;
     bool lower_fsat;
@@@ -1838,7 -1828,6 +1839,7 @@@ void nir_lower_phis_to_scalar(nir_shade
  
  void nir_lower_samplers(nir_shader *shader,
                          const struct gl_shader_program *shader_program);
 +void nir_lower_samplers_for_vk(nir_shader *shader);
  
  void nir_lower_system_values(nir_shader *shader);
  void nir_lower_tex_projector(nir_shader *shader);
index 27a864f59933cf16b61015ec9ddca3654141cbce,9495fba0652438d80c3103f5a4f3ad6e4e3c4be8..7b57ffe44f64d286c144a31872ae04e74f22f946
@@@ -365,6 -365,8 +365,8 @@@ struct_member_decoration_cb(struct vtn_
     case SpvDecorationOffset:
        ctx->type->offsets[member] = dec->literals[0];
        break;
+    case SpvDecorationColMajor:
+       break; /* Nothing to do here.  Column-major is the default. */
     default:
        unreachable("Unhandled member decoration");
     }
@@@ -644,10 -646,7 +646,10 @@@ vtn_get_builtin_location(SpvBuiltIn bui
        /* XXX figure this out */
        unreachable("unhandled builtin");
     case SpvBuiltInVertexId:
 -      *location = SYSTEM_VALUE_VERTEX_ID;
 +      /* Vulkan defines VertexID to be zero-based and reserves the new
 +       * builtin keyword VertexIndex to indicate the non-zero-based value.
 +       */
 +      *location = SYSTEM_VALUE_VERTEX_ID_ZERO_BASE;
        *mode = nir_var_system_value;
        break;
     case SpvBuiltInInstanceId: