Commit Graph

154 Commits

Author SHA1 Message Date
Weiyi Wang 9458e4d8ec CoreTiming: wrap into class 2018-11-04 10:26:38 -05:00
Weiyi Wang 7d8f115185 Prefix all size_t with std::
done automatically by executing regex replace `([^:0-9a-zA-Z_])size_t([^0-9a-zA-Z_])` -> `$1std::size_t$2`
2018-09-06 16:03:28 -04:00
bunnei ffdc27351a renderer_opengl: Treat OpenGL errors as critical. 2018-08-31 01:56:38 +02:00
fearlessTobi f61c9c3eb7 video_core: Make global EmuWindow instance part of the base renderer …
…class

Makes the global a member of the RendererBase class. We also change this
to be a reference. Passing any form of null pointer to these functions
is incorrect entirely, especially given the code itself assumes that the
pointer would always be in a valid state.

This also makes it easier to follow the lifecycle of instances being
used, as we explicitly interact the renderer with the rasterizer, rather
than it just operating on a global pointer.
2018-08-25 15:20:40 +02:00
fearlessTobi d1c5f01afe Add more verbose popups for video_core errors 2018-08-19 15:48:40 +02:00
zhupengfei 0c37140690 video_core: Allow changing background color while emulation is running
As @jroweboy stated, this is just one more atomic in VideoCore.
2018-08-04 15:11:51 +08:00
wwylele 0eab948728 reformat all files with clang-format 2018-06-29 16:56:12 +03:00
wwylele 7c5a76e58b log: replace all NGLOG with LOG 2018-06-29 14:18:07 +03:00
NarcolepticK 9ae70e733f video-core: Migrate logging macros (#3878)
* video-core: Migrate logging macros

* video-core: Fixed missed clang format

* video-core: Migrated LOG_GENERIC macro
2018-06-29 00:13:30 +03:00
N00byKing 523c52c708 renderer_opengl: Add Universal 3D Layout Adaption 2018-06-01 18:24:26 +02:00
jmorriz124 8c0ede544f 3dtv botenable improved (#1)
* Fixed crash when right eye isn't available

* Enabled swap screens in stereo views.  Fixed window alignment in stereo
views to handle all screen aspect ratios.

* Minor code cleanup and clang fomat updates.

* Minor cleanup of swapped and aspect ratio code
2018-06-01 17:05:29 +02:00
N00byKing 2814bbc3da renderer_opengl: Allow usage of Stereoscopic 3D 2018-06-01 17:01:06 +02:00
bunnei df8b9863f9 telemetry: Log performance, configuration, and system data. 2017-07-17 21:32:28 -04:00
Yuri Kunde Schlesner 6665557ff7 OpenGL: Remove unused RendererOpenGL fields 2017-05-27 18:02:46 -07:00
Yuri Kunde Schlesner fb1979d7e2 Core: Re-write frame limiter
Now based on std::chrono, and also works in terms of emulated time
instead of frames, so we can in the future frame-limit even when the
display is disabled, etc.

The frame limiter can also be enabled along with v-sync now, which
should be useful for those with displays running at more than 60 Hz.
2017-02-26 17:22:04 -08:00
Yuri Kunde Schlesner b285c2a4ed Core: Make PerfStats internally locked
More ergonomic to use and will be required for upcoming changes.
2017-02-26 17:22:03 -08:00
Yuri Kunde Schlesner 3b4e400333 Remove built-in (non-Microprofile) profiler 2017-02-26 17:22:03 -08:00
Yuri Kunde Schlesner c75ae6c585 Add performance statistics to status bar 2017-02-26 17:22:03 -08:00
MerryMage 64f98f4d0f core: Move emu_window and key_map into core
* Removes circular dependences (common should not depend on core)
2016-12-23 13:42:39 +00:00
James Rowe d9305b0a07 Add default hotkey to swap primary screens.
Also minor style changes
2016-11-05 03:46:43 -06:00
James Rowe 2b1654ad9b Support additional screen layouts.
Allows users to choose a single screen layout or a large screen layout.
Adds a configuration option to change the prominent screen.
2016-11-05 02:55:41 -06:00
Yuri Kunde Schlesner 84fbbe2629 Use negative priorities to avoid special-casing the self-include 2016-09-21 00:15:56 -07:00
Emmanuel Gil Peyrot ebdae19fd2 Remove empty newlines in #include blocks.
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
2016-09-21 11:15:47 +09:00
Yuri Kunde Schlesner 396a8d91a4 Manually tweak source formatting and then re-run clang-format 2016-09-18 21:14:25 -07:00
Emmanuel Gil Peyrot dc8479928c Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
mailwl 07cc781163 gsp::gpu: Reset g_thread_id in UnregisterInterruptRelayQueue 2016-06-01 09:40:15 +03:00
Alexander Laties 0a31e373f1 fixup simple type conversions where possible 2016-05-07 11:41:55 -04:00
Emmanuel Gil Peyrot aa4d4ff23c Frontends, VideoCore: Move glad initialisation to the frontend
On SDL2 this allows it to use SDL_GL_GetProcAddress() instead of the
default function loader, and fixes a crash when using apitrace with an
EGL context.

On Qt we will need to migrate from QGLWidget to QOpenGLWidget and
QOpenGLContext before we can use gladLoadGLLoader() instead of
gladLoadGL(), since the former doesn’t expose a function loader.
2016-05-06 03:10:14 +01:00
Emmanuel Gil Peyrot 691a42fe98 VideoCore: Run include-what-you-use and fix most includes. 2016-04-30 17:02:41 +01:00
tfarley 22f3a7e94c HWRasterizer: Texture forwarding 2016-04-21 17:27:56 -04:00
LittleWhite 4be68dddfb Improve error report from Init() functions
Add error popup when citra initialization failed
2016-03-08 22:05:25 +01:00
bunnei aaa7beeda8 renderer_opengl: Use GLvec3/GLvec4 aliases for commonly used types. 2016-02-05 17:20:23 -05:00
Yuri Kunde Schlesner 05356543d9 OpenGL: Downgrade GL_DEBUG_SEVERITY_NOTIFICATION to Debug logging level
The nVidia driver is *extremely* spammy on this category, sending a
message on every buffer or texture upload, slowing down the emulator and
making the log useless.
2016-02-02 22:44:13 -08:00
bunnei 6a261e825c Merge pull request #1196 from linkmauve/khr_debug
Add optional GL_KHR_debug support
2016-01-12 22:54:52 -05:00
Yuri Kunde Schlesner 195fedccf0 VideoCore: Unify interface to OpenGL and SW rasterizers
This removes explicit checks sprinkled all over the codebase to instead
just have the SW rasterizer expose an implementation with no-ops for
most operations.
2015-12-07 20:20:38 -08:00
Subv 823ce62f2f FragShader: Use an UBO instead of several individual uniforms 2015-11-18 21:03:56 -05:00
Emmanuel Gil Peyrot 53df67376d OpenGL: Log GL_KHR_debug messages we receive
This allows the driver to communicate errors, warnings and improvement
suggestions about our usage of the API.
2015-10-24 02:30:51 +01:00
bunnei c86b9d4242 renderer_opengl: Refactor shader generation/caching to be more organized + various cleanups. 2015-10-21 21:53:14 -04:00
Lioncash 751fbfdcc3 general: Silence some warnings when using clang 2015-09-16 08:51:53 -04:00
Lioncash aec28ed91e video_core: Reorganize headers 2015-09-11 07:31:15 -04:00
Lioncash 1fa772393b video_core: Remove unnecessary includes from headers 2015-09-11 00:10:03 -04:00
Yuri Kunde Schlesner a1a5570e97 Replace the previous OpenGL loader with a glad-generated 3.3 one
The main advantage of switching to glad from glLoadGen is that, apart
from being actively maintained, it supports a customizable entrypoint
loader function, which makes it possible to also support OpenGL ES.
2015-08-30 08:45:56 -03:00
Yuri Kunde Schlesner ff68db61bc OpenGL: Remove redundant texture.enable_2d field from OpenGLState
All uses of this field where it's false can just set the texture id to 0
instead.
2015-08-05 22:55:22 -03:00
Tony Wasserka 902fa4da52 Add CiTrace recording support.
This is exposed in the GUI as a new "CiTrace Recording" widget.

Playback is implemented by a standalone 3DS homebrew application (which only runs reliably within Citra currently; on an actual 3DS it will often crash still).
2015-07-13 22:27:20 +02:00
Emmanuel Gil Peyrot f48b28ad27 Core, VideoCore: Replace or fix exit() calls. 2015-06-28 00:36:55 +01:00
Emmanuel Gil Peyrot 94fc644430 VideoCore: Log the GL driver’s vendor and renderer. 2015-06-16 00:02:23 +01:00
tfarley 5025b35563 Liberal texture unbind (clout menu) 2015-06-08 19:18:19 -04:00
Emmanuel Gil Peyrot b1503b2020 Remove every trailing whitespace from the project (but externals). 2015-05-29 21:59:29 +01:00
tfarley 05dc633a8c OpenGL renderer 2015-05-22 15:51:18 -07:00
Yuri Kunde Schlesner 7ada357b2d Memmap: Re-organize memory function in two files
memory.cpp/h contains definitions related to acessing memory and
configuring the address space
mem_map.cpp/h contains higher-level definitions related to configuring
the address space accoording to the kernel and allocating memory.
2015-05-15 00:04:38 -03:00
Yuri Kunde Schlesner 17a8cae003 Memory: Add GetPhysicalPointer helper function 2015-05-09 04:02:32 -03:00
Yuri Kunde Schlesner e1fbac3ca1 Common: Remove common.h 2015-05-07 15:45:22 -03:00
archshift cae89fb315 Allow the user to set the background clear color during emulation
The background color can be seen at the sides of the bottom screen or when the window is wider than normal.
2015-04-03 15:35:51 -07:00
bunnei b56829df02 Merge pull request #629 from archshift/lcdfb
Implement SetLcdForceBlack and add implementation for color filling in the GPU code
2015-03-10 18:08:55 -04:00
archshift 041e99b613 Added LCD registers, and implementation for color filling in OGL code. 2015-03-09 15:51:41 -07:00
bunnei 06bf471581 Merge pull request #636 from bunnei/refactor-screen-win
Set framebuffer layout from EmuWindow.
2015-03-07 18:18:40 -05:00
bunnei 9960c49c21 Set framebuffer layout from EmuWindow. 2015-03-07 17:21:19 -05:00
Yuri Kunde Schlesner cd1fbfcf1b Add profiling infrastructure and widget 2015-03-01 21:47:13 -03:00
Emmanuel Gil Peyrot c439b3074d video_core: Implement the remaining framebuffer formats in the OpenGL renderer. 2015-02-15 14:08:12 +00:00
archshift ef24e72b26 Asserts: break/crash program, fit to style guide; log.h->assert.h
Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time)
As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing)

Also removed some GEKKO cruft.
2015-02-10 18:30:31 -08:00
Yuri Kunde Schlesner 5961a2852d GSP: Update framebuffer info on all interrupts
Hardware testing determined that the GSP processes shared memory
framebuffer update info even when no memory transfer or filling GX
commands are used. They are now updated on every interrupt, which isn't
confirmed correct but matches hardware behaviour more closely.

This also reverts the hack introduced in #404. It made a few games
behave better, but I believe it's incorrect and also breaks other games.
2015-01-14 05:20:12 -02:00
bunnei f7a3f45f1e GSP: Toggle active framebuffer each frame 2015-01-07 18:06:00 -05:00
bunnei 0de6a08d75 Merge pull request #291 from purpasmart96/license
License change
2014-12-21 16:05:44 -05:00
purpasmart96 ebfd831ccb License change 2014-12-20 21:20:24 -08:00
Chin e795692614 Clean up some warnings 2014-12-20 10:03:36 -05:00
Yuri Kunde Schlesner 0600e2d8b5 Convert old logging calls to new logging macros 2014-12-13 02:08:02 -02:00
bunnei 63b1453dd8 Merge pull request #236 from rohit-n/sign-compare
Silence a few -Wsign-compare warnings.
2014-12-03 10:04:47 -05:00
Rohit Nirmal f9b53c3e94 Silence a few -Wsign-compare warnings. 2014-11-30 22:29:23 -06:00
vaguilar 95b33ee0a7 Fixed viewport error caused by rounding 2014-11-30 09:53:50 -08:00
Emmanuel Gil Peyrot 739bb58c3a Remove tabs in all files except in skyeye imports and in generated GL code 2014-11-19 09:04:03 +00:00
Tony Wasserka c5c6e095f0 OpenGL Renderer: Cleanup viewport extent calculation. 2014-11-18 13:09:01 +01:00
Tony Wasserka bd8f491e4c Fixup EmuWindow interface and implementations thereof. 2014-11-18 13:09:01 +01:00
Kevin Hartman 221a9b023d Viewport scaling and display density independence
The view is scaled to be as large as possible, without changing the aspect, within the bounds of the window.
On "retina" displays, or other displays where window units != pixels, the view should no longer draw incorrectly.
2014-11-18 13:06:05 +01:00
Yuri Kunde Schlesner 11642fd3a2 Rework OpenGL renderer.
The OpenGL renderer has been revised, with the following changes:
 - Initialization and rendering have been refactored to reduce the number of
   redundant objects used.
 - Framebuffer rotation is now done directly, using texture mapping.
 - Vertex coordinates are now given in pixels, and the projection matrix
   isn't hardcoded anymore.
2014-10-12 14:38:53 +02:00
Yuri Kunde Schlesner 5f598a5e2c OpenGL renderer: Shuffle initialization code around and rename functions. 2014-10-12 14:37:24 +02:00
bunnei 5481115e71 Merge pull request #97 from archshift/cleanup
Small, general code cleanup
2014-09-13 22:58:58 -04:00
archshift 8fe5f2e2fe Moved common_types::Rect from common to Common namespace 2014-09-08 15:43:36 -07:00
archshift 81baa477b5 renderer_opengl.cpp: improved alignment for readability 2014-09-07 12:09:02 -07:00
Yuri Kunde Schlesner 478289140d Replace GLEW with a glLoadGen loader.
This should fix the GL loading errors that occur in some drivers due to
the use of deprecated functions by GLEW. Side benefits are more accurate
auto-completion (deprecated function and symbols don't exist) and faster
pointer loading (less entrypoints to load). In addition it removes an
external library depency, simplifying the build system a bit and
eliminating one set of binary libraries for Windows.
2014-09-01 17:41:56 -03:00
Yuri Kunde Schlesner 9d172ab550 Downgrade GLSL version to 1.50 (compatible with GL 3.2) 2014-08-28 05:38:13 -03:00
bunnei 20d169e4a1 VideoCore: Fixes rendering issues on Qt and corrects framebuffer output size. 2014-08-26 17:34:52 -04:00
Kevin Hartman cbfd6b6e52 Rewrite of OpenGL renderer, including OS X support
Screen contents are now displayed using textured quads. This can be updated to expose an FBO once an OpenGL backend for when Pica rendering is being worked on. That FBO's texture can then be applied to the quads.

Previously, FBO blitting was used in order to display screen contents, which did not work on OS X. The new textured quad approach is less of a compatibility risk.
2014-08-25 20:56:59 -07:00
Tony Wasserka 7b6a7d7dfb Pica/GPU: Change hardware registers to use physical addresses rather than virtual ones.
This cleans up the mess that address reading/writing had become and makes the code a *lot* more sensible.
This adds a physical<->virtual address converter to mem_map.h. For further accuracy, we will want to properly extend this to support a wider range of address regions. For now, this makes simply homebrew applications work in a good manner though.
2014-08-12 13:32:56 +02:00
Tony Wasserka 9c781a6c76 Remove the fancy RegisterSet class introduced in 4c2bff61e.
While it was some nice and fancy template usage, it ultimately had many practical issues regarding length of involved expressions under regular usage as well as common code completion tools not being able to handle the structures.
Instead, we now use a more conventional approach which is a lot more clean to use.
2014-08-12 02:17:21 +02:00
Tony Wasserka 9fd2537e93 Use uniform formatting when printing hexadecimal numbers. 2014-07-23 00:44:31 +02:00
Tony Wasserka 246cb75584 RegisterSet: Simplify code by using structs for register definition instead of unions. 2014-07-23 00:33:08 +02:00
Tony Wasserka 75775e9ef4 GPU: Make use of RegisterSet. 2014-07-23 00:33:08 +02:00
Tony Wasserka c6fdeb7b23 Renderer: Fix component order in bottom framebuffer. 2014-07-23 00:33:08 +02:00
Tony Wasserka cb6f97b2eb Renderer: Respect the active_fb GPU register. 2014-07-23 00:33:08 +02:00
Tony Wasserka 9b96407e8e Renderer: Add a few TODOs. 2014-07-23 00:33:08 +02:00
Tony Wasserka 1dfa392824 Rename LCD to GPU. 2014-06-12 06:10:49 -04:00
archshift 5a8ed196e6 common_types: Changed BasicRect back to Rect, in the common namespace
Only Rect is in the namespace for now; the rest of common should be added in the future
2014-05-19 17:57:35 -07:00
archshift b8c8d0903e Merge remote-tracking branch 'upstream/master' into issue-7-fix 2014-05-16 23:21:03 -07:00
Sethpaien e1fcb2fdfb Update FlipFramebuffer
Less calculations + fix
2014-05-08 18:05:30 +02:00
archshift 948cfe6d37 Reverse debugging changes 2014-04-30 20:00:44 -07:00
archshift fb47258af7 TGA dumps work, courtesy of @bunnei 2014-04-30 18:34:49 -07:00
archshift ff48c8bed3 Rect to BasicRect
Somewhere along the line an OSX header had already taken the name Rect.
2014-04-27 22:21:46 -07:00
bunnei 1142ccba03 fixed renderer to use correct framebuffer location 2014-04-27 12:42:01 -04:00
bunnei 7a080551ac fixed GL context acquire (applies to Qt GUI only) 2014-04-21 22:00:32 -04:00
bunnei 70c2cce963 renamed hw_lcd module to just lcd 2014-04-17 23:48:23 -04:00