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

Support for vk graphics pipeline library extension #72682

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

warriormaster12
Copy link
Contributor

@warriormaster12 warriormaster12 commented Feb 3, 2023

image

This is a first draft of graphics pipeline library extension support in Godot. This extension allows splitting graphics pipeline creation into 4 different stages vertex input, vertex shader (It includes geometry and tesselation), fragment shader and fragment output which in turn allows re-usage of different stages when for example creating a new pipeline with similar permutations. In addition, extension allows PSOs to be compiled in creation time.

There are still things that need to be resolved before merging the PR.

  • pipeline layouts should be split in a way that they are used in a correct stage. As far as I know, if we have a descriptor set x that is being used both with vertex and fragment shader, we can bind the vertex bit without waiting for a fragment bit being ready.
  • VkShaderModules are being deprecated, we don't have to go through the process of creating them.
  • VRS is at the moment broken.
  • Celebrate my first PR.

More info about the extension

@warriormaster12 warriormaster12 requested review from a team as code owners February 3, 2023 18:42
@warriormaster12 warriormaster12 marked this pull request as draft February 3, 2023 18:56
@clayjohn
Copy link
Member

clayjohn commented Feb 3, 2023

For future readers. This is a very new Vulkan extension (less than 1 year old) and is only supported by a few devices (GPUinfo reports 5.46% coverage so far. While that number is biased as most samples were reported before the extension was made it highlights that this is quite new).

That being said, its a very exciting change to the Vulkan spec that hopefully will help further reduce pipeline compilation stalls.

@Riteo
Copy link
Contributor

Riteo commented Feb 4, 2023

@clayjohn

This is a very new Vulkan extension (less than 1 year old) and is only supported by a few devices

Do you know if this is an hardware limitation or if there will also be some driver (e.g. Mesa) implementations, if they're even possible?

@warriormaster12
Copy link
Contributor Author

Mesa team is working on a RADV GPL implementation. I believe it works but doesn't have shader cache mechanism implemented yet.

@warriormaster12
Copy link
Contributor Author

warriormaster12 commented Feb 7, 2023

TPS-Demo with GPL enabled
image

Getting hashing to work was a bit tedious and painful. Might be due to my inexperience of making custom hash-able classes but I finally got pipeline stages caching to work🥳 (I at least hope so). The journey hasn't ended yet but I think that this is a good opportunity to ask for some battle testing to make sure that everything works like before. If anyone can find bugs that might be related to graphics pipeline library caching, let me know.

Best way to know if it is related to pipeline caching is comparing renderdoc captures between each other with graphics pipeline library enabled and without it.

Example:

Incorrect offset in uv_attrib with GPL enabled
image

Correct offset in uv_attrib without it
image

@warriormaster12
Copy link
Contributor Author

Quickly made an update that reduced amount of cached elements.

@Calinou Calinou added bug and removed bug labels May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants