diff options
author | Jason Ekstrand <[email protected]> | 2019-02-21 17:20:39 -0600 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-07-10 19:35:55 +0000 |
commit | 14781e21227d036b8875bbdde9f343a8e73ceeb6 (patch) | |
tree | f7691a6244aa1cf546d8b6282aa080b1a31e75c4 /src/intel/compiler/brw_compiler.h | |
parent | 3a4667e502c458b6ac0ae3d4641612a9186a1924 (diff) |
intel/compiler: Add a "base class" for program keys
Right now, all keys have two things in common: a program string ID and a
sampler_prog_key_data. I'd like to add another thing or two and need a
place to put it. This commit adds a new brw_base_prog_key struct which
contains those two common bits.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_compiler.h')
-rw-r--r-- | src/intel/compiler/brw_compiler.h | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index 3c109c504b1..8f8cca79deb 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -203,6 +203,12 @@ struct brw_sampler_prog_key_data { float scale_factors[32]; }; +struct brw_base_prog_key { + unsigned program_string_id; + + struct brw_sampler_prog_key_data tex; +}; + /** * The VF can't natively handle certain types of attributes, such as GL_FIXED * or most 10_10_10_2 types. These flags enable various VS workarounds to @@ -225,7 +231,7 @@ struct brw_sampler_prog_key_data { /** The program key for Vertex Shaders. */ struct brw_vs_prog_key { - unsigned program_string_id; + struct brw_base_prog_key base; /** * Per-attribute workaround flags @@ -263,14 +269,12 @@ struct brw_vs_prog_key { * the VUE, even if they aren't written by the vertex shader. */ uint8_t point_coord_replace; - - struct brw_sampler_prog_key_data tex; }; /** The program key for Tessellation Control Shaders. */ struct brw_tcs_prog_key { - unsigned program_string_id; + struct brw_base_prog_key base; GLenum tes_primitive_mode; @@ -283,30 +287,24 @@ struct brw_tcs_prog_key uint64_t outputs_written; bool quads_workaround; - - struct brw_sampler_prog_key_data tex; }; /** The program key for Tessellation Evaluation Shaders. */ struct brw_tes_prog_key { - unsigned program_string_id; + struct brw_base_prog_key base; /** A bitfield of per-patch inputs read. */ uint32_t patch_inputs_read; /** A bitfield of per-vertex inputs read. */ uint64_t inputs_read; - - struct brw_sampler_prog_key_data tex; }; /** The program key for Geometry Shaders. */ struct brw_gs_prog_key { - unsigned program_string_id; - - struct brw_sampler_prog_key_data tex; + struct brw_base_prog_key base; }; enum brw_sf_primitive { @@ -394,6 +392,8 @@ enum brw_wm_aa_enable { /** The program key for Fragment/Pixel Shaders. */ struct brw_wm_prog_key { + struct brw_base_prog_key base; + /* Some collection of BRW_WM_IZ_* */ uint8_t iz_lookup; bool stats_wm:1; @@ -412,20 +412,17 @@ struct brw_wm_prog_key { uint8_t color_outputs_valid; uint64_t input_slots_valid; - unsigned program_string_id; GLenum alpha_test_func; /* < For Gen4/5 MRT alpha test */ float alpha_test_ref; - - struct brw_sampler_prog_key_data tex; }; struct brw_cs_prog_key { - uint32_t program_string_id; - struct brw_sampler_prog_key_data tex; + struct brw_base_prog_key base; }; /* brw_any_prog_key is any of the keys that map to an API stage */ union brw_any_prog_key { + struct brw_base_prog_key base; struct brw_vs_prog_key vs; struct brw_tcs_prog_key tcs; struct brw_tes_prog_key tes; @@ -1360,7 +1357,8 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data, void brw_debug_key_recompile(const struct brw_compiler *c, void *log, gl_shader_stage stage, - const void *old_key, const void *key); + const struct brw_base_prog_key *old_key, + const struct brw_base_prog_key *key); static inline uint32_t encode_slm_size(unsigned gen, uint32_t bytes) |