Merge remote-tracking branch 'mesa-public/master' into vulkan
[mesa.git] / src / glsl / nir / nir.h
index c05df101f29cbde0ef3fd95ee22bcab11450f86a..714edc1541c8f2ac78fddf0884fa69daedb38e58 100644 (file)
@@ -65,7 +65,6 @@ name(const in_type *parent)                              \
    return exec_node_data(out_type, parent, field);       \
 }
 
-struct nir_function_overload;
 struct nir_function;
 struct nir_shader;
 struct nir_instr;
@@ -826,7 +825,7 @@ typedef struct {
    nir_deref_var **params;
    nir_deref_var *return_deref;
 
-   struct nir_function_overload *callee;
+   struct nir_function *callee;
 } nir_call_instr;
 
 #define INTRINSIC(name, num_srcs, src_components, has_dest, dest_components, \
@@ -1400,8 +1399,8 @@ typedef enum {
 typedef struct {
    nir_cf_node cf_node;
 
-   /** pointer to the overload of which this is an implementation */
-   struct nir_function_overload *overload;
+   /** pointer to the function of which this is an implementation */
+   struct nir_function *function;
 
    struct exec_list body; /** < list of nir_cf_node */
 
@@ -1486,31 +1485,23 @@ typedef struct {
    const struct glsl_type *type;
 } nir_parameter;
 
-typedef struct nir_function_overload {
+typedef struct nir_function {
    struct exec_node node;
 
+   const char *name;
+   struct nir_shader *shader;
+
    unsigned num_params;
    nir_parameter *params;
    const struct glsl_type *return_type;
 
-   nir_function_impl *impl; /** < NULL if the overload is only declared yet */
-
-   /** pointer to the function of which this is an overload */
-   struct nir_function *function;
-} nir_function_overload;
-
-typedef struct nir_function {
-   struct exec_node node;
-
-   struct exec_list overload_list; /** < list of nir_function_overload */
-   const char *name;
-   struct nir_shader *shader;
+   /** The implementation of this function.
+    *
+    * If the function is only declared and not implemented, this is NULL.
+    */
+   nir_function_impl *impl;
 } nir_function;
 
-#define nir_function_first_overload(func) \
-   exec_node_data(nir_function_overload, \
-                  exec_list_get_head(&(func)->overload_list), node)
-
 typedef struct nir_shader_compiler_options {
    bool lower_ffma;
    bool lower_fdiv;
@@ -1672,10 +1663,8 @@ typedef struct nir_shader {
    gl_shader_stage stage;
 } nir_shader;
 
-#define nir_foreach_overload(shader, overload)                        \
-   foreach_list_typed(nir_function, func, node, &(shader)->functions) \
-      foreach_list_typed(nir_function_overload, overload, node, \
-                         &(func)->overload_list)
+#define nir_foreach_function(shader, func) \
+   foreach_list_typed(nir_function, func, node, &(shader)->functions)
 
 nir_shader *nir_shader_create(void *mem_ctx,
                               gl_shader_stage stage,
@@ -1711,11 +1700,8 @@ nir_variable *nir_local_variable_create(nir_function_impl *impl,
 /** creates a function and adds it to the shader's list of functions */
 nir_function *nir_function_create(nir_shader *shader, const char *name);
 
-/** creates a null function returning null */
-nir_function_overload *nir_function_overload_create(nir_function *func);
-
-nir_function_impl *nir_function_impl_create(nir_function_overload *func);
-/** creates a function_impl that isn't tied to any particular overload */
+nir_function_impl *nir_function_impl_create(nir_function *func);
+/** creates a function_impl that isn't tied to any particular function */
 nir_function_impl *nir_function_impl_create_bare(nir_shader *shader);
 
 nir_block *nir_block_create(nir_shader *shader);
@@ -1741,7 +1727,7 @@ nir_intrinsic_instr *nir_intrinsic_instr_create(nir_shader *shader,
                                                 nir_intrinsic_op op);
 
 nir_call_instr *nir_call_instr_create(nir_shader *shader,
-                                      nir_function_overload *callee);
+                                      nir_function *callee);
 
 nir_tex_instr *nir_tex_instr_create(nir_shader *shader, unsigned num_srcs);