Skip to content

Conversation

@RedDevilus
Copy link
Contributor

Description of Changes

There seems to be an issue with how the MTGS handles the enumeration and drawing, updating for the replaced crosshairs icons that the users provides like in a .png format. Master would be random but tends to only show USB Device 1 crosshair. But now 2 at same time should work. Hopefully gets rid of #11423
2025-05-23_03-36
2025-05-23_03-35
2025-05-23_04-28

Rationale behind Changes

The niche lightgun users also using niche dual replaced icons was certainly a bug as you get ghost inputs if not the texture was carefully drawn.

Suggested Testing Steps

Normal games work, but best in any game that uses GunCon2 aka lightgun games.

Did you use AI to help find, test, or implement this issue or feature?

No, this mess is my own.

@JordanTheToaster JordanTheToaster added this to the Release 2.6 milestone May 23, 2025
@bslenul
Copy link
Contributor

bslenul commented May 23, 2025

Thanks for the PR! ❤️

It seems to work fine for me with any renderer but GL, when using GL I'm getting a crash on game start:

GL-crash.zip

@lightningterror
Copy link
Contributor

@bslenul Can you create a gs dump with a renderer that works where it would crash and post it here?

@bslenul
Copy link
Contributor

bslenul commented May 23, 2025

Sure, this is with "Automatic" (so VK in my case): gun-gs-dump.zip

The dump loads fine with all renderers expect GL (as long as I use at least 1 PNG as a crosshair).

@lightningterror
Copy link
Contributor

Dump works fine here, are you sure this dump crashes on gl?

image

@bslenul
Copy link
Contributor

bslenul commented May 23, 2025

It won't crash unless you've set a PNG crosshair, which I can't see on your screen.

Basically it looks like this for me with anything but GL (notice the crosshairs in the middle of the screen):

image

edit: Updated screenshot with OSD stuff.

Copy link
Contributor

@lightningterror lightningterror left a comment

Choose a reason for hiding this comment

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

UpdateSoftwareCursorTexture has to run on the GS thread for thread safety, otherwise it causes race conditions on OpenGL where you create texture without a valid context. All GL API calls must happen on the GS thread.

Try

	if (MTGS::IsOpen())
	{
		MTGS::RunOnGSThread([index]() {
			UpdateSoftwareCursorTexture(index);
		});
	}

@bslenul
Copy link
Contributor

bslenul commented May 23, 2025

Can confirm, no more crash with GL with that change! 👍

@bslenul
Copy link
Contributor

bslenul commented May 23, 2025

Unrelated with that last change, but any idea why I'm getting this with this PR when running a Debug build?

image

image

@bslenul
Copy link
Contributor

bslenul commented May 23, 2025

Can confirm, no more crash with GL with that change! 👍

Argh, no more crash but now P2 cursor doesn't always appear again.

@RedDevilus
Copy link
Contributor Author

Can confirm, no more crash with GL with that change! 👍

Argh, no more crash but now P2 cursor doesn't always appear again.

Yup, if you have both crosshairs images with that fix in, it just reverts behaviour. Only shows first player crosshair and before showed both.

@gamerx1-cyber
Copy link

Is this also related to #4472

@RedDevilus
Copy link
Contributor Author

Is this also related to #4472

This doesn't touch firewire and iLink, those are just stubbed aka placebo files in the codes still so we don't do that functionality.

It's just visual indicators for custom crosshairs which doesn't affect in-game parts.

@gamerx1-cyber
Copy link

Is this also related to #4472

This doesn't touch firewire and iLink, those are just stubbed aka placebo files in the codes still so we don't do that functionality.

It's just visual indicators for custom crosshairs which doesn't affect in-game parts.

Ahh I see, thank you

@RedDevilus RedDevilus marked this pull request as draft May 31, 2025 00:36
@RedDevilus RedDevilus marked this pull request as ready for review May 31, 2025 16:20
@bslenul
Copy link
Contributor

bslenul commented May 31, 2025

With the latest changes PCSX2 hangs for me with custom crosshair PNG when launching a game in Big Picture mode.

@RedDevilus RedDevilus marked this pull request as draft June 4, 2025 21:31
There seems to be an issue with how the MTGS handles the enumeration and drawing, updating for the replaced crosshairs icons that the users provides like in a .png format. Master would be random but tends to only show USB Device 1 crosshair. But now 2 at same time should work. Hopefully gets rid of PCSX2#11423
TheLastRar: '

This issue of the missing P2 cursor seems to be caused because the GS (and thus MTGS) gets reset shortly after USBopen, causing the command to get dropped.

Putting MTGS::WaitGS() at the end of this function (after the closing bracket for MTGS::RunOnGSThread()) seems enough to fix this.'

Didn't see where it lost the textures before but I did identify it was happening on the MTGS thread somehow. If you uncommented it, it did work but then you get issues with OpenGL renderer.
FSUI waits on itself when switching/launching games in gamelist section but fine in Qt version.
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.

6 participants