diff options
author | Jason Ekstrand <[email protected]> | 2015-10-19 20:21:45 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-10-20 13:02:03 -0700 |
commit | 6fb4469588ba37ace4794b354c9fd30d18b5c9ff (patch) | |
tree | b955b34ac6473d334d3014fed456ada3dff9206d /src/vulkan/anv_device.c | |
parent | 9e3615cc7de8323075b907ae95c5e65c1c3e2fd7 (diff) |
anv: Move the brw_compiler from anv_compiler to physical_device
Diffstat (limited to 'src/vulkan/anv_device.c')
-rw-r--r-- | src/vulkan/anv_device.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vulkan/anv_device.c b/src/vulkan/anv_device.c index 75fbe691c5f..e0bb7f6e4bc 100644 --- a/src/vulkan/anv_device.c +++ b/src/vulkan/anv_device.c @@ -91,6 +91,12 @@ anv_physical_device_init(struct anv_physical_device *device, 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: @@ -98,6 +104,12 @@ 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, @@ -193,6 +205,7 @@ void anv_DestroyInstance( { ANV_FROM_HANDLE(anv_instance, instance, _instance); + anv_physical_device_finish(&instance->physicalDevice); anv_finish_wsi(instance); VG(VALGRIND_DESTROY_MEMPOOL(instance)); |