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

Pipeline library / cache support #36

Open
vertver opened this issue Feb 2, 2024 · 7 comments
Open

Pipeline library / cache support #36

vertver opened this issue Feb 2, 2024 · 7 comments
Labels
extension Extension functionality

Comments

@vertver
Copy link
Contributor

vertver commented Feb 2, 2024

On D3D12 and Vulkan there is a problem with the PSO build process. Sometimes the game can hang, and not only that - you, as a developer, cannot directly predict the pipeline build time. Also, on GDK you can't build PSO at runtime, only pre-compile. So I think this feature is most needed in NRI as an extension because it affects a lot of things. What do you think? Maybe we need some priorities for our tasks to manage them properly?

@dzhdanNV
Copy link
Collaborator

dzhdanNV commented Feb 2, 2024

Seems useful. Hope VK has this functionality too (sorry, I'm out of topic for now). Regarding priorities:

Then we can adjust further steps. And of course, there are other higher priority than NRI tasks I have to work on.

@dzhdanNV dzhdanNV changed the title Pipeline Library Extension [RFE] Pipeline Library Extension Feb 10, 2024
@dzhdanNV dzhdanNV changed the title [RFE] Pipeline Library Extension [RFE] Pipeline library extension Feb 10, 2024
@vertver
Copy link
Contributor Author

vertver commented Feb 15, 2024

I did some research about pipeline library, and here is what I found:

Pipeline library in D3D12 and in Vulkan are absolutely different things. In D3D12 ID3D12PipelineLibrary was created for storing and loading multiple pipelines into/from one file/chunk. However, in Vulkan, pipeline library was created for building multiple parts of pipeline (rasteriser state, output merger, etc) and combining them into one big pipeline.

However, AFAIK, you can use PSO cache on both APIs. So, I think that maybe we can drop Vulkan behaviour and use D3D12 description of pipeline library. Also, it might be possible to emulate this behaviour on D3D11 and use this functionality in core.

References:
D3D12 (see CachedPSO for more info)
Vulkan sample

@dzhdanNV
Copy link
Collaborator

Hi! Since you are interested and I'm busy with other stuff, I don't mind if you add ext (or core?) functionality, even focusing more on D3D12. I would suggest starting with the API to ensure quality, the implementation is less important because it can be improved later. I promise (fingers crossed ^_^) to accept these changes.

@dzhdanNV
Copy link
Collaborator

Thanks for the links! Despite that VK solution is different, it seems to solve the same problem. I hope there is an API covering both GAPIs. For D3D11, I think, pipeline cache API can be made NOP (i.e. do nothing) because there is no such functionality on D3D11 (only implicit shader cache).

Most likely PSO caching will go into Core because:

  • a few new functions will be exposed
  • no extensions needed for GAPI (it's basic functionality)
  • seems to fit better here

@vertver
Copy link
Contributor Author

vertver commented Feb 26, 2024

At the moment I'm busy with work on my project, so this month and possibly next month I won't be able to contribute to the NRI (only minor things, bugfixes). But closer to April-May I will upload something for pipelines and other changes.

@dzhdanNV
Copy link
Collaborator

dzhdanNV commented Feb 27, 2024

Sounds good! Good luck with your work. I'm always happy to see NRI changes and feature requests from you. As I promised, the streamer interface will be implemented soon.

@dzhdanNV dzhdanNV changed the title [RFE] Pipeline library extension [RFE] Pipeline library / cache extension Jul 13, 2024
@dzhdanNV dzhdanNV added the enhancement New feature or request label Jul 21, 2024
@dzhdanNV dzhdanNV changed the title [RFE] Pipeline library / cache extension Pipeline library / cache extension Jul 21, 2024
@dzhdanNV dzhdanNV added extension Extension functionality and removed enhancement New feature or request labels Aug 17, 2024
@dzhdanNV dzhdanNV changed the title Pipeline library / cache extension Pipeline library / cache support Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Extension functionality
Projects
None yet
Development

No branches or pull requests

2 participants