diff options
author | Jason Ekstrand <[email protected]> | 2015-08-05 17:14:59 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-10-02 14:22:53 -0700 |
commit | e4fea486da6ee2964ae15380bcdc8676dcc2a515 (patch) | |
tree | a8faca08ee04592105e464bbf922631c65fd72d1 /src/glsl/nir/nir.h | |
parent | cd1ae6ebfac22f76d26a5b8659423969b2aeddce (diff) |
nir: Add a a nir_shader_info struct
This commit also adds code to glsl_to_nir and prog_to_nir to fill it out.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.h')
-rw-r--r-- | src/glsl/nir/nir.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index bf5d41d43a9..0c06d675a4d 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -1454,6 +1454,37 @@ typedef struct nir_shader_compiler_options { bool native_integers; } nir_shader_compiler_options; +typedef struct nir_shader_info { + const char *name; + + /* Number of textures used by this shader */ + unsigned num_textures; + /* Number of uniform buffers used by this shader */ + unsigned num_ubos; + /* Number of atomic buffers used by this shader */ + unsigned num_abos; + /* Number of shader storage buffers used by this shader */ + unsigned num_ssbos; + /* Number of images used by this shader */ + unsigned num_images; + + /* Which inputs are actually read */ + uint64_t inputs_read; + /* Which outputs are actually written */ + uint64_t outputs_written; + /* Which system values are actually read */ + uint64_t system_values_read; + + /* Whether or not this shader ever uses textureGather() */ + bool uses_texture_gather; + + /* Whether or not this shader uses the gl_ClipDistance output */ + bool uses_clip_distance_out; + + /* Whether or not separate shader objects were used */ + bool separate_shader; +} nir_shader_info; + typedef struct nir_shader { /** list of uniforms (nir_variable) */ struct exec_list uniforms; @@ -1471,6 +1502,9 @@ typedef struct nir_shader { */ const struct nir_shader_compiler_options *options; + /** Various bits of compile-time information about a given shader */ + struct nir_shader_info info; + /** list of global variables in the shader (nir_variable) */ struct exec_list globals; |