diff options
author | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-08-21 11:08:48 -0700 |
---|---|---|
committer | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-09-10 14:36:46 -0700 |
commit | 664e4a610dc8c0f2adc50de645a07cf4e2b622fd (patch) | |
tree | 298d803526806d1f71e5109e11e443e8a2774e98 /src/compiler/glsl/serialize.cpp | |
parent | eea3aa25aa20599578a20fb3256fdb90882abb2b (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/compiler/glsl/serialize.cpp')
-rw-r--r-- | src/compiler/glsl/serialize.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/glsl/serialize.cpp b/src/compiler/glsl/serialize.cpp index 552300f7eaf..235188c5c59 100644 --- a/src/compiler/glsl/serialize.cpp +++ b/src/compiler/glsl/serialize.cpp @@ -1015,6 +1015,8 @@ write_shader_parameters(struct blob *metadata, blob_write_uint32(metadata, param->DataType); blob_write_bytes(metadata, param->StateIndexes, sizeof(param->StateIndexes)); + blob_write_uint32(metadata, param->UniformStorageIndex); + blob_write_uint32(metadata, param->MainUniformStorageIndex); i++; } @@ -1046,6 +1048,10 @@ read_shader_parameters(struct blob_reader *metadata, _mesa_add_parameter(params, type, name, size, data_type, NULL, state_indexes, padded); + gl_program_parameter *param = ¶ms->Parameters[i]; + param->UniformStorageIndex = blob_read_uint32(metadata); + param->MainUniformStorageIndex = blob_read_uint32(metadata); + i++; } |