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
VideoCommon: Fix SSBO layout and remove associated "bug" #10760
Conversation
|
Unfortunately my old AMD laptop is dead, so I don't have the ability to test this (unlike I did with #9764). This sounds plausible though. |
|
I can confirm that on a Radeon Pro 5600M using AMD's 20.45.40.15 driver (which is the newest offered to Intel Macs running windows), removing the bug entry breaks bbox and adding std430 fixes it |
|
I can confirm this works on my AMD card on Windows. Code wise, my only concern is that the As an aside, I'd love to update our minimum requirement to something newer.. |
|
Wouldn't be possible to use the |
Yeah something like that would be possible, it's not being done though. The current way we handle this sort of scenario is adding a flag that says whether the feature is available. Then that flag would be set to true if OpenGL 4.3 or higher exists. If it's true you'd use the We already have many examples of this. It's just very klunky to have so many checks around the code base. That's why it would be great if we could update our minimum version. But that won't likely happen in this PR. EDIT: For reference, OpenGL 4.3 apparently came out in 2012! TEN years ago. Our minimum required version 3.0, came out in 2008.. |
|
The document on the ssbo extension specifically mentions std430, so I assume anything that supports ssbos also supports std430 layout? |
|
@TellowKrinkle - yes, however for OGL, we only enable that extension if So I imagine we only want to set For Vulkan, I think we're fine with the current assumption. |
|
dolphin/Source/Core/VideoBackends/OGL/OGLRender.cpp Lines 424 to 425 in 23ed611
Therefore
|
|
I had assumed that just having the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @TellowKrinkle , I should have followed my train of thought all the way through but I was running out the door. Anyway, this LGTM and it's been tested.
I mean, for all the compiler knows, I'm going to expand it into a function after |
Bug was ours, not AMD's
If you don't specify a layout, the driver's free to do whatever it wants and we're supposed to ask it what it did. AMD probably went for std140 layout (where int[4] would have each int padded to 16 bytes)
I don't see any reason we'd want an SSBO without std430, so I stuck it into the macro, but we could put it outside like we do for UBOs if you'd prefer that