diff --git a/base/sources/backends/direct3d12_gpu.c b/base/sources/backends/direct3d12_gpu.c index d04993ac..baae53d5 100644 --- a/base/sources/backends/direct3d12_gpu.c +++ b/base/sources/backends/direct3d12_gpu.c @@ -157,31 +157,6 @@ void gpu_barrier(gpu_texture_t *render_target, gpu_texture_state_t state_after) render_target->state = state_after; } -void gpu_destroy() { - wait_for_fence(fence, fence_value, fence_event); - for (int i = 0; i < GPU_FRAMEBUFFER_COUNT; ++i) { - gpu_texture_destroy_internal(&framebuffers[i]); - } - if (framebuffer_depth.width > 0) { - gpu_texture_destroy_internal(&framebuffer_depth); - } - if (readback_buffer != NULL) { - readback_buffer->lpVtbl->Release(readback_buffer); - } - if (upload_buffer != NULL) { - upload_buffer->lpVtbl->Release(upload_buffer); - } - command_list->lpVtbl->Release(command_list); - command_allocator->lpVtbl->Release(command_allocator); - window_swapchain->lpVtbl->Release(window_swapchain); - queue->lpVtbl->Release(queue); - root_signature->lpVtbl->Release(root_signature); - gpu_srv_heap->lpVtbl->Release(gpu_srv_heap); - fence->lpVtbl->Release(fence); - CloseHandle(fence_event); - device->lpVtbl->Release(device); -} - static D3D12_CPU_DESCRIPTOR_HANDLE descriptor_handle(ID3D12DescriptorHeap *heap, D3D12_DESCRIPTOR_HEAP_TYPE type, int index) { D3D12_CPU_DESCRIPTOR_HANDLE h; heap->lpVtbl->GetCPUDescriptorHandleForHeapStart(heap, &h); diff --git a/base/sources/backends/linux_system.c b/base/sources/backends/linux_system.c index b5dae52c..98d35be4 100644 --- a/base/sources/backends/linux_system.c +++ b/base/sources/backends/linux_system.c @@ -1196,12 +1196,9 @@ void iron_init(iron_window_options_t *ops) { } void iron_internal_shutdown() { - gpu_destroy(); - #ifdef WITH_GAMEPAD iron_linux_closeHIDGamepads(); #endif - free(clipboardString); XCloseDisplay(x11_ctx.display); iron_internal_shutdown_callback(); diff --git a/base/sources/backends/metal_gpu.m b/base/sources/backends/metal_gpu.m index ab3364bf..7798b548 100644 --- a/base/sources/backends/metal_gpu.m +++ b/base/sources/backends/metal_gpu.m @@ -117,11 +117,6 @@ void gpu_render_target_init2(gpu_texture_t *target, int width, int height, gpu_t } } -void gpu_destroy(void) { - id readback = (__bridge_transfer id)readback_buffer; - readback = nil; -} - void gpu_resize_internal(int width, int height) { resized = true; } diff --git a/base/sources/backends/vulkan_gpu.c b/base/sources/backends/vulkan_gpu.c index d3106690..07770e56 100644 --- a/base/sources/backends/vulkan_gpu.c +++ b/base/sources/backends/vulkan_gpu.c @@ -1012,18 +1012,6 @@ void gpu_init_internal(int depth_buffer_bits, bool vsync) { vkCreateFence(device, &fence_info, NULL, &fence); } -void gpu_destroy() { - if (readback_buffer_size > 0) { - vkFreeMemory(device, readback_mem, NULL); - vkDestroyBuffer(device, readback_buffer, NULL); - } - vkFreeCommandBuffers(device, cmd_pool, 1, &command_buffer); - vkDestroyFence(device, fence, NULL); - VkSwapchainKHR swapchain = cleanup_swapchain(); - vkDestroySwapchainKHR(device, swapchain, NULL); - vkDestroySurfaceKHR(instance, surface, NULL); -} - void iron_vulkan_surface_destroyed() { surface_destroyed = true; } diff --git a/base/sources/backends/webgpu_gpu.c b/base/sources/backends/webgpu_gpu.c index b516c64c..8425db63 100644 --- a/base/sources/backends/webgpu_gpu.c +++ b/base/sources/backends/webgpu_gpu.c @@ -305,18 +305,6 @@ void gpu_init_internal(int depth_buffer_bits, bool vsync) { create_swapchain(); } -void gpu_destroy() { - if (readback_buffer_size > 0) { - wgpuBufferDestroy(readback_buffer); - wgpuBufferRelease(readback_buffer); - } - // wgpuSurfaceUnconfigure(surface); - // wgpuSurfaceRelease(surface); - // wgpuDeviceRelease(device); - // wgpuAdapterRelease(gpu); - // wgpuInstanceRelease(instance); -} - void gpu_begin_internal(gpu_clear_t flags, unsigned color, float depth) { int width = iron_window_width(); int height = iron_window_height(); diff --git a/base/sources/backends/windows_system.c b/base/sources/backends/windows_system.c index 5b2d5848..22b6d645 100644 --- a/base/sources/backends/windows_system.c +++ b/base/sources/backends/windows_system.c @@ -944,7 +944,6 @@ void iron_internal_shutdown() { iron_windows_hide_windows(); iron_internal_shutdown_callback(); iron_windows_destroy_windows(); - gpu_destroy(); iron_windows_restore_displays(); } diff --git a/base/sources/iron_gpu.h b/base/sources/iron_gpu.h index 8dee32f3..65a247a1 100644 --- a/base/sources/iron_gpu.h +++ b/base/sources/iron_gpu.h @@ -170,7 +170,6 @@ void gpu_barrier(gpu_texture_t *render_target, gpu_texture_state_t state_after); void gpu_create_framebuffers(int depth_buffer_bits); void gpu_init(int depth_buffer_bits, bool vsync); void gpu_init_internal(int depth_buffer_bits, bool vsync); -void gpu_destroy(void); void gpu_draw(void); void gpu_resize(int width, int height); void gpu_resize_internal(int width, int height);