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

vk: Allow host GPU to synchronize directly with CELL via RSX semaphores #11568

Merged
merged 5 commits into from
Feb 23, 2022

Conversation

kd-11
Copy link
Contributor

@kd-11 kd-11 commented Feb 22, 2022

Pass host GPU state directly to CELL threads. CELL synchronizes with RSX, but this is handled on the CPU using fake signals that do not reflect the actual nature of data. Some games have tightly synchronous engines that require RSX semaphores to be accurate. This is not a problem for OpenGL due to how the texture system works there, but vulkan has a simulated coherent FlexIO DMA layer which persists between draws. This means that we need to tell the game when it is safe to clobber memory for example instead of just signaling the semaphores when we see them on the CPU side of things.
Fixes flickering vegetation in Avatar. In theory, this should also fix flickering in Toy Story 3 without strict mode enabled.
Note that the "Allow Host GPU Labels" toggle needs to be checked to enable this functionality.

Fixes #11552

@kd-11
Copy link
Contributor Author

kd-11 commented Feb 22, 2022

P.S For those curious, this is slower than using the regular simulated semaphores, so do not expect performance gains.

@@ -16,6 +16,18 @@ namespace vk
gpu = 1
};

struct host_data_t // Pick a better name
{
u64 magic = 0xCAFEBABE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not 0xB0BAFEDD ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0xBEEFFACE

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0xB16B00B5

@Jonathan44062
Copy link

@kd-11
Copy link
Contributor Author

kd-11 commented Feb 23, 2022

Removed toy story 3 from description, that game requires full zcull sync on a texture semaphore which is just dumb. Strict mode is still required for that due to the performance penalty.

@kd-11 kd-11 changed the title [TESTERS NEEDED] vk: Allow host GPU to synchronize directly with CELL via RSX semaphores vk: Allow host GPU to synchronize directly with CELL via RSX semaphores Feb 23, 2022
@kd-11 kd-11 merged commit 6b8b23c into RPCS3:master Feb 23, 2022
@slumlorddaddy
Copy link

I think this broke integrated Intel iris xe graphics. #11567 works fine. #11568 won't boot any games. Getting "No compatible memory type was found" error.

@kd-11
Copy link
Contributor Author

kd-11 commented Feb 23, 2022

I think this broke integrated Intel iris xe graphics. #11567 works fine. #11568 won't boot any games. Getting "No compatible memory type was found" error.

Hmm, AMD has the same error when binding but it doesn't matter for host allocations. I can technically apply the same workaround for Xe or just blacklist the driver, we'll see.

@kd-11
Copy link
Contributor Author

kd-11 commented Feb 23, 2022

I think this broke integrated Intel iris xe graphics. #11567 works fine. #11568 won't boot any games. Getting "No compatible memory type was found" error.

Try with #11570

@Augusto7743
Copy link

"Some games have tightly synchronous engines that require RSX semaphores to be accurate. This is not a problem for OpenGL due to how the texture system works there, but vulkan has a simulated coherent FlexIO DMA layer which persists between draws."
Perhaps is the explanation because have games running more fast in OpenGL than Vulkan.
UMVSC3 OpenGL is more slow to compile shaders, but after all work is done gameplay run more fast than if using Vulkan.

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.

Regression: James Cameron AVATAR - Foliage flickering #9613
7 participants