Commit Graph

4 Commits

Author SHA1 Message Date
Germano Cavalcante bd6b7088bf Fix #112978: MacOS no longer has a path associated with the window
The problem was introduced in 636f3697ee

MacOS has a different way of handling the title.

In this OS the directory is searched and taken from the title string
which is then formatted.

This limits the title format and makes it prone to errors.

This commit makes the code more generic by splitting each component of
the title beforehand and allowing the associated directory to be informed
with `GHOST_SetTitle`.

Pull Request: https://projects.blender.org/blender/blender/pulls/113227
2023-10-05 02:26:11 +02:00
Jeroen Bakker bee3f645d8 Vulkan: Rewrite GHOST_ContextVK
This is a rewrite of GHOST_ContextVK to align with Metal backend as described
in #111389 - solution 3 with the adaptation that GHOST is still responsible
for presenting the swap chain image and a post callback is still needed in
case the swapchain is recreated.

This PR also includes some smaller improvements in stability.

Technical documentation: https://developer.blender.org/docs/eevee_and_viewport/gpu/vulkan/swap_chain/

* Renderpasses and framebuffers are not owned anymore by GHOST_ContextVK
* VKFramebuffer doesn't contain a swap chain image.
* Swapchain images can only be used as a blit destination or present source.
  Not as an attachment.
* GHOST_ContextVK::swapBuffers would call a callback with the image the
  GPU module needs to blit the results to.
* Clearing of depth/stencil attachments when no depth write state is set.
* Enable VK_KHR_maintenance4 to relax the stage interface mapping.
* Removes most vulkan validation warnings/errors.
* Detection of frame buffer changes that needs to be applied before
  performing a command requiring render pass (draw/clear attachment)

**Benefits**

* Late retrieval of a swap chain image results in better overall performance as
  Blender doesn't need to wait until the image is presented on the screen.
* Easier API and clearer state (transitions)
* More control over Image layouts and command buffer states. (Better alignment with
  Vulkan API)

Pull Request: https://projects.blender.org/blender/blender/pulls/111473
2023-08-29 15:05:08 +02:00
Campbell Barton a2c6371e3e License headers: use SPDX-FileCopyrightText in intern/ghost 2023-06-14 17:42:15 +10:00
Campbell Barton b626f1fd18 Cleanup: use ".cc" & ".hh" extensions for intern/ghost 2023-04-06 08:29:57 +10:00