Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ll] First batch of device integration changes [36/..] #1391

Merged
merged 95 commits into from Jul 24, 2017

Conversation

@msiglreith
Copy link
Member

commented Jul 23, 2017

Merge the first batch of changes from ll into master. Not everything from #1321 is done atm but to avoid that the branch diverges even more from the current master.

This PR contains the most parts of the device integration. We follow the concepts introduced by the next-gen APIs (Vulkan/D3D12/Metal):

  • Unified window entry point: Obtain a Surface object from a window, which is a logic representation of a native window/display, and build a SwapChain to the associated Surface. Swapchains are the window interface for the GPU. Every swapchain has an internal backbuffer (list of images) which we can render to and present.

  • CommandQueue: Gpu devices offer multiple execution pipelines for graphics, compute and DMA transfer operations. Introducing General/Graphics/Compute/TransferQueues where we can submit now command buffers for execution.

  • Synchronization: Offering two synchronization primitives: Semaphore and Fence.
    Semaphore are suited for GPU-GPU synchronization, usually used for synchronizing with the presentation engine by waiting til a backbuffer image has been acquired and present it once the rendering has finished.
    Fences are for CPU-GPU synchronization and are used to ensure that resources can be safely reseted (e.g reset command pools, overwrite memory, ..)

  • CommandPool: Command buffers are now combined into pools which are Send but not Sync! So each thread should have it's designated command pool if we want to record commands on it. Once a command buffer has been recorded, a Submit object will be returned which can be send to the main thread for submission to a queue. Be sure to ensure via synchronization primitives that no command buffer is in use when reseting the pool!

  • Adapter: Initialization process gets a bit more explicit, similar to the swapchain creation. Adapters are logical representation of the available GPUs of the system. Users can decide which Adapter to open (= device creation) with a desired number of queues.

  • Backend: Combining the different new trait implementations into a backend trait (similar to the Resource trait). This should help users to write backend acgnostic code (Surface and SwapChain are window specific!)

msiglreith added some commits May 1, 2017

[ll] Add window extension to better handle GL
OpenGL requires a context for surface and adapter enumeration in contrast to vulkan.
Added a new window extension which combines the two entry points.
[ll] app: Cleanup backend features
* Hide GL behind a feature for better consistency and control
* Add dx11 feature to allow dx12 backend in the future
[ll] app: Prepare unification of application launch
* Add CommandPools to Backend
* Define queue compatibility and additional conversion traits
* Move duplicated application run code into separate function
[ll] Add swapchain configuration, remove mutex for vulkan queue and f…
…ix rebase conflicts

* Allow to specify parameters for swapchain creation (formats, optional depth-stencil images etc.)
* Passing present queue on present allows removing the mutex for command queue on vulkan

msiglreith added some commits Jul 12, 2017

@kvark

This comment has been minimized.

Copy link
Member

commented Jul 23, 2017

OMG IT'S HAPPENING

@kvark

This comment has been minimized.

Copy link
Member

commented Jul 24, 2017

Thank you for the detailed overview!
I don't think it makes any sense to pick on the details here, given the scale of the PR. We agree on the general direction, so I'm going to merge this and then deal with fallout :)

@kvark kvark merged commit 840dc0f into master Jul 24, 2017

2 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/travis-ci/push The Travis CI build failed
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@kvark kvark removed the status: working label Jul 24, 2017

@msiglreith msiglreith deleted the ll branch Jul 24, 2017

@msiglreith msiglreith restored the ll branch Jul 24, 2017

@msiglreith msiglreith deleted the ll branch Aug 8, 2017

@kvark kvark referenced this pull request Oct 11, 2017

Merged

Going aLL the way down #1559

bors bot added a commit that referenced this pull request Oct 11, 2017

Merge #1559
1559: Going aLL the way down r=msiglreith a=kvark

This PR is the second grand LL merging (first was #1391). It breaks examples on `master`, and `gfx_render` still needs more work, but we can't pretend that `master` makes any sense anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.