ir3_shader_get_variant(struct ir3_shader *shader, struct ir3_shader_key *key,
bool binning_pass, bool *created)
{
+ mtx_lock(&shader->variants_lock);
struct ir3_shader_variant *v =
shader_variant(shader, key, created);
v->binning = create_variant(shader, key, true);
*created = true;
}
+ mtx_unlock(&shader->variants_lock);
return v->binning;
}
+ mtx_unlock(&shader->variants_lock);
return v;
}
}
free(shader->const_state.immediates);
ralloc_free(shader->nir);
+ mtx_destroy(&shader->variants_lock);
free(shader);
}
{
struct ir3_shader *shader = CALLOC_STRUCT(ir3_shader);
+ mtx_init(&shader->variants_lock, mtx_plain);
shader->compiler = compiler;
shader->id = ++shader->compiler->shader_count;
shader->type = nir->info.stage;
#include <stdio.h>
+#include "c11/threads.h"
#include "compiler/shader_enums.h"
#include "compiler/nir/nir.h"
#include "util/bitscan.h"
struct ir3_stream_output_info stream_output;
struct ir3_shader_variant *variants;
+ mtx_t variants_lock;
};
void * ir3_shader_assemble(struct ir3_shader_variant *v, uint32_t gpu_id);