diff options
author | George Kyriazis <[email protected]> | 2017-02-10 10:24:32 -0600 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2017-02-23 16:36:13 -0600 |
commit | 669d8f626f64cee1bc74ef7869aac8585b6dcfe6 (patch) | |
tree | 981ce7c2e5a1b0c00c65745c71f60ef0f1d1a35d /src/gallium/drivers/swr/swr_shader.h | |
parent | 987d8037cabaafaeba2cb8b82cb7fa7290dc4464 (diff) |
swr: add fetch shader cache
For now, the cache key is all of FETCH_COMPILE_STATE.
Use new/delete for swr_vertex_element_state, since we have to call the
constructors/destructors of the struct elements.
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_shader.h')
-rw-r--r-- | src/gallium/drivers/swr/swr_shader.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/swr/swr_shader.h b/src/gallium/drivers/swr/swr_shader.h index 7e3399ccd87..266573f7eaf 100644 --- a/src/gallium/drivers/swr/swr_shader.h +++ b/src/gallium/drivers/swr/swr_shader.h @@ -42,6 +42,9 @@ void swr_generate_vs_key(struct swr_jit_vs_key &key, struct swr_context *ctx, swr_vertex_shader *swr_vs); +void swr_generate_fetch_key(struct swr_jit_fetch_key &key, + struct swr_vertex_element_state *velems); + struct swr_jit_sampler_key { unsigned nr_samplers; unsigned nr_sampler_views; @@ -60,6 +63,10 @@ struct swr_jit_vs_key : swr_jit_sampler_key { unsigned clip_plane_mask; // from rasterizer state & vs_info }; +struct swr_jit_fetch_key { + FETCH_COMPILE_STATE fsState; +}; + namespace std { template <> struct hash<swr_jit_fs_key> { @@ -75,7 +82,15 @@ template <> struct hash<swr_jit_vs_key> { return util_hash_crc32(&k, sizeof(k)); } }; + +template <> struct hash<swr_jit_fetch_key> { + std::size_t operator()(const swr_jit_fetch_key &k) const + { + return util_hash_crc32(&k, sizeof(k)); + } +}; }; bool operator==(const swr_jit_fs_key &lhs, const swr_jit_fs_key &rhs); bool operator==(const swr_jit_vs_key &lhs, const swr_jit_vs_key &rhs); +bool operator==(const swr_jit_fetch_key &lhs, const swr_jit_fetch_key &rhs); |