aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/renderer_opengl.h
AgeCommit message (Collapse)Author
2024-02-09nvnflinger/gpu: implement applet captureLiam
2024-01-31nvnflinger/gpu: implement layer stack compositionLiam
2024-01-31renderer_opengl: implement layer stack compositionLiam
2024-01-31renderer_opengl: split out SMAALiam
2024-01-31renderer_opengl: isolate core presentation codeLiam
2024-01-31video_core: consistently account for resolution scaling when renderingLiam
2024-01-31video_core: simplify accelerated surface fetch and crop handling between APIsLiam
2024-01-18SMMU: Initial adaptation to video_core.Fernando Sahmkow
2023-12-03renderer_opengl: remove srgb conversion logicLiam
2023-01-26video_core/opengl: Add FSR upscaling filter to the OpenGL rendererWollnashorn
2022-12-08video_core: Integrate SMAALiam
Co-authored-by: goldenx86 <goldenx86@users.noreply.github.com> Co-authored-by: BreadFish64 <breadfish64@users.noreply.github.com>
2022-07-27chore: make yuzu REUSE compliantAndrea Pappacoda
[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
2022-04-04OpenGL: fix croppingLiam
2022-03-24hle: nvflinger: Migrate android namespace -> Service::android.bunnei
2022-03-24hle: nvflinger: Move PixelFormat to its own header.bunnei
2022-03-19video_core: Reduce unused includesameerj
2021-11-16OpenGL: fix FXAA with scalingMarshall Mohror
2021-11-16OpenGL: Implement FXAAMarshall Mohror
2021-11-16VideoCore: Add gaussian filtering.FernandoS27
2021-11-16Presentation: add Nearest Neighbor filter.Fernando Sahmkow
2021-11-16Renderer: Implement Bicubic and ScaleForce filters.Fernando Sahmkow
2021-07-22renderer_opengl: Use ARB_separate_shader_objectsReinUsesLisp
Ensures that states set for a particular stage are not attached to other stages which may not need them.
2021-07-22shader: Initial OpenGL implementationReinUsesLisp
2021-06-20video_core: Add GPU vendor name to window title barameerj
2021-02-13renderer_opengl: Remove interopReinUsesLisp
Remove unused interop code from the OpenGL backend.
2021-02-13video_core: Reimplement the buffer cacheReinUsesLisp
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.
2021-02-13gpu: Report renderer errors with exceptionsReinUsesLisp
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.
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp
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.
2020-12-05video_core: Resolve more variable shadowing scenarios pt.3Lioncash
Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
2020-09-20renderer_opengl: Remove emulated mailbox presentationReinUsesLisp
Emulated mailbox presentation was causing performance issues on Nvidia's OpenGL driver. Remove it.
2020-09-06video_core: Remove all Core::System references in rendererReinUsesLisp
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.
2020-08-22video_core: Initialize renderer with a GPUReinUsesLisp
Add an extra step in GPU initialization to be able to initialize render backends with a valid GPU instance.
2020-06-24gl_rasterizer: Use NV_vertex_buffer_unified_memory for vertex buffer robustnessReinUsesLisp
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.
2020-05-19renderer_opengl: Add assembly program code pathsReinUsesLisp
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.
2020-03-24Frontend/GPU: Refactor context managementJames Rowe
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-02-28renderer_opengl: Reintroduce dirty flags for render targetsReinUsesLisp
2020-02-28gl_state: Remove completelyReinUsesLisp
2020-02-28gl_state: Remove program trackingReinUsesLisp
2020-02-28gl_state: Remove viewport and depth range trackingReinUsesLisp
2020-02-28gl_state: Remove VAO cache and trackingReinUsesLisp
2020-02-28renderer_opengl: Fix SRGB presentation frame tracking.bunnei
- Fixes SRGB in Super Smash Bros. Ultimate.
2020-02-26renderer_opengl: Move Frame/FrameMailbox to OpenGL namespace.bunnei
2020-02-25renderer_opengl: Add texture mailbox support for presenter thread.bunnei
2019-11-28renderer_opengl: Use explicit binding for presentation shadersReinUsesLisp
2019-11-28renderer_opengl: Move commentaries to header fileReinUsesLisp
2019-09-10renderer_opengl: Fix sRGB blitsReinUsesLisp
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.
2019-08-21gpu: Change optional<reference_wrapper<T>> to T* for FramebufferConfigReinUsesLisp
2019-05-20gl_shader_cache: Use shared contexts to build shaders in parallelReinUsesLisp
2019-03-04video_core/renderer_opengl: Replace direct usage of global system object ↵Lioncash
accessors 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.
2019-02-27common/math_util: Move contents into the Common namespaceLioncash
These types are within the common library, so they should be within the Common namespace.