summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/renderer_opengl.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* video_core/opengl: Add FSR upscaling filter to the OpenGL rendererWollnashorn2023-01-261-0/+3
|
* video_core: Integrate SMAALiam2022-12-081-2/+13
| | | | | Co-authored-by: goldenx86 <goldenx86@users.noreply.github.com> Co-authored-by: BreadFish64 <breadfish64@users.noreply.github.com>
* chore: make yuzu REUSE compliantAndrea Pappacoda2022-07-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [REUSE] is a specification that aims at making file copyright information consistent, so that it can be both human and machine readable. It basically requires that all files have a header containing copyright and licensing information. When this isn't possible, like when dealing with binary assets, generated files or embedded third-party dependencies, it is permitted to insert copyright information in the `.reuse/dep5` file. Oh, and it also requires that all the licenses used in the project are present in the `LICENSES` folder, that's why the diff is so huge. This can be done automatically with `reuse download --all`. The `reuse` tool also contains a handy subcommand that analyzes the project and tells whether or not the project is (still) compliant, `reuse lint`. Following REUSE has a few advantages over the current approach: - Copyright information is easy to access for users / downstream - Files like `dist/license.md` do not need to exist anymore, as `.reuse/dep5` is used instead - `reuse lint` makes it easy to ensure that copyright information of files like binary assets / images is always accurate and up to date To add copyright information of files that didn't have it I looked up who committed what and when, for each file. As yuzu contributors do not have to sign a CLA or similar I couldn't assume that copyright ownership was of the "yuzu Emulator Project", so I used the name and/or email of the commit author instead. [REUSE]: https://reuse.software Follow-up to 01cf05bc75b1e47beb08937439f3ed9339e7b254
* OpenGL: fix croppingLiam2022-04-041-0/+2
|
* hle: nvflinger: Migrate android namespace -> Service::android.bunnei2022-03-251-2/+2
|
* hle: nvflinger: Move PixelFormat to its own header.bunnei2022-03-251-2/+2
|
* video_core: Reduce unused includesameerj2022-03-191-0/+2
|
* OpenGL: fix FXAA with scalingMarshall Mohror2021-11-161-0/+1
|
* OpenGL: Implement FXAAMarshall Mohror2021-11-161-0/+4
|
* VideoCore: Add gaussian filtering.FernandoS272021-11-161-0/+1
|
* Presentation: add Nearest Neighbor filter.Fernando Sahmkow2021-11-161-0/+1
|
* Renderer: Implement Bicubic and ScaleForce filters.Fernando Sahmkow2021-11-161-1/+3
|
* renderer_opengl: Use ARB_separate_shader_objectsReinUsesLisp2021-07-231-1/+2
| | | | | Ensures that states set for a particular stage are not attached to other stages which may not need them.
* shader: Initial OpenGL implementationReinUsesLisp2021-07-231-4/+1
|
* video_core: Add GPU vendor name to window title barameerj2021-06-211-0/+4
|
* renderer_opengl: Remove interopReinUsesLisp2021-02-131-3/+0
| | | | Remove unused interop code from the OpenGL backend.
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-131-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reimplement the buffer cache using cached bindings and page level granularity for modification tracking. This also drops the usage of shared pointers and virtual functions from the cache. - Bindings are cached, allowing to skip work when the game changes few bits between draws. - OpenGL Assembly shaders no longer copy when a region has been modified from the GPU to emulate constant buffers, instead GL_EXT_memory_object is used to alias sub-buffers within the same allocation. - OpenGL Assembly shaders stream constant buffer data using glProgramBufferParametersIuivNV, from NV_parameter_buffer_object. In theory this should save one hash table resolve inside the driver compared to glBufferSubData. - A new OpenGL stream buffer is implemented based on fences for drivers that are not Nvidia's proprietary, due to their low performance on partial glBufferSubData calls synchronized with 3D rendering (that some games use a lot). - Most optimizations are shared between APIs now, allowing Vulkan to cache more bindings than before, skipping unnecesarry work. This commit adds the necessary infrastructure to use Vulkan object from OpenGL. Overall, it improves performance and fixes some bugs present on the old cache. There are still some edge cases hit by some games that harm performance on some vendors, this are planned to be fixed in later commits.
* gpu: Report renderer errors with exceptionsReinUsesLisp2021-02-131-4/+7
| | | | | | Instead of using a two step initialization to report errors, initialize the GPU renderer and rasterizer on the constructor and report errors through std::runtime_error.
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-0/+1
| | | | | | | | | | | | | | The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage.The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage. This commit aims to address those issues.
* video_core: Resolve more variable shadowing scenarios pt.3Lioncash2020-12-051-4/+4
| | | | | Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
* renderer_opengl: Remove emulated mailbox presentationReinUsesLisp2020-09-201-16/+0
| | | | | Emulated mailbox presentation was causing performance issues on Nvidia's OpenGL driver. Remove it.
* video_core: Remove all Core::System references in rendererReinUsesLisp2020-09-061-5/+16
| | | | | | | | | Now that the GPU is initialized when video backends are initialized, it's no longer needed to query components once the game is running: it can be done when yuzu is booting. This allows us to pass components between constructors and in the process remove all Core::System references in the video backend.
* video_core: Initialize renderer with a GPUReinUsesLisp2020-08-221-5/+6
| | | | | Add an extra step in GPU initialization to be able to initialize render backends with a valid GPU instance.
* gl_rasterizer: Use NV_vertex_buffer_unified_memory for vertex buffer robustnessReinUsesLisp2020-06-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch games are allowed to bind less data than what they use in a vertex buffer, the expected behavior here is that these values are read as zero. At the moment of writing this only D3D12, OpenGL and NVN through NV_vertex_buffer_unified_memory support vertex buffer with a size limit. In theory this could be emulated on Vulkan creating a new VkBuffer for each (handle, offset, length) tuple and binding the expected data to it. This is likely going to be slow and memory expensive when used on the vertex buffer and we have to do it on all draws because we can't know without analyzing indices when a game is going to read vertex data out of bounds. This is not a problem on OpenGL's BufferAddressRangeNV because it takes a length parameter, unlike Vulkan's CmdBindVertexBuffers that only takes buffers and offsets (the length is implicit in VkBuffer). It isn't a problem on D3D12 either, because D3D12_VERTEX_BUFFER_VIEW on IASetVertexBuffers takes SizeInBytes as a parameter (although I am not familiar with robustness on D3D12). Currently this only implements buffer ranges for vertex buffers, although indices can also be affected. A KHR_robustness profile is not created, but Nvidia's driver reads out of bound vertex data as zero anyway, this might have to be changed in the future. - Fixes SMO random triangles when capturing an enemy, getting hit, or looking at the environment on certain maps.
* renderer_opengl: Add assembly program code pathsReinUsesLisp2020-05-191-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code required to use OpenGL assembly programs based on NV_gpu_program5. Decompilation for ARB programs is intended to be added in a follow up commit. This does **not** include ARB decompilation and it's not in an usable state. The intention behind assembly programs is to reduce shader stutter significantly on drivers supporting NV_gpu_program5 (and other required extensions). Currently only Nvidia's proprietary driver supports these extensions. Add a UI option hidden for now to avoid people enabling this option accidentally. This code path has some limitations that OpenGL compatibility doesn't have: - NV_shader_storage_buffer_object is limited to 16 entries for a single OpenGL context state (I don't know if this is an intended limitation, an specification issue or I am missing something). Currently causes issues on The Legend of Zelda: Link's Awakening. - NV_parameter_buffer_object can't bind buffers using an offset different to zero. The used workaround is to copy to a temporary buffer (this doesn't happen often so it's not an issue). On the other hand, it has the following advantages: - Shaders build a lot faster. - We have control over how floating point rounding is done over individual instructions (SPIR-V on Vulkan can't do this). - Operations on shared memory can be unsigned and signed. - Transform feedbacks are dynamic state (not yet implemented). - Parameter buffers (uniform buffers) are per stage, matching NVN and hardware's behavior. - The API to bind and create assembly programs makes sense, unlike ARB_separate_shader_objects.
* Frontend/GPU: Refactor context managementJames Rowe2020-03-251-2/+8
| | | | | | | | | | | | | | | | | | | | 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
* renderer_opengl: Reintroduce dirty flags for render targetsReinUsesLisp2020-02-281-0/+3
|
* gl_state: Remove completelyReinUsesLisp2020-02-281-3/+0
|
* gl_state: Remove program trackingReinUsesLisp2020-02-281-1/+6
|
* gl_state: Remove viewport and depth range trackingReinUsesLisp2020-02-281-2/+0
|
* gl_state: Remove VAO cache and trackingReinUsesLisp2020-02-281-1/+0
|
* renderer_opengl: Fix SRGB presentation frame tracking.bunnei2020-02-281-3/+0
| | | | - Fixes SRGB in Super Smash Bros. Ultimate.
* renderer_opengl: Move Frame/FrameMailbox to OpenGL namespace.bunnei2020-02-271-0/+5
|
* renderer_opengl: Add texture mailbox support for presenter thread.bunnei2020-02-261-10/+14
|
* renderer_opengl: Use explicit binding for presentation shadersReinUsesLisp2019-11-291-8/+0
|
* renderer_opengl: Move commentaries to header fileReinUsesLisp2019-11-291-2/+12
|
* renderer_opengl: Fix sRGB blitsReinUsesLisp2019-09-111-1/+2
| | | | | | | | | Removes the sRGB hack of tracking if a frame used an sRGB rendertarget to apply at least once to blit the final texture as sRGB. Instead of doing this apply sRGB if the presented image has sRGB. Also enable sRGB by default on Maxwell3D registers as some games seem to assume this.
* gpu: Change optional<reference_wrapper<T>> to T* for FramebufferConfigReinUsesLisp2019-08-211-3/+2
|
* gl_shader_cache: Use shared contexts to build shaders in parallelReinUsesLisp2019-05-211-1/+2
|
* video_core/renderer_opengl: Replace direct usage of global system object accessorsLioncash2019-03-041-0/+1
| | | | | We already pass a reference to the system object to the constructor of the renderer, so we can just use that instead of using the global accessor functions.
* common/math_util: Move contents into the Common namespaceLioncash2019-02-271-2/+2
| | | | | These types are within the common library, so they should be within the Common namespace.
* gl_shader_disk_cache: Pass core system as argument and guard against games without title idsReinUsesLisp2019-02-071-1/+7
|
* frontend: Refactor ScopeAcquireWindowContext out of renderer_opengl.bunnei2019-01-241-10/+0
|
* renderer_opengl: Correct forward declaration of FramebufferLayoutLioncash2018-12-261-1/+1
| | | | | This is actually a struct, not a class, which can lead to compilation warnings.
* yuzu, video_core: Screenshot functionalityzhupengfei2018-12-181-1/+8
| | | | 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.
* global: Use std::optional instead of boost::optional (#1578)Frederic L2018-10-301-1/+2
| | | | | | | | | | | | | | | | * get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build
* renderer_opengl: Namespace OpenGL codeLioncash2018-08-221-0/+4
| | | | | | | Namespaces all OpenGL code under the OpenGL namespace. Prevents polluting the global namespace and allows clear distinction between other renderers' code in the future.
* rasterizer_interface: Remove ScreenInfo from AccelerateDraw()'s signatureLioncash2018-08-211-1/+1
| | | | | | This is an OpenGL renderer-specific data type. Given that, this type shouldn't be used within the base interface for the rasterizer. Instead, we can pass this information to the rasterizer via reference.
* renderer_base: Make creation of the rasterizer, the responsibility of the renderers themselvesLioncash2018-08-211-0/+2
| | | | | | | | | | | | | | | | | | | Given we use a base-class type within the renderer for the rasterizer (RasterizerInterface), we want to allow renderers to perform more complex initialization if they need to do such a thing. This makes it important to reserve type information. Given the OpenGL renderer is quite simple settings-wise, this is just a simple shuffling of the initialization code. For something like Vulkan however this might involve doing something like: // Initialize and call rasterizer-specific function that requires // the full type of the instance created. auto raster = std::make_unique<VulkanRasterizer>(some, params); raster->CallSomeVulkanRasterizerSpecificFunction(); // Assign to base class variable rasterizer = std::move(raster)
* core: Namespace EmuWindowLioncash2018-08-121-3/+5
| | | | Gets the class out of the global namespace.
* video_core: Eliminate the g_renderer global variableLioncash2018-08-041-1/+1
| | | | | | | | | | | | | | We move the initialization of the renderer to the core class, while keeping the creation of it and any other specifics in video_core. This way we can ensure that the renderer is initialized and doesn't give unfettered access to the renderer. This also makes dependencies on types more explicit. For example, the GPU class doesn't need to depend on the existence of a renderer, it only needs to care about whether or not it has a rasterizer, but since it was accessing the global variable, it was also making the renderer a part of its dependency chain. By adjusting the interface, we can get rid of this dependency.
* video_core: Make global EmuWindow instance part of the base renderer classLioncash2018-08-021-10/+5
| | | | | | | | | | | 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.
* vi: Partially implement buffer crop parameters.bunnei2018-07-181-0/+1
|
* OpenGL: Use MakeCurrent/DoneCurrent for multithreaded rendering.bunnei2018-07-141-0/+7
|
* gl_rasterizer: Implement AccelerateDisplay to forward textures to framebuffers.bunnei2018-06-271-1/+1
|
* renderer_opengl: Use OGLProgram instead of OGLShader.bunnei2018-04-141-1/+1
|
* renderer_opengl.h: Update from citra to yuzuN00byKing2018-04-041-2/+2
|
* renderer_opengl: Use better naming for DrawScreens and DrawSingleScreen.bunnei2018-03-271-2/+2
|
* renderer_opengl: Add framebuffer_transform_flags member variable.bunnei2018-03-231-2/+2
|
* video_core: Move FramebufferInfo to FramebufferConfig in GPU.bunnei2018-03-231-4/+5
|
* renderer_opengl: Support framebuffer flip vertical.bunnei2018-02-121-0/+3
|
* clang-formatMerryMage2018-01-161-1/+2
|
* renderer_gl: Clear screen to black before rendering framebuffer.bunnei2018-01-151-2/+2
|
* renderer: Render previous frame when no new one is available.bunnei2018-01-151-5/+3
|
* Remove references to PICA and rasterizers in video_coreJames Rowe2018-01-131-1/+0
|
* renderer_opengl: Support rendering Switch framebuffer.bunnei2018-01-111-7/+10
|
* renderer_opengl: Update DrawScreens for Switch.bunnei2018-01-111-1/+1
|
* OpenGL: Remove unused RendererOpenGL fieldsYuri Kunde Schlesner2017-05-281-3/+0
|
* Remove empty newlines in #include blocks.Emmanuel Gil Peyrot2016-09-211-4/+0
| | | | | | | This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
* Manually tweak source formatting and then re-run clang-formatYuri Kunde Schlesner2016-09-191-2/+5
|
* Sources: Run clang-format on everything.Emmanuel Gil Peyrot2016-09-181-8/+7
|
* VideoCore: Run include-what-you-use and fix most includes.Emmanuel Gil Peyrot2016-04-301-0/+3
|
* HWRasterizer: Texture forwardingtfarley2016-04-211-18/+26
|
* Improve error report from Init() functionsLittleWhite2016-03-081-1/+1
| | | | Add error popup when citra initialization failed
* fix some xcode 7.0 warningsMartin Lindhe2015-09-291-1/+0
|
* video_core: Remove unnecessary includes from headersLioncash2015-09-111-3/+0
|
* renderer_opengl: Remove unimplemented function declarationLioncash2015-09-101-3/+0
|
* Replace the previous OpenGL loader with a glad-generated 3.3 oneYuri Kunde Schlesner2015-08-301-1/+1
| | | | | | 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.
* OpenGL renderertfarley2015-05-231-6/+10
|
* Added LCD registers, and implementation for color filling in OGL code.archshift2015-03-091-1/+4
|
* video_core: Implement the remaining framebuffer formats in the OpenGL renderer.Emmanuel Gil Peyrot2015-02-151-0/+5
|
* License changepurpasmart962014-12-211-1/+1
|
* OpenGL Renderer: Cleanup viewport extent calculation.Tony Wasserka2014-11-181-17/+7
|
* Viewport scaling and display density independenceKevin Hartman2014-11-181-0/+15
| | | | | 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.
* Add `override` keyword through the code.Yuri Kunde Schlesner2014-10-261-4/+4
| | | | This was automated using `clang-modernize`.
* Rework OpenGL renderer.Yuri Kunde Schlesner2014-10-121-46/+22
| | | | | | | | | 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.
* OpenGL renderer: Shuffle initialization code around and rename functions.Yuri Kunde Schlesner2014-10-121-8/+2
|
* Remove virtual inheritance from RendererOpenGLYuri Kunde Schlesner2014-10-121-2/+2
| | | | Also make destructor virtual so that instances are properly destructed.
* Moved common_types::Rect from common to Common namespacearchshift2014-09-091-1/+1
|
* Replace GLEW with a glLoadGen loader.Yuri Kunde Schlesner2014-09-011-1/+1
| | | | | | | | | 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.
* Downgrade GLSL version to 1.50 (compatible with GL 3.2)Yuri Kunde Schlesner2014-08-281-0/+3
|
* VideoCore: Fixes rendering issues on Qt and corrects framebuffer output size.bunnei2014-08-261-0/+1
|
* Rewrite of OpenGL renderer, including OS X supportKevin Hartman2014-08-261-27/+36
| | | | | | 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.
* Renderer: Fix component order in bottom framebuffer.Tony Wasserka2014-07-231-4/+3
|
* common_types: Changed BasicRect back to Rect, in the common namespacearchshift2014-05-201-1/+1
| | | | Only Rect is in the namespace for now; the rest of common should be added in the future
* Xcode complains that the class name is redundant.archshift2014-04-281-1/+1
|
* Rect to BasicRectarchshift2014-04-281-1/+1
| | | | Somewhere along the line an OSX header had already taken the name Rect.
* removed DISALLOW_COPY_AND_ASSIGN in favor of NonCopyable classbunnei2014-04-281-1/+0
|
* fixed renderer to use correct framebuffer locationbunnei2014-04-271-2/+2
|
* fixed project includes to use new directory structurebunnei2014-04-091-3/+3
|
* got rid of 'src' folders in each sub-projectbunnei2014-04-091-0/+91