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

MSAA help/example? #122

Closed
Marlax0 opened this issue Mar 17, 2025 · 8 comments
Closed

MSAA help/example? #122

Marlax0 opened this issue Mar 17, 2025 · 8 comments
Labels
bug Something isn't working d3d11 D3D11 specific d3d12 D3D12 specific fixed in progress Issue is in progress

Comments

@Marlax0
Copy link

Marlax0 commented Mar 17, 2025

Setting sampleNum in nri::MultisampleDesc greater than 1 results in ForcedSampleCount being set in the corresponding D3D12_RASTERIZER_DESC.
ForcedSampleCount has some very restrictive limitations. Read all about them here.

How do I just enable "normal" multisampling for a nri::Pipeline?

To clarify, I just want to forward render my scene geometry using a depth buffer, with multisampling, like I am able to do using D3D12.

Sorry if I've greatly misunderstood something.

@dzhdanNV
Copy link
Collaborator

dzhdanNV commented Mar 17, 2025

Hi. I quickly reviewed MSAA related code:

  • yes, ForcedSampleCount is used incorrectly (sorry!)
  • the good news is that to get MSAA working just comment out ForcedSampleCount lines (2 in D3D12 and 2 in D3D11)
  • if there is an analog for ForcedSampleCount in VK, I will expose a separate optional setting
  • I will add a basic sample to test MSAA + resolve functionality. Hopefully this week

Please, let me know if the quick fix doesn't work.

@dzhdanNV
Copy link
Collaborator

VK doesn't have ForcedSampleCount analog. I will commit a quick fix in a few minutes...

@dzhdanNV
Copy link
Collaborator

Committed the fix.

@Marlax0
Copy link
Author

Marlax0 commented Mar 17, 2025

Hey I also don't see any way to create a MSAA swap chain, unless I've missed something.

@dzhdanNV
Copy link
Collaborator

Yes, expected. I would prefer to not add MSAA swapchains since it's a bad practice (and also it adds some usage restrictions).

@Marlax0
Copy link
Author

Marlax0 commented Mar 17, 2025

True. I don't actually use one either, but it would have been a quick way to test.
I'll see if I can get a sample working soon.

Edit: I can confirm creating the nri::Pipeline with multisampling and depth/stencil now works as expected.
I haven't finished porting the rest of my renderer yet, so I can't fully test it. I don't think there will be any issues...

@dzhdanNV
Copy link
Collaborator

Thanks for testing! Hope it really works (it should) :)

@dzhdanNV dzhdanNV added bug Something isn't working d3d12 D3D12 specific d3d11 D3D11 specific fixed in progress Issue is in progress labels Mar 17, 2025
@Marlax0
Copy link
Author

Marlax0 commented Mar 22, 2025

It's gonna take me a bit longer than expected to fully test this.
I'm gonna go ahead and close this issue.

@Marlax0 Marlax0 closed this as completed Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working d3d11 D3D11 specific d3d12 D3D12 specific fixed in progress Issue is in progress
Projects
None yet
Development

No branches or pull requests

2 participants