brw_process_intel_debug_variable();
- compiler->screen->compiler = brw_compiler_create(compiler, &device->info);
+ compiler->screen->compiler = device->instance->physicalDevice.compiler;
ctx = &compiler->brw->ctx;
_mesa_init_shader_object_functions(&ctx->Driver);
close(fd);
+ device->compiler = brw_compiler_create(NULL, device->info);
+ if (device->compiler == NULL) {
+ result = vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
+ goto fail;
+ }
+
return VK_SUCCESS;
fail:
return result;
}
+static void
+anv_physical_device_finish(struct anv_physical_device *device)
+{
+ ralloc_free(device->compiler);
+}
+
static void *default_alloc(
void* pUserData,
size_t size,
{
ANV_FROM_HANDLE(anv_instance, instance, _instance);
+ anv_physical_device_finish(&instance->physicalDevice);
anv_finish_wsi(instance);
VG(VALGRIND_DESTROY_MEMPOOL(instance));