mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
freedreno/ir3: Add HS/DS/GS to shader key and cache
Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com>
This commit is contained in:
parent
d9c2ceddd2
commit
87d234d968
2 changed files with 32 additions and 7 deletions
|
|
@ -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 (!bs || !vs || !fs) {
|
||||
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;
|
||||
}
|
||||
|
||||
/* 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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue