summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-06-22 23:13:20 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-13 13:27:42 +0200
commitf8d31a08ff08f3181bcebd85661e1f555c3a0515 (patch)
treebc297827d1319ef741c1128e74bc103f612c895e
parent7117ff053c33de9d35523039dad9a08c33002075 (diff)
glsl/linker: add finalize_linked_nir_shader
For transferring shadow IR variables back to NIR in the future.
-rw-r--r--src/compiler/glsl/linker.cpp3
-rw-r--r--src/compiler/glsl/nir_linker.cpp10
-rw-r--r--src/compiler/glsl/nir_linker.h4
3 files changed, 17 insertions, 0 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index de634772ce..30996571c9 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -5091,6 +5091,9 @@ done:
if (prog->_LinkedShaders[i] == NULL)
continue;
+ if (spirv)
+ finalize_linked_nir_shader(prog, prog->_LinkedShaders[i]);
+
/* Do a final validation step to make sure that the IR wasn't
* invalidated by any modifications performed after intrastage linking.
*/
diff --git a/src/compiler/glsl/nir_linker.cpp b/src/compiler/glsl/nir_linker.cpp
index 27c3864a31..c64198a375 100644
--- a/src/compiler/glsl/nir_linker.cpp
+++ b/src/compiler/glsl/nir_linker.cpp
@@ -220,3 +220,13 @@ create_linked_nir_shader(void *mem_ctx,
return linked;
}
+
+/**
+ * After linking has completed, update the NIR shader with information from
+ * the shadow IR variables.
+ */
+void
+finalize_linked_nir_shader(struct gl_shader_program *prog,
+ struct gl_linked_shader *sh)
+{
+}
diff --git a/src/compiler/glsl/nir_linker.h b/src/compiler/glsl/nir_linker.h
index c96d0ddbf6..a20095b9c1 100644
--- a/src/compiler/glsl/nir_linker.h
+++ b/src/compiler/glsl/nir_linker.h
@@ -40,6 +40,10 @@ create_linked_nir_shader(void *mem_ctx,
struct gl_shader *shader);
void
+finalize_linked_nir_shader(struct gl_shader_program *prog,
+ struct gl_linked_shader *sh);
+
+void
find_nir_assignments(struct nir_shader *nir, unsigned num_variables,
struct find_variable * const *variables);