diff options
author | Eric Anholt <[email protected]> | 2015-02-02 16:13:49 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2015-02-18 14:47:50 -0800 |
commit | f90bb54734bf03be6c736812226e3f65f2e11519 (patch) | |
tree | 5ec1cc55001f020619f34184cf02811021346c1e /src/glsl/nir/nir.h | |
parent | 4a95be9772a255776309f23180519a4a8560f2dd (diff) |
nir: Add a nir_shader_compiler_options struct pointed to by the shaders.
This will be used to give the optimization passes a chance to customize
behavior for the particular target device.
v2: Rebase to master (no TGSI->NIR present)
Reviewed-by: Kenneth Graunke <[email protected]> (v1)
Diffstat (limited to 'src/glsl/nir/nir.h')
-rw-r--r-- | src/glsl/nir/nir.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index ceda977e641..d5253c42c19 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -1326,6 +1326,9 @@ typedef struct nir_function { exec_node_data(nir_function_overload, \ exec_list_get_head(&(func)->overload_list), node) +typedef struct nir_shader_compiler_options { +} nir_shader_compiler_options; + typedef struct nir_shader { /** hash table of name -> uniform nir_variable */ struct hash_table *uniforms; @@ -1336,6 +1339,13 @@ typedef struct nir_shader { /** hash table of name -> output nir_variable */ struct hash_table *outputs; + /** Set of driver-specific options for the shader. + * + * The memory for the options is expected to be kept in a single static + * copy by the driver. + */ + const struct nir_shader_compiler_options *options; + /** list of global variables in the shader */ struct exec_list globals; @@ -1361,12 +1371,13 @@ typedef struct nir_shader { unsigned num_inputs, num_uniforms, num_outputs; } nir_shader; -#define nir_foreach_overload(shader, overload) \ +#define nir_foreach_overload(shader, overload) \ foreach_list_typed(nir_function, func, node, &(shader)->functions) \ foreach_list_typed(nir_function_overload, overload, node, \ &(func)->overload_list) -nir_shader *nir_shader_create(void *mem_ctx); +nir_shader *nir_shader_create(void *mem_ctx, + const nir_shader_compiler_options *options); /** creates a register, including assigning it an index and adding it to the list */ nir_register *nir_global_reg_create(nir_shader *shader); |