enum ir3_shader_debug ir3_shader_debug = 0;
-struct ir3_compiler * ir3_compiler_create(struct fd_device *dev, uint32_t gpu_id)
+void
+ir3_compiler_destroy(struct ir3_compiler *compiler)
+{
+ ralloc_free(compiler);
+}
+
+struct ir3_compiler *
+ir3_compiler_create(struct fd_device *dev, uint32_t gpu_id)
{
struct ir3_compiler *compiler = rzalloc(NULL, struct ir3_compiler);
uint32_t const_upload_unit;
};
+void ir3_compiler_destroy(struct ir3_compiler *compiler);
struct ir3_compiler * ir3_compiler_create(struct fd_device *dev, uint32_t gpu_id);
int ir3_compile_shader_nir(struct ir3_compiler *compiler,
tu_bo_finish(device, &device->scratch_bos[i].bo);
}
- /* the compiler does not use pAllocator */
- ralloc_free(device->compiler);
+ ir3_compiler_destroy(device->compiler);
VkPipelineCache pc = tu_pipeline_cache_to_handle(device->mem_cache);
tu_DestroyPipelineCache(tu_device_to_handle(device), pc, NULL);
#include "ir3/ir3_nir.h"
+#include "ir3/ir3_compiler.h"
#include "a2xx/ir2.h"
static const struct debug_named_value debug_options[] = {
simple_mtx_destroy(&screen->lock);
- ralloc_free(screen->compiler);
+ if (screen->compiler)
+ ir3_compiler_destroy(screen->compiler);
+
ralloc_free(screen->live_batches);
free(screen->perfcntr_queries);