summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2019-08-21 11:08:48 -0700
committerCaio Marcelo de Oliveira Filho <[email protected]>2019-09-10 14:36:46 -0700
commit664e4a610dc8c0f2adc50de645a07cf4e2b622fd (patch)
tree298d803526806d1f71e5109e11e443e8a2774e98 /src/mesa
parenteea3aa25aa20599578a20fb3256fdb90882abb2b (diff)
glsl/nir: Fill in the Parameters in NIR linker
The parameter lists were not being created nor filled since i965 doesn't use them. In Gallium they are used for uniform handling, so add a way to fill them. The gl_uniform_storage struct got two new fields that let us go - from a Parameter to the matching UniformStorage and, - from the variable to the *first* UniformStorage without relying on names -- since they are optional for ARB_gl_spirv. Later patches will make use of them. v2: Do not fill parameters for i965. (Timothy) Use uint32_t for the new attributes. (Marek) v3: Serialize the new fields. (Timothy) Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_link.cpp2
-rw-r--r--src/mesa/program/prog_parameter.h11
2 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index e4e0b5fe330..c726551513a 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -273,7 +273,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
return GL_FALSE;
}
- if (!gl_nir_link_uniforms(ctx, shProg))
+ if (!gl_nir_link_uniforms(ctx, shProg, /* fill_parameters */ false))
return GL_FALSE;
gl_nir_link_assign_atomic_counter_resources(ctx, shProg);
diff --git a/src/mesa/program/prog_parameter.h b/src/mesa/program/prog_parameter.h
index 94aeb5540b5..c91156f623c 100644
--- a/src/mesa/program/prog_parameter.h
+++ b/src/mesa/program/prog_parameter.h
@@ -112,6 +112,17 @@ struct gl_program_parameter
* A sequence of STATE_* tokens and integers to identify GL state.
*/
gl_state_index16 StateIndexes[STATE_LENGTH];
+
+ /**
+ * Index of this parameter's uniform storage.
+ */
+ uint32_t UniformStorageIndex;
+
+ /**
+ * Index of the first uniform storage that is associated with the same
+ * variable as this parameter.
+ */
+ uint32_t MainUniformStorageIndex;
};