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

gsdx: set the new renderer in ini file after a F9 switch #588

Closed
wants to merge 1 commit into from

Conversation

gregory38
Copy link
Contributor

Tentative fix for #584

@turtleli
Copy link
Member

turtleli commented Jun 6, 2015

I think pcsx2/MTGS.cpp also needs changed as well? Needs a renderswitch = false; thrown in after the if on line 195:

    if( renderswitch )
    {
        Console.Indent(2).WriteLn( "Toggling GSdx Hardware/Software renderer" );
        if ( EmuConfig.GS.VsyncEnable )
        {
            // Better turn Vsync off now, as in most cases sw rendering is not fast enough to support a steady 60fps.
            // Having Vsync still enabled then means a big cut in speed and sloppy rendering.
            // It's possible though that some users have very fast machines, and rather kept Vsync enabled,
            // but let's assume this is the minority. At least for now ;)
            GSsetVsync( false );
            Console.Indent(2).WriteLn( "Vsync temporarily disabled" );
        }
    }

@refractionpcsx2
Copy link
Member

Yes that console writeline can be modified now to show what the renderer actually is, like people wanted :p

@karasuhebi
Copy link
Contributor

Will this make it so the F9 toggle is permanent? Or will remain a temporary switch like before where GSdx will switch back to the renderer you have chosen in the UI when you open PCSX2 again?

@refractionpcsx2 YAY :D Will it also let us print it to the title bar? That'd be useful for when we're troubleshooting end user issues on the forums.

@bositman
Copy link
Member

bositman commented Jun 7, 2015

Hm that is a concern, writing it to the ini will keep it that way for the next time you'll boot PCSX2 again, not sure if we want that

@refractionpcsx2
Copy link
Member

I guess gsdx could be told to clear it out of the ini when it gets told to close

@bositman
Copy link
Member

bositman commented Jun 7, 2015

You'll have to store the initial value you had at boot and restore it when closing

@gregory38
Copy link
Contributor Author

First is the file really updated in windows?
Then, I think the important commit is the 2nd commit.
Otherwise saving the value seems doable.

@refractionpcsx2
Copy link
Member

What do you mean is the file really updated on Windows? Ofc it is :p

@karasuhebi
Copy link
Contributor

@refractionpcsx2 I believe it was mentioned in one of the GH Issues that it wasn't writing the value to the .ini file. I can't remember who mentioned it or in what Issue though. XD

EDIT:
OK maybe it was this one:
#584 (comment)

@gregory38
Copy link
Contributor Author

So I propose another idea. Set the renderer before enter the GUI instead of after toggling it.

This way, the gui is aligned with the renderer but it doesn't
save the value if you don't open the GUI
@gregory38 gregory38 force-pushed the issue-565-option-reloading-v2 branch from 9ec2621 to ead0301 Compare June 18, 2015 19:49
@gregory38
Copy link
Contributor Author

I updated the branch. Tell me if it behave better.

The renderer is only set before calling the gs option.

@turtleli
Copy link
Member

Tested after rebasing this on master (7135867) and capitalising renderer. This makes the renderer settings when you open the config panel confusing and doesn't fix the issue.

My test:
Start in OpenGL Hardware mode.
Boot game, F9 once (or any odd number of times). (OGL SW)
Open config panel. It'll show OpenGL(Software).
Cancel. Game resumes (OGL HW).
Open config panel. It'll show OpenGL(Hardware).
Cancel. Game resumes (OGL SW).
Open config panel. It'll show OpenGL(Software). Change to OpenGL(Hardware).
Ok. Game resumes (OGL SW).

To fix the behaviour requires changes to the core. The core has the assumption that users always start off in hardware rendering mode and does not know whether the user is in hardware or software rendering mode. That's why a GSdx only fix won't work.

If you don't mind, I can probably fix it. If so, do you:

  1. want to maintain the old toggle behaviour for older GS plugins with newer PCSX2?
  2. want to maintain the old toggle behaviour for newer GSdx plugins with older PCSX2?

Note: because the core assumes users start in hardware rendering mode - The "Switch to GSdx software rendering when an FMV plays" gamefix and some other stuff in the code (disable Vsync in software mode) is actually broken when the user uses a software rendering mode to begin with.

@refractionpcsx2
Copy link
Member

Switching to software mode should change the main renderer imo, not have a sub/temporary renderer mode, if you change to software, it should change that in the config as well, at least then you know if you change it in the config, you're getting hardware mode if you chose it. There's no real reason to make it a temporary setting.

@turtleli
Copy link
Member

So an F9 toggle would be a permanent switch? Gregory's previous fix would have worked in that case (it'd break toggle on the older plugins if that matters). I suppose it doesn't matter too much whether it's permanent or not now that the title bar tells you what's being used.

@bositman
Copy link
Member

I still think that at the end of the play through GSdx should go back to the setting it initially was (before any F9 toggles) except if you modify it via the GUI. This way if I eg test a game and toggle 10 times, I won't have to check every time where it ended up for my next play through

@refractionpcsx2
Copy link
Member

Then the F9 toggle needs to be reset if the renderer is changed. PCSX2 doesn't know if you're in software mode, so resetting it in GSDX should be fine.

If we did know, PCSX2 wouldn't have to say it's swapping renderer without being precise :P

@turtleli
Copy link
Member

Thinking again, it can be mostly solved in GSdx without touching core and keeping it temporary. If you save the last state of the F9 toggle and compare it with the current flags it should work. Something like this in GSOpen2:

if (stored_flag != flag & 4)
// switch renderer stuff
stored_flag = flag & 4;

@karasuhebi
Copy link
Contributor

I agree with @bositman, I still think that the toggle should not be permanent.

@gregory38 gregory38 closed this Jun 24, 2015
@gregory38 gregory38 deleted the issue-565-option-reloading-v2 branch June 24, 2015 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants