Commit graph

65 commits

Author SHA1 Message Date
GPUCode 88ea66053e
Miscallenious fixes to gl backend and qt frontend (#6834)
* renderer_gl: Make rasterizer normal class member

* It doesn't need to be heap allocated anymore

* gl_rasterizer: Remove default_texture

* It's unused

* gl_rasterizer: General cleanup

* gl_rasterizer: Lower case lambdas

* Match style with review comments from vulkan backend

* rasterizer_cache: Prevent memory leak

* Since the switch from shared_ptr these surfaces were no longer being destroyed properly. Use our garbage collector for that purpose to destroy it safely for both backends

* rasterizer_cache: Make temp copy of old surface

* The custom surface would override the memory region of the old region resulting in garbage data, this ensures the custom surface is constructed correctly

* citra_qt: Manually create dialog tabs

* Allows for custom constructors which is very useful. While at it, global state is now eliminated from configuration

* citra_qt: Eliminate global system usage

* core: Remove global system usage in memory and HIO

* citra_qt: Use qOverload

* tests: Run clang format

* gl_texture_runtime: Fix surface scaling
2023-08-02 01:40:39 +03:00
GPUCode a955f02771
rasterizer_cache: Remove runtime allocation caching (#6705)
* rasterizer_cache: Sentence surfaces

* gl_texture_runtime: Remove runtime side allocation cache

* rasterizer_cache: Adjust surface scale during reinterpreration

* Fixes pixelated outlines. Also allows to remove the d24s8 specific hack and is more generic in general

* rasterizer_cache: Remove Expand flag

* Begone!

* rasterizer_cache: Cache framebuffers with surface id

* rasterizer_cache: Sentence texture cubes

* renderer_opengl: Move texture mailbox to separate file

* Makes renderer_opengl cleaner overall and allows to report removal threshold from runtime instead of hardcoding. Vulkan requires this

* rasterizer_cache: Dont flush cache on layout change

* rasterizer_cache: Overhaul framebuffer management

* video_core: Remove duplicate

* rasterizer_cache: Sentence custom surfaces

* Vulkan cannot destroy images immediately so this ensures we use our garbage collector for that purpose
2023-08-01 03:35:41 +03:00
SachinVin ce553ab995
renderer_opengl: DrawSingleScreen*: remove duplicate code (#6426)
Co-authored-by: Tobias <thm.frey@gmail.com>
2023-05-01 16:27:42 +02:00
GPUCode 06f3c90cfb
Custom textures rewrite (#6452)
* common: Add thread pool from yuzu

* Is really useful for asynchronous operations like shader compilation and custom textures, will be used in following PRs

* core: Improve ImageInterface

* Provide a default implementation so frontends don't have to duplicate code registering the lodepng version

* Add a dds version too which we will use in the next commit

* rasterizer_cache: Rewrite custom textures

* There's just too much to talk about here, look at the PR description for more details

* rasterizer_cache: Implement basic pack configuration file

* custom_tex_manager: Flip dumped textures

* custom_tex_manager: Optimize custom texture hashing

* If no convertions are needed then we can hash the decoded data directly removing the needed for duplicate decode

* custom_tex_manager: Implement asynchronous texture loading

* The file loading and decoding is offloaded into worker threads, while the upload itself still occurs in the main thread to avoid having to manage shared contexts

* Address review comments

* custom_tex_manager: Introduce custom material support

* video_core: Move custom textures to separate directory

* Also split the files to make the code cleaner

* gl_texture_runtime: Generate mipmaps for material

* custom_tex_manager: Prevent memory overflow when preloading

* externals: Add dds-ktx as submodule

* string_util: Return vector from SplitString

* No code benefits from passing it as an argument

* custom_textures: Use json config file

* gl_rasterizer: Only bind material for unit 0

* Address review comments
2023-04-27 07:38:28 +03:00
SachinVin 0da25736d9
renderer_opengl.cpp: Draw{Top, Bottom}Screen Clean up (#6422) 2023-04-16 19:51:21 +02:00
GPUCode b5d6f645bd
Prepare frontend for multiple graphics APIs (#6347)
* externals: Update dynarmic

* settings: Introduce GraphicsAPI enum

* For now it's OpenGL only but will be expanded upon later

* citra_qt: Introduce backend agnostic context management

* Mostly a direct port from yuzu

* core: Simplify context acquire

* settings: Add option to create debug contexts

* renderer_opengl: Abstract initialization to Driver

* This commit also updates glad and adds some useful extensions which we will use in part 2

* Rasterizer construction is moved to the specific renderer instead of RendererBase.
  Software rendering has been disable to achieve this but will be brought back in the next commit.

* video_core: Remove Init/Shutdown methods from renderer

* The constructor and destructor can do the same job

* In addition move opengl function loading to Qt since SDL already does this. Also remove ErrorVideoCore which is never reached

* citra_qt: Decouple software renderer from opengl part 1

* citra: Decouple software renderer from opengl part 2

* android: Decouple software renderer from opengl part 3

* swrasterizer: Decouple software renderer from opengl part 4

* This commit simply enforces the renderer naming conventions in the software renderer

* video_core: Move RendererBase to VideoCore

* video_core: De-globalize screenshot state

* video_core: Pass system to the renderers

* video_core: Commonize shader uniform data

* video_core: Abstract backend agnostic rasterizer operations

* bootmanager: Remove references to OpenGL for macOS

OpenGL macOS headers definitions clash heavily with each other

* citra_qt: Proper title for api settings

* video_core: Reduce boost usage

* bootmanager: Fix hide mouse option

Remove event handlers from RenderWidget for events that are
already handled by the parent GRenderWindow.
Also enable mouse tracking on the RenderWidget.

* android: Remove software from graphics api list

* code: Address review comments

* citra: Port per-game settings read

* Having to update the default value for all backends is a pain so lets centralize it

* android: Rename to OpenGLES

---------

Co-authored-by: MerryMage <MerryMage@users.noreply.github.com>
Co-authored-by: Vitor Kiguchi <vitor-kiguchi@hotmail.com>
2023-03-27 14:29:17 +03:00
SomeDudeOnDiscord d8c9335ef0
Resolve Black Screen on Intel GPU Regression (#6306)
* Get value for swap screen setting and check mono_render_option again

* resolve clang-format issue

* do not disable opengl blending since it is enabled by default

* reset blending state to default values after drawing second screen

* prevent resetting state blending when custom opacity is not used
2023-02-18 18:54:12 +02:00
SomeDudeOnDiscord a8e4e11cd5
Better Support for Picture-in-Picture Custom Layouts (Based on #6127) (#6247) 2023-02-14 22:06:11 +01:00
Ameer J f44c95d638
Add "Separate Windows" LayoutOption (#6177) 2022-11-17 16:37:30 +01:00
emufan4568 2726fe66db renderer_opengl: Header cleanup
* Should help with building times
2022-08-21 02:22:57 +03:00
zhupengfei 06a0d86e9c
video_core, core: Move pixel download to its own thread
This uses the mailbox model to move pixel downloading to its own thread, eliminating Nvidia's warnings and (possibly) making use of GPU copy engine.

To achieve this, we created a new mailbox type that is different from the presentation mailbox in that it never discards a rendered frame.

Also, I tweaked the projection matrix thing so that it can just draw the frame upside down instead of having the CPU flip it.
2020-02-27 16:55:08 +08:00
vitor-k 89cab445d4 Implementation of screen rotation without use of additional layouts.
This is based on what was done using additional layouts, but modified
to have a variable to control rotation and making it so Single Screen
Layout behaves like Upright Single would, and Default Layout behaves
like Upright Double would, when the new variable is used.

Large Layout and Side Layout currently ignore the new variable.
New variable still currently doesn't have a hotkey.
2020-01-20 22:31:51 -03:00
James Rowe e74a402c69
Merge pull request #4923 from jroweboy/diskcachelul
Disk Shader Caching
2020-01-17 18:15:50 -07:00
iwubcode 43f8aadd52 renderer_opengl: Allow usage of interlaced 3D 2020-01-16 22:12:50 -06:00
James Rowe 4e9ec4efd0 Add shader disk caching 2020-01-15 19:58:33 -07:00
James Rowe 65613cce81 Add microprofile scopes for presentation 2019-12-02 18:59:12 -07:00
James Rowe 26d828fb4c Prevent softlock on shutdown and various cleanup 2019-11-09 13:12:29 -07:00
James Rowe 52d7676831 recreate mailbox to use a queue instead 2019-11-09 13:12:29 -07:00
James Rowe ac90cd0378 Change Present to finish only after swap 2019-11-09 13:12:29 -07:00
James Rowe 27d0fc64d0 Add texture mailbox support to opengl renderer. 2019-11-09 13:10:17 -07:00
zhupengfei 0224ae13c4
video_core: Implement frame dumping
Two PBOs are used to speed up pixel copying process. To avoid getting the wrong speed/FPS, a new parameter is added to DrawScreens about whether to increase the frame count.
2019-08-13 19:28:04 +08:00
xperia64 8131bd32e3 renderer_opengl: Add support for custom shaders (#4578)
* Add Anaglyph 3D

Change 3D slider in-game

Change shaders while game is running

Move shader loading into function

Disable 3D slider setting when stereoscopy is off

The rest of the shaders

Address review issues

Documentation and minor fixups

Forgot clang-format

Fix shader release on SDL2-software rendering

Remove unnecessary state changes

Respect 3D factor setting regardless of stereoscopic rendering

Improve shader resolution passing

Minor setting-related improvements

Add option to toggle texture filtering

Rebase fixes

* One final clang-format

* Fix OpenGL problems
2019-08-09 20:00:47 +02:00
Lioncash 6e22891761 core: Namespace EmuWindow
Gets the class out of the global namespace.
2019-04-21 14:16:16 +02:00
Lioncash e1a4912ade common/math_util: Move contents into the Common namespace
These types are within the common library, so they should be within the
Common namespace.
2019-03-02 18:13:10 +01:00
Lioncash d2aac218a6 renderer_opengl: Correct forward declaration of FramebufferLayout
This is actually a struct, not a class, which can lead to compilation
warnings.
2018-12-27 02:48:05 +01:00
zhupengfei 071b41cb61
citra_qt, 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-11-30 14:14:41 +08:00
Tobias 46e8237e7e Port yuzu-emu/yuzu#1137: "renderer_opengl: Namespace OpenGL code" (#4423)
* renderer_opengl: Namespace OpenGL code

Namespaces all OpenGL code under the OpenGL namespace.

Prevents polluting the global namespace and allows clear distinction
between other renderers' code in the future.

* Also namespace TextureCubeConfig
2018-11-16 23:29:10 -08: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
N00byKing 2814bbc3da renderer_opengl: Allow usage of Stereoscopic 3D 2018-06-01 17:01:06 +02:00
wwylele 48869c768f gl_resource_manager: separate OGLShader and OGLProgram 2018-04-11 14:41:43 +03:00
Yuri Kunde Schlesner 6665557ff7 OpenGL: Remove unused RendererOpenGL fields 2017-05-27 18:02:46 -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
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
Martin Lindhe bafb7afba2 fix some xcode 7.0 warnings 2015-09-29 23:11:09 +02:00
Lioncash 1fa772393b video_core: Remove unnecessary includes from headers 2015-09-11 00:10:03 -04:00
Lioncash 8a3428f16c renderer_opengl: Remove unimplemented function declaration 2015-09-10 10:45:44 -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
tfarley 05dc633a8c OpenGL renderer 2015-05-22 15:51:18 -07:00
archshift 041e99b613 Added LCD registers, and implementation for color filling in OGL code. 2015-03-09 15:51:41 -07:00
Emmanuel Gil Peyrot c439b3074d video_core: Implement the remaining framebuffer formats in the OpenGL renderer. 2015-02-15 14:08:12 +00:00
purpasmart96 ebfd831ccb License change 2014-12-20 21:20:24 -08:00
Tony Wasserka c5c6e095f0 OpenGL Renderer: Cleanup viewport extent calculation. 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 d72708c1f5 Add override keyword through the code.
This was automated using `clang-modernize`.
2014-10-26 16:18:05 -02: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