diff options
author | Jason Ekstrand <[email protected]> | 2018-06-28 19:16:19 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-07-02 12:09:42 -0700 |
commit | c90f221e0a1f89332189dd5ec79dccf6b251ecf5 (patch) | |
tree | b4c2356897c19e02834d0f47d0107492cab6643a /src/compiler/nir/nir.h | |
parent | e8e159e9df40ee76468e05be073d94ec78d4bf32 (diff) |
nir: Add a concept of constant data associated with a shader
This commit adds a concept to NIR of having a blob of constant data
associated with a shader. Instead of being a UBO or uniform that can be
manipulated by the client, this constant data considered part of the
shader and remains constant across all invocations of the given shader
until the end of time. To access this constant data from the shader, we
add a new load_constant intrinsic. The intention is that drivers will
eventually lower load_constant intrinsics to load_ubo, load_uniform, or
something similar. Constant data will be used by the optimization pass
in the next commit but this concept may also be useful for OpenCL.
v2 (Jason Ekstrand):
- Rename num_constants to constant_data_size (anholt)
Reviewed-by: Timothy Arceri <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r-- | src/compiler/nir/nir.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index e35bef612df..cc5f88d6f54 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2067,6 +2067,14 @@ typedef struct nir_shader { * access plus one */ unsigned num_inputs, num_uniforms, num_outputs, num_shared; + + /** Constant data associated with this shader. + * + * Constant data is loaded through load_constant intrinsics. See also + * nir_opt_large_constants. + */ + void *constant_data; + unsigned constant_data_size; } nir_shader; static inline nir_function_impl * |