summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/renderer_opengl.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-04-04video_core/renderer_opengl: Remove unnecessary includesLioncash1-1/+0
Quite a few unused includes have built up over time, particularly on core/memory.h. Removing these includes means the source files including those files will no longer need to be rebuilt if they're changed, making compilation slightly faster in this scenario.
2019-03-27gl_rasterizer: Remove unused reference member variable from RasterizerOpenGLLioncash1-1/+1
This member variable is no longer being used, so it can be removed, removing a dependency on EmuWindow from the rasterizer's interface"
2019-03-16memory: Simplify rasterizer cache operations.bunnei1-2/+1
2019-03-13video_core/morton: Use enum to describe MortonCopyPixels128 modeReinUsesLisp1-3/+5
2019-03-04video_core/renderer_opengl: Replace direct usage of global system object accessorsLioncash1-11/+16
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-26renderer_opengl: Update pixel format trackingReinUsesLisp1-0/+1
2019-02-16core_timing: Convert core timing into a classLioncash1-1/+1
Gets rid of the largest set of mutable global state within the core. This also paves a way for eliminating usages of GetInstance() on the System class as a follow-up. Note that no behavioral changes have been made, and this simply extracts the functionality into a class. This also has the benefit of making dependencies on the core timing functionality explicit within the relevant interfaces.
2019-02-15renderer_opengl: respect the sRGB colorspace for the screenshot featurefearlessTobi1-1/+2
Previously, we were completely ignoring for screenshots whether the game uses RGB or sRGB. This resulted in screenshot colors that looked off for some titles.
2019-02-13renderer_opengl: Remove reference to global system instanceLioncash1-3/+3
We already store a reference to the system instance that the renderer is created with, so we don't need to refer to the system instance via Core::System::GetInstance()
2019-02-12core_timing: Rename CoreTiming namespace to Core::TimingLioncash1-1/+1
Places all of the timing-related functionality under the existing Core namespace to keep things consistent, rather than having the timing utilities sitting in its own completely separate namespace.
2019-02-07gl_shader_disk_cache: Pass core system as argument and guard against games without title idsReinUsesLisp1-3/+3
2019-01-30gl_rasterizer_cache: Move swizzling to textures instead of stateReinUsesLisp1-1/+0
2019-01-30gl_rasterizer: Use DSA for texturesReinUsesLisp1-49/+13
2019-01-24frontend: Refactor ScopeAcquireWindowContext out of renderer_opengl.bunnei1-14/+2
2019-01-06gl_rasterizer: Use DSA for vertex array objectsReinUsesLisp1-15/+14
2019-01-06gl_state: Drop uniform buffer state trackingReinUsesLisp1-1/+0
2018-12-19Fixed uninitialized memory due to missing returns in canaryDavid Marcec1-0/+2
Functions which are suppose to crash on non canary builds usually don't return anything which lead to uninitialized memory being used.
2018-12-18yuzu, video_core: Screenshot functionalityzhupengfei1-3/+38
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-25video_core: Move morton functions to their own fileReinUsesLisp1-1/+1
2018-11-21Removed pre 4.3 ARB extensionsFernandoS271-1/+1
2018-11-21Use default values for unknown framebuffer pixel formatFernandoS271-0/+6
2018-10-30global: Use std::optional instead of boost::optional (#1578)Frederic L1-5/+6
* 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
2018-10-28Implement sRGB Support, including workarounds for nvidia driver issues and QT sRGB supportRodolfo Bogado1-3/+11
2018-09-09Port Citra #4047 & #4052: add change background color supporttech4me1-0/+6
2018-09-08gl_state: Keep track of texture target.bunnei1-10/+10
2018-08-31core/core: Replace includes with forward declarations where applicableLioncash1-0/+2
The follow-up to e2457418dae19b889b2ad85255bb95d4cd0e4bff, which replaces most of the includes in the core header with forward declarations. This makes it so that if any of the headers the core header was previously including change, then no one will need to rebuild the bulk of the core, due to core.h being quite a prevalent inclusion. This should make turnaround for changes much faster for developers.
2018-08-31core: Make the main System class use the PImpl idiomLioncash1-3/+4
core.h is kind of a massive header in terms what it includes within itself. It includes VFS utilities, kernel headers, file_sys header, ARM-related headers, etc. This means that changing anything in the headers included by core.h essentially requires you to rebuild almost all of core. Instead, we can modify the System class to use the PImpl idiom, which allows us to move all of those headers to the cpp file and forward declare the bulk of the types that would otherwise be included, reducing compile times. This change specifically only performs the PImpl portion.
2018-08-22renderer_opengl: Namespace OpenGL codeLioncash1-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.
2018-08-21renderer_opengl: Use LOG_DEBUG for GL_DEBUG_SEVERITY_NOTIFICATION and GL_DEBUG_SEVERITY_LOW logsLioncash1-1/+1
LOG_TRACE is only enabled on debug builds which can be quite slow when trying to debug graphics issues. Instead we can log the messages to the debug log, which is available on both release and debug builds.
2018-08-21rasterizer_interface: Remove ScreenInfo from AccelerateDraw()'s signatureLioncash1-6/+4
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.
2018-08-21renderer_base: Make creation of the rasterizer, the responsibility of the renderers themselvesLioncash1-3/+10
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)
2018-08-17renderer_opengl: Treat OpenGL errors as critical.bunnei1-1/+1
2018-08-12core: Namespace EmuWindowLioncash1-3/+5
Gets the class out of the global namespace.
2018-08-08renderer_opengl: Use trace log in a few places.bunnei1-1/+1
2018-08-04renderer_base: Make Rasterizer() return the rasterizer by referenceLioncash1-2/+2
All calling code assumes that the rasterizer will be in a valid state, which is a totally fine assumption. The only way the rasterizer wouldn't be is if initialization is done incorrectly or fails, which is checked against in System::Init().
2018-08-04video_core: Eliminate the g_renderer global variableLioncash1-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.
2018-08-02video_core: Make global EmuWindow instance part of the base renderer classLioncash1-17/+9
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-07-18vi: Partially implement buffer crop parameters.bunnei1-4/+18
2018-07-14OpenGL: Use MakeCurrent/DoneCurrent for multithreaded rendering.bunnei1-1/+14
2018-07-03Update clang formatJames Rowe1-1/+1
2018-07-03Rename logging macro back to LOG_*James Rowe1-7/+7
2018-06-27gl_rasterizer: Implement AccelerateDisplay to forward textures to framebuffers.bunnei1-1/+0
2018-06-07GLState: Support changing the GL_TEXTURE_SWIZZLE parameter of each texture unit.Subv1-0/+1
2018-04-27renderer_opengl: Replace usages of LOG_GENERIC with fmt-capable equivalentsLioncash1-6/+7
2018-04-25video-core: Move logging macros over to new fmt-capable onesLioncash1-5/+5
2018-04-25renderer_opengl: Use correct byte order for framebuffer pixel format ABGR8.bunnei1-2/+1
2018-04-25gl_rasterizer_cache: Update to be based on GPU addresses, not CPU addresses.bunnei1-1/+2
2018-04-24renderer_opengl: Silence a -Wdangling-else warning in DrawScreenTriangles()Lioncash1-1/+2
2018-04-21opengl: Remove unnecessary header inclusionsLioncash1-3/+0
2018-04-14renderer_opengl: Fix Morton copy byteswap, etc.bunnei1-5/+5
2018-04-14renderer_opengl: Use OGLProgram instead of OGLShader.bunnei1-1/+1
2018-03-27renderer_opengl: Use better naming for DrawScreens and DrawSingleScreen.bunnei1-6/+6
2018-03-27renderer_opengl: Logging, etc. cleanup.bunnei1-2/+2
2018-03-27renderer_opengl: Remove framebuffer RasterizerFlushVirtualRegion hack.bunnei1-5/+0
2018-03-27renderer_opengl: Only draw the screen if a framebuffer is specified.bunnei1-6/+7
2018-03-23renderer_opengl: Only invalidate the framebuffer region, not flush.bunnei1-4/+3
2018-03-23renderer_opengl: Fixes for properly flushing & rendering the framebuffer.bunnei1-6/+12
2018-03-23renderer_opengl: Better handling of framebuffer transform flags.bunnei1-2/+16
2018-03-23renderer_opengl: Use accelerated framebuffer load with LoadFBToScreenInfo.bunnei1-31/+25
2018-03-23video_core: Move MortonCopyPixels128 to utils header.bunnei1-111/+1
2018-03-23video_core: Move FramebufferInfo to FramebufferConfig in GPU.bunnei1-26/+30
2018-03-20gl_shader_util: Sync latest version with Citra.bunnei1-1/+1
2018-02-12renderer_opengl: Support framebuffer flip vertical.bunnei1-5/+9
2018-01-27memory: Replace all memory hooking with Special regionsMerryMage1-1/+1
2018-01-15renderer_gl: Clear screen to black before rendering framebuffer.bunnei1-3/+6
2018-01-15renderer: Render previous frame when no new one is available.bunnei1-10/+13
2018-01-13Fix build on macOS and linuxMerryMage1-0/+1
2018-01-13Remove references to PICA and rasterizers in video_coreJames Rowe1-7/+0
2018-01-12renderer_opengl: Fix LOG_TRACE in LoadFBToScreenInfo.bunnei1-1/+1
2018-01-11renderer_opengl: Support rendering Switch framebuffer.bunnei1-129/+68
2018-01-11renderer_opengl: Add MortonCopyPixels function for Switch framebuffer.bunnei1-0/+111
2018-01-11renderer_opengl: Update DrawScreens for Switch.bunnei1-22/+10
2017-07-18telemetry: Log performance, configuration, and system data.bunnei1-3/+12
2017-05-28OpenGL: Remove unused RendererOpenGL fieldsYuri Kunde Schlesner1-8/+2
2017-02-27Core: Re-write frame limiterYuri Kunde Schlesner1-3/+3
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-27Core: Make PerfStats internally lockedYuri Kunde Schlesner1-8/+2
More ergonomic to use and will be required for upcoming changes.
2017-02-27Remove built-in (non-Microprofile) profilerYuri Kunde Schlesner1-8/+0
2017-02-27Add performance statistics to status barYuri Kunde Schlesner1-0/+9
2016-12-23core: Move emu_window and key_map into coreMerryMage1-1/+1
* Removes circular dependences (common should not depend on core)
2016-11-05Add default hotkey to swap primary screens.James Rowe1-3/+2
Also minor style changes
2016-11-05Support additional screen layouts.James Rowe1-6/+12
Allows users to choose a single screen layout or a large screen layout. Adds a configuration option to change the prominent screen.
2016-09-21Use negative priorities to avoid special-casing the self-includeYuri Kunde Schlesner1-1/+1
2016-09-21Remove empty newlines in #include blocks.Emmanuel Gil Peyrot1-5/+1
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
2016-09-19Manually tweak source formatting and then re-run clang-formatYuri Kunde Schlesner1-20/+12
2016-09-18Sources: Run clang-format on everything.Emmanuel Gil Peyrot1-51/+71
2016-06-01gsp::gpu: Reset g_thread_id in UnregisterInterruptRelayQueuemailwl1-1/+1
2016-05-07fixup simple type conversions where possibleAlexander Laties1-1/+1
2016-05-06Frontends, VideoCore: Move glad initialisation to the frontendEmmanuel Gil Peyrot1-6/+0
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-04-30VideoCore: Run include-what-you-use and fix most includes.Emmanuel Gil Peyrot1-5/+10
2016-04-21HWRasterizer: Texture forwardingtfarley1-54/+74
2016-03-08Improve error report from Init() functionsLittleWhite1-1/+7
Add error popup when citra initialization failed
2016-02-05renderer_opengl: Use GLvec3/GLvec4 aliases for commonly used types.bunnei1-2/+2
2016-02-03OpenGL: Downgrade GL_DEBUG_SEVERITY_NOTIFICATION to Debug logging levelYuri Kunde Schlesner1-2/+0
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.
2015-12-08VideoCore: Unify interface to OpenGL and SW rasterizersYuri Kunde Schlesner1-12/+3
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-11-19FragShader: Use an UBO instead of several individual uniformsSubv1-0/+1
2015-10-24OpenGL: Log GL_KHR_debug messages we receiveEmmanuel Gil Peyrot1-0/+57
This allows the driver to communicate errors, warnings and improvement suggestions about our usage of the API.
2015-10-22renderer_opengl: Refactor shader generation/caching to be more organized + various cleanups.bunnei1-2/+37
2015-09-16general: Silence some warnings when using clangLioncash1-2/+2
2015-09-11video_core: Reorganize headersLioncash1-2/+2
2015-09-11video_core: Remove unnecessary includes from headersLioncash1-3/+3
2015-08-30Replace the previous OpenGL loader with a glad-generated 3.3 oneYuri Kunde Schlesner1-2/+2
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-06OpenGL: Remove redundant texture.enable_2d field from OpenGLStateYuri Kunde Schlesner1-5/+0
All uses of this field where it's false can just set the texture id to 0 instead.
2015-07-13Add CiTrace recording support.Tony Wasserka1-0/+6
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-06-28Core, VideoCore: Replace or fix exit() calls.Emmanuel Gil Peyrot1-6/+9
2015-06-16VideoCore: Log the GL driver’s vendor and renderer.Emmanuel Gil Peyrot1-0/+2
2015-06-09Liberal texture unbind (clout menu)tfarley1-0/+6
2015-05-29Remove every trailing whitespace from the project (but externals).Emmanuel Gil Peyrot1-1/+1
2015-05-23OpenGL renderertfarley1-14/+47
2015-05-15Memmap: Re-organize memory function in two filesYuri Kunde Schlesner1-1/+1
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-09Memory: Add GetPhysicalPointer helper functionYuri Kunde Schlesner1-4/+4
2015-05-07Common: Remove common.hYuri Kunde Schlesner1-0/+1
2015-04-04Allow the user to set the background clear color during emulationarchshift1-1/+2
The background color can be seen at the sides of the bottom screen or when the window is wider than normal.
2015-03-09Added LCD registers, and implementation for color filling in OGL code.archshift1-10/+44
2015-03-07Set framebuffer layout from EmuWindow.bunnei1-39/+9
2015-03-02Add profiling infrastructure and widgetYuri Kunde Schlesner1-0/+12
2015-02-15video_core: Implement the remaining framebuffer formats in the OpenGL renderer.Emmanuel Gil Peyrot1-12/+62
2015-02-11Asserts: break/crash program, fit to style guide; log.h->assert.harchshift1-3/+3
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-01-14GSP: Update framebuffer info on all interruptsYuri Kunde Schlesner1-3/+1
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-08GSP: Toggle active framebuffer each framebunnei1-1/+4
2014-12-21License changepurpasmart961-1/+1
2014-12-20Clean up some warningsChin1-2/+2
2014-12-13Convert old logging calls to new logging macrosYuri Kunde Schlesner1-6/+6
2014-12-01Silence a few -Wsign-compare warnings.Rohit Nirmal1-1/+1
2014-11-30Fixed viewport error caused by roundingvaguilar1-2/+2
2014-11-19Remove tabs in all files except in skyeye imports and in generated GL codeEmmanuel Gil Peyrot1-1/+1
2014-11-18OpenGL Renderer: Cleanup viewport extent calculation.Tony Wasserka1-27/+22
2014-11-18Fixup EmuWindow interface and implementations thereof.Tony Wasserka1-3/+3
2014-11-18Viewport scaling and display density independenceKevin Hartman1-1/+35
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-10-12Rework OpenGL renderer.Yuri Kunde Schlesner1-167/+141
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-12OpenGL renderer: Shuffle initialization code around and rename functions.Yuri Kunde Schlesner1-17/+16
2014-09-09Moved common_types::Rect from common to Common namespacearchshift1-2/+2
2014-09-07renderer_opengl.cpp: improved alignment for readabilityarchshift1-16/+16
2014-09-01Replace GLEW with a glLoadGen loader.Yuri Kunde Schlesner1-5/+3
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-08-28Downgrade GLSL version to 1.50 (compatible with GL 3.2)Yuri Kunde Schlesner1-6/+8
2014-08-26VideoCore: Fixes rendering issues on Qt and corrects framebuffer output size.bunnei1-4/+10
2014-08-26Rewrite of OpenGL renderer, including OS X supportKevin Hartman1-176/+146
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-12Pica/GPU: Change hardware registers to use physical addresses rather than virtual ones.Tony Wasserka1-7/+7
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-12Remove the fancy RegisterSet class introduced in 4c2bff61e.Tony Wasserka1-2/+2
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-07-23Use uniform formatting when printing hexadecimal numbers.Tony Wasserka1-1/+1
2014-07-23RegisterSet: Simplify code by using structs for register definition instead of unions.Tony Wasserka1-9/+9
2014-07-23GPU: Make use of RegisterSet.Tony Wasserka1-26/+28
2014-07-23Renderer: Fix component order in bottom framebuffer.Tony Wasserka1-1/+1
2014-07-23Renderer: Respect the active_fb GPU register.Tony Wasserka1-2/+9
2014-07-23Renderer: Add a few TODOs.Tony Wasserka1-3/+10
2014-06-12Rename LCD to GPU.Tony Wasserka1-3/+3
2014-05-20common_types: Changed BasicRect back to Rect, in the common namespacearchshift1-2/+2
Only Rect is in the namespace for now; the rest of common should be added in the future
2014-05-08Update FlipFramebufferSethpaien1-7/+6
Less calculations + fix
2014-05-01Reverse debugging changesarchshift1-2/+0
2014-05-01TGA dumps work, courtesy of @bunneiarchshift1-0/+2
2014-04-28Rect to BasicRectarchshift1-2/+2
Somewhere along the line an OSX header had already taken the name Rect.
2014-04-27fixed renderer to use correct framebuffer locationbunnei1-6/+5
2014-04-22fixed GL context acquire (applies to Qt GUI only)bunnei1-0/+2
2014-04-18renamed hw_lcd module to just lcdbunnei1-1/+1
2014-04-17fixed framebuffer color orderbunnei1-1/+1
2014-04-17removed hard-coded framebuffer addresses from renderer_opengl.cppbunnei1-2/+4
2014-04-09fixed project includes to use new directory structurebunnei1-3/+4
2014-04-09got rid of 'src' folders in each sub-projectbunnei1-0/+0
2014-04-09fixed license header in video_corebunnei1-23/+3
2014-04-09- removed lots of unused code from gekkobunnei1-236/+74
- updated code style/naming conventions
2014-04-07added support for renderering the external framebuffersbunnei1-19/+140
2014-04-06added initial renderer codebunnei1-0/+340