diff options
author | Kristian H. Kristensen <[email protected]> | 2019-09-19 13:59:36 -0700 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-09-25 21:39:08 +0000 |
commit | 87d234d9680685a7fff5b4a79d53180468fb2ba6 (patch) | |
tree | f360f49dd19bb54c7a50102a92c60668bb66e5f1 /src | |
parent | d9c2ceddd2dd596433e58050a174bbb8da515531 (diff) |
freedreno/ir3: Add HS/DS/GS to shader key and cache
Signed-off-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_cache.c | 33 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_cache.h | 4 |
2 files changed, 31 insertions, 6 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cache.c b/src/gallium/drivers/freedreno/ir3/ir3_cache.c index e387291a92a..ba96628bd4a 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_cache.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_cache.c @@ -93,16 +93,41 @@ ir3_cache_lookup(struct ir3_cache *cache, const struct ir3_cache_key *key, return entry->data; } - struct ir3_shader_variant *bs = ir3_shader_variant(key->vs, key->key, true, debug); struct ir3_shader_variant *vs = ir3_shader_variant(key->vs, key->key, false, debug); - struct ir3_shader_variant *fs = ir3_shader_variant(key->fs, key->key, false, debug); + if (!vs) + return NULL; + + struct ir3_shader_variant *hs = NULL, *ds = NULL; + if (key->hs) { + debug_assert(key->ds); + hs = ir3_shader_variant(key->hs, key->key, false, debug); + ds = ir3_shader_variant(key->ds, key->key, false, debug); + if (!hs || ! ds) + return NULL; + } - if (!bs || !vs || !fs) { + /* For tessellation, the binning shader is derived from the DS. */ + struct ir3_shader_variant *bs; + if (key->ds) + bs = ir3_shader_variant(key->ds, key->key, true, debug); + else + bs = ir3_shader_variant(key->vs, key->key, true, debug); + if (!bs) return NULL; + + struct ir3_shader_variant *gs = NULL; + if (key->gs) { + gs = ir3_shader_variant(key->gs, key->key, false, debug); + if (!gs) + return NULL; } + struct ir3_shader_variant *fs = ir3_shader_variant(key->fs, key->key, false, debug); + if (!fs) + return NULL; + struct ir3_program_state *state = - cache->funcs->create_state(cache->data, bs, vs, NULL, NULL, NULL, fs, &key->key); + cache->funcs->create_state(cache->data, bs, vs, hs, ds, gs, fs, &key->key); state->key = *key; /* NOTE: uses copy of key in state obj, because pointer passed by caller diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cache.h b/src/gallium/drivers/freedreno/ir3/ir3_cache.h index 9343b535b57..d4332eeb38a 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_cache.h +++ b/src/gallium/drivers/freedreno/ir3/ir3_cache.h @@ -37,8 +37,8 @@ /* key into program state cache */ struct ir3_cache_key { - struct ir3_shader *vs, *fs; // 4 dwords - struct ir3_shader_key key; // 7 dwords + struct ir3_shader *vs, *hs, *ds, *gs, *fs; // 5 pointers + struct ir3_shader_key key; // 7 dwords }; /* per-gen backend program state object should subclass this for it's |