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
/* 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