Commit graph

55 commits

Author SHA1 Message Date
James Rowe
cf9c94d401 Address review and fix broken yuzu-tester build 2020-03-25 23:32:42 -06:00
James Rowe
282adfc70b Frontend/GPU: Refactor context management
Changes the GraphicsContext to be managed by the GPU core. This
eliminates the need for the frontends to fool around with tricky
MakeCurrent/DoneCurrent calls that are dependent on the settings (such
as async gpu option).

This also refactors out the need to use QWidget::fromWindowContainer as
that caused issues with focus and input handling. Now we use a regular
QWidget and just access the native windowHandle() directly.

Another change is removing the debug tool setting in FrameMailbox.
Instead of trying to block the frontend until a new frame is ready, the
core will now take over presentation and draw directly to the window if
the renderer detects that its hooked by NSight or RenderDoc

Lastly, since it was in the way, I removed ScopeAcquireWindowContext and
replaced it with a simple subclass in GraphicsContext that achieves the
same result
2020-03-24 21:03:42 -06:00
bunnei
c6f78a4a6d frontend: qt: bootmanager: Acquire a shared context in main emu thread. 2020-02-25 21:23:02 -05:00
bunnei
e25297536f frontend: qt: bootmanager: Vulkan: Restore support for VK backend. 2020-02-25 21:23:01 -05:00
bunnei
14877b8f35 frontend: qt: bootmanager: OpenGL: Implement separate presentation thread. 2020-02-25 21:23:01 -05:00
bunnei
667f026c95 core: frontend: Refactor scope_acquire_window_context to scope_acquire_context. 2020-02-25 21:23:00 -05:00
ReinUsesLisp
a7beabb68f yuzu/bootmanager: Define Vulkan widget only when enabled 2020-01-29 19:20:12 -03:00
ReinUsesLisp
f92cbc5501 yuzu: Implement Vulkan frontend
Adds a Qt and SDL2 frontend for Vulkan. It also finishes the missing
bits on Vulkan initialization.
2020-01-29 17:53:11 -03:00
ReinUsesLisp
8306703a7d yuzu/bootmanager: Remove {glx,wgl}MakeCurrent on SwapBuffers
MakeCurrent is a costly (according to Nsight's profiler it takes a tenth
of a millisecond to complete), and we don't have a reason to call it
because:
- Qt no longer signals a warning if it's not called
- yuzu no longer supports macOS
2020-01-06 14:02:47 -03:00
Zach Hilman
de33ad25f5
Merge pull request #2514 from ReinUsesLisp/opengl-compat
video_core: Drop OpenGL core in favor of OpenGL compatibility
2019-06-07 17:23:25 -04:00
Lioncash
77ce85f51d yuzu/bootmanager: Log out screenshot destination path
We can make this message more meaningful by indicating the location the
screenshot has been saved to. We can also log out whenever a screenshot
could not be saved (e.g. due to filesystem permissions or some other
reason).
2019-06-03 15:34:32 -04:00
Lioncash
e32bf646cf yuzu/bootmanager: Treat the resolution factor as a u32
Treating it as a u16 can result in a sign-conversion warning when
performing arithmetic with it, as u16 promotes to an int when aritmetic
is performed on it, not unsigned int.

This also makes the interface more uniform, as the layout interface now
operates on u32 across the board.
2019-06-03 15:34:31 -04:00
Lioncash
536c9cf006 yuzu/bootmanager: Default EmuThread's destructor in the cpp file
This class contains non-trivial members, so we should default the
destructor's definition within the cpp file.
2019-06-03 15:34:31 -04:00
Lioncash
0a650ec99e yuzu/bootmanager: unsigned -> u32
Same thing (for platforms we support), less reading.
2019-06-03 15:34:31 -04:00
Lioncash
2575403acf yuzu/bootmanager: Change false literal to 0 for setSwapInterval()
This function is defined as taking an int, not a bool.
2019-06-03 15:31:52 -04:00
Lioncash
cfb59aad3f yuzu/bootmanager: Remove pointer downcast in GRenderWindow's constructor
We can just pass a pointer to GMainWindow directly and make it a
requirement of the interface. This makes the interface a little safer,
since this would technically otherwise allow any random QWidget to be
the parent of a render window, downcasting it to GMainWindow (which is
undefined behavior).
2019-06-03 15:31:52 -04:00
Lioncash
49e3a6e924 yuzu/bootmanager: Remove unnecessary pointer casts
We can just invoke these functions by qualifying the object name before
the function.
2019-06-03 15:31:51 -04:00
ReinUsesLisp
7259f7a733 rasterizer_opengl: Remove OpenGL core profile 2019-05-30 13:21:00 -03:00
bunnei
665b7e8e18
Merge pull request #2518 from ReinUsesLisp/sdl2-window
yuzu_cmd: Split emu_window OpenGL implementation into its own file
2019-05-29 11:01:12 -04:00
ReinUsesLisp
37eaf39b44 emu_window: Pass OnMinimalClientAreaChangeRequest argument by copy
There's no performance improvement in passing an unsigned pair by
reference.
2019-05-26 00:54:13 -03:00
ReinUsesLisp
c03b8c4c19 gl_shader_cache: Use shared contexts to build shaders in parallel 2019-05-20 22:45:55 -03:00
Lioncash
fd34732e26 yuzu/bootmanager: Specify string conversions explicitly
Allows the bootmanager code to compile with implicit string conversions
disabled.
2019-05-20 14:50:53 -04:00
ReinUsesLisp
e6c60b419c yuzu/bootmanager: Explicitly enable deprecated OpenGL features on compat
Nvidia's proprietary driver creates a real OpenGL compatibility profile
without this option, meanwhile Intel (and probably AMD, I haven't tested
it) require that QSurfaceFormat::FormatOption::DeprecatedFunctions is
explicitly enabled.
2019-05-17 04:09:17 -03:00
Fernando Sahmkow
788497fd9d Allow picking a Compatibility Profile for OpenGL.
This option allows picking the compatibility profile since a lot of bugs
are fixed in it. We devs will use this option to easierly debug current
problems in our Core implementation.:wq
2019-04-20 00:05:24 -04:00
Lioncash
54e9f9b6ed yuzu/bootmanager: Replace unnnecessary constructor initializer list member of GGLContext
The default constructor will always run, even when not specified, so
this is redundant.

However, the context member can indeed be initialized in the constructor
initializer list.
2019-04-17 00:04:10 -04:00
Lioncash
fbfc347351 yuzu/bootmanager: Resolve constructor initializer list warnings
Resolves -Wreorder warnings. These will automatically be initialized to
nullptr anyways, so these were redundant.
2019-04-16 23:49:26 -04:00
bunnei
065f83c6c3
Merge pull request #2017 from jroweboy/glwidget
Frontend: Migrate to QOpenGLWindow and support shared contexts
2019-04-13 22:08:40 -04:00
Lioncash
781ab8407b general: Use deducation guides for std::lock_guard and std::unique_lock
Since C++17, the introduction of deduction guides for locking facilities
means that we no longer need to hardcode the mutex type into the locks
themselves, making it easier to switch mutex types, should it ever be
necessary in the future.
2019-04-01 12:53:47 -04:00
ReinUsesLisp
9ebc27234d bootmanager: Bypass input focus issues 2019-03-25 17:10:34 -03:00
ReinUsesLisp
bbb396d7f1 bootmanager: Bypass resizing issue 2019-03-25 17:10:34 -03:00
ReinUsesLisp
9ff72ca9f2 bootmanager: Delete container to avoid crash on game restarting
While we are at it, remove nullptr checks for deletion, since the C++
standard defines that delete does it by its own
2019-03-25 17:10:34 -03:00
liushuyu
59f16f2e02 frontend: qt: fix a freeze where if you click on entry in the game list too fast, citra will hang 2019-03-15 16:10:21 +01:00
bunnei
0a923b4ab3
Merge pull request #2187 from FearlessTobi/port-sdl-things
Port various Citra changes to input_common, including deadzone support
2019-03-13 11:46:57 -04:00
bunnei
65651078e5 bootmanager: Ensure that we have a context for shader loading. 2019-03-06 21:48:56 -05:00
James Rowe
09ac66388c Input: Remove global variables from SDL Input
Changes the interface as well to remove any unique methods that
frontends needed to call such as StartJoystickEventHandler by
conditionally starting the polling thread only if the frontend hasn't
started it already. Additionally, moves all global state into a single
SDLState class in order to guarantee that the destructors are called in
the proper order
2019-03-02 19:09:34 +01:00
ReinUsesLisp
eb73247433 gl_shader_cache: Link loading screen with disk shader cache load 2019-02-06 22:23:40 -03:00
James Rowe
5f2d9f282a QT: Hide GLWidget immediately after showing.
With the loading screen merged, we don't want to actually show at this
point, but it still needs to be shown to actually create the context.
Turns out you can just show and hide it immediately and it'll work.
2019-01-21 16:21:44 -07:00
James Rowe
c6a0ab9792 QT Frontend: Migrate to QOpenGLWindow 2019-01-21 16:00:01 -07:00
James Rowe
08fcf41b0a QT Frontend: Add a Loading screen with progressbar
With shader caches on the horizon, one requirement is to provide visible
feedback for the progress. The shader cache reportedly takes several
minutes to load for large caches that were invalidated, and as such we
should provide a loading screen with progress.

Adds a loading screen widget that will be shown until the first frame of
the game is swapped. This was chosen in case shader caches are not being
used, several games still take more than a few seconds to launch and
could benefit from a loading screen.
2019-01-19 23:34:03 -07:00
zhupengfei
a2be49305d yuzu, video_core: Screenshot functionality
Allows capturing screenshot at the current internal resolution (native for software renderer), but a setting is available to capture it in other resolutions. The screenshot is saved to a single PNG in the current layout.
2018-12-18 22:54:41 +01:00
FernandoS27
377c60645c Update OpenGL's backend version from 3.3 to 4.3 2018-11-21 11:43:17 -04:00
Lioncash
2cbc284c2b bootmanager: Use QStringLiteral instead of std::string to represent the window title
This gets rid of an unnecessary type conversion. We can just use the
regular QStringLiteral to already format the string as the type
setWindowTitle accepts instead of converting from a std::string
instance.
2018-10-24 08:14:26 -04:00
NeatNit
4f24343f32 implemented touch in Qt and SDL
change TouchToPixelPos to return std::pair<int, int>

static_cast (SDL)

various minor style and code improvements

style - PascalCase for function names

made touch events private

const pointer arg in touch events

make TouchToPixelPos a const member function

did I do this right?

braces on barely-multiline if

remove question comment (confirmed in Discord)

fixed consts

remove unused parameter from TouchEndEvent

DRY - High-DPI scaled touch put in separate function

also fixes a bug where if you start touching (with either mouse or touchscreen) and drag the mouse to the LEFT of the emulator window, the touch point jumps to the RIGHT side of the touchscreen; draggin to above the window would make it jump to the bottom.

implicit conversion from QPoint to QPointF, apparently

I have no idea what const even means but I'll put it here anyway

remove unused or used-once variables

make touch scaling functions const, and put their implementations together

removed unused FingerID parameters

QTouchEvent forward declaration; add comment to TouchBegin that was lost in an edit

better DRY in SDL

To do -> TODO(NeatNit)

remove unused include
2018-10-09 20:26:57 +02:00
Tobias
804115b2a4 Port #4141 from citra: Joystick hotplug support (#1275)
* Joystick hotplug support (#4141)

* use SDL_PollEvent instead of SDL_JoystickUpdate

Register hot plugged controller by GUID if they were configured in a previous session

* Move SDL_PollEvent into its own thread

* Don't store SDLJoystick pointer in Input Device; Get pointer on each GetStatus call

* Fix that joystick_list gets cleared after SDL_Quit

* Add VirtualJoystick for InputDevices thats never nullptr

* fixup! Add VirtualJoystick for InputDevices thats never nullptr

* fixup! fixup! Add VirtualJoystick for InputDevices thats never nullptr

* Remove SDL_GameController, make SDL_Joystick* unique_ptr

* fixup! Remove SDL_GameController, make SDL_Joystick* unique_ptr

* Adressed feedback; fixed handling of same guid reconnects

* fixup! Adressed feedback; fixed handling of same guid reconnects

* merge the two joystick_lists into one

* make SDLJoystick a member of VirtualJoystick

* fixup! make SDLJoystick a member of VirtualJoystick

* fixup! make SDLJoystick a member of VirtualJoystick

* fixup! fixup! make SDLJoystick a member of VirtualJoystick

* SDLJoystick: Addressed review comments

* Address one missed review comment
2018-09-10 21:29:59 -04:00
fearlessTobi
742f895f8b frontend: Set swap interval to 0 2018-09-06 18:57:51 +02:00
bunnei
05cb10530f OpenGL: Use MakeCurrent/DoneCurrent for multithreaded rendering. 2018-07-14 02:50:35 -04:00
fearlessTobi
b8384c0c91 Port #3505 from CItra 2018-07-07 14:11:49 +02:00
Lioncash
3abba08080
string_util: Remove StringFromFormat() and related functions
Given we utilize fmt, we don't need to provide our own functions for formatting anymore
2018-04-29 18:52:33 -04:00
Lioncash
5e46a9bb2b qt: Migrate to Qt 5 signal/slot connection syntax where applicable 2018-01-18 20:09:40 -05:00
Lioncash
e50188374f bootmanager: Minor tidiness/correctness changes
Moved over from #3266 in citra.
2018-01-17 18:35:02 -05:00