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:

committed by
Rob Clark

parent
d9c2ceddd2
commit
87d234d968
@@ -93,16 +93,41 @@ ir3_cache_lookup(struct ir3_cache *cache, const struct ir3_cache_key *key,
|
|||||||
return entry->data;
|
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 *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)
|
||||||
|
|
||||||
if (!bs || !vs || !fs) {
|
|
||||||
return NULL;
|
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 =
|
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;
|
state->key = *key;
|
||||||
|
|
||||||
/* NOTE: uses copy of key in state obj, because pointer passed by caller
|
/* NOTE: uses copy of key in state obj, because pointer passed by caller
|
||||||
|
@@ -37,8 +37,8 @@
|
|||||||
|
|
||||||
/* key into program state cache */
|
/* key into program state cache */
|
||||||
struct ir3_cache_key {
|
struct ir3_cache_key {
|
||||||
struct ir3_shader *vs, *fs; // 4 dwords
|
struct ir3_shader *vs, *hs, *ds, *gs, *fs; // 5 pointers
|
||||||
struct ir3_shader_key key; // 7 dwords
|
struct ir3_shader_key key; // 7 dwords
|
||||||
};
|
};
|
||||||
|
|
||||||
/* per-gen backend program state object should subclass this for it's
|
/* per-gen backend program state object should subclass this for it's
|
||||||
|
Reference in New Issue
Block a user