summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/prog_to_nir.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-10-13 15:20:38 +1100
committerTimothy Arceri <[email protected]>2016-10-26 14:29:36 +1100
commitdebed12fdde9766fd9cf99d679207a36a4599a82 (patch)
tree334d24b14f1ad541177bc601b9a31cf6f3cedda0 /src/mesa/program/prog_to_nir.c
parente1af20f18a86f52a9640faf2d4ff8a71b0a4fa9b (diff)
glsl: add a shader info field to the gl_program type
And use this field as the source for shader info in the nir_shader this will allow us to set some of these fields from GLSL directly. It will also simplify restoring from shader cache and allow the removal of duplicate fields from GLSL. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/program/prog_to_nir.c')
-rw-r--r--src/mesa/program/prog_to_nir.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c
index a65d4bf8182..2f589ce77f3 100644
--- a/src/mesa/program/prog_to_nir.c
+++ b/src/mesa/program/prog_to_nir.c
@@ -1019,6 +1019,12 @@ prog_to_nir(const struct gl_program *prog,
c->prog = prog;
nir_builder_init_simple_shader(&c->build, NULL, stage, options);
+
+ /* Use the shader_info from gl_program rather than the one nir_builder
+ * created for us. nir_sweep should clean up the other one for us.
+ */
+ c->build.shader->info = (shader_info *) &prog->info;
+
s = c->build.shader;
if (prog->Parameters->NumParameters > 0) {