p_atomic_inc(&sscreen->b.num_shaders_created);
program->shader.selector = &sel;
+ program->shader.is_monolithic = true;
if (si_shader_create(sscreen, sctx->tm, &program->shader,
&sctx->b.debug)) {
* Vertex shaders are compiled on demand when a vertex fetch
* workaround must be applied.
*/
- if (!mainp ||
- shader->key.as_es != mainp->key.as_es ||
- shader->key.as_ls != mainp->key.as_ls ||
- (sel->type == PIPE_SHADER_VERTEX &&
- shader->key.mono.vs.fix_fetch) ||
- (sel->type == PIPE_SHADER_TESS_CTRL &&
- shader->key.mono.tcs.inputs_to_copy) ||
- sel->type == PIPE_SHADER_COMPUTE) {
+ if (shader->is_monolithic) {
/* Monolithic shader (compiled as a whole, has many variants,
* may take a long time to compile).
*/
struct r600_resource *bo;
struct r600_resource *scratch_bo;
struct si_shader_key key;
+ bool is_monolithic;
bool is_binary_shared;
bool is_gs_copy_shader;
bool wait,
bool is_debug_context)
{
+ static const struct si_shader_key zeroed;
struct si_shader_selector *sel = state->cso;
struct si_shader *current = state->current;
struct si_shader *iter, *shader = NULL;
}
shader->selector = sel;
shader->key = *key;
+ shader->is_monolithic =
+ !sel->main_shader_part ||
+ sel->main_shader_part->key.as_ls != key->as_ls ||
+ sel->main_shader_part->key.as_es != key->as_es ||
+ memcmp(&key->mono, &zeroed.mono, sizeof(key->mono)) != 0;
r = si_shader_create(sscreen, tm, shader, debug);
if (unlikely(r)) {