aboutsummaryrefslogtreecommitdiff
path: root/src/GPU3D_OpenGL.cpp
Commit message (Collapse)AuthorAge
* Resolve or silence some warnings (#1905)Jesse Talavera2023-12-28
| | | | | | | | | * Resolve some warnings - Their frequent appearance in the build logs is driving me nuts * Silence warnings about `offsetof` * Don't apply `-Wno-invalid-offset` to C, only to C++
* Make the initial 3D renderer configurable via `NDSArgs` (#1913)Jesse Talavera2023-12-15
| | | | | | | * Allow 3D renderers to be created without passing `GPU` to the constructor * Make the initial 3D renderer configurable via `NDSArgs` * Fix a compiler error
* Sprinkle `const` around where appropriate (#1909)Jesse Talavera2023-12-12
| | | | | | | | | * Sprinkle `const` around where appropriate - This will make it easier to use `NDS` objects in `const` contexts (e.g. `const` parameters or methods) * Remove the `const` qualifier on `DSi_DSP::DSPRead16` - MMIO reads can be non-pure, so this may not be `const` in the future
* Clean up the 3D renderer for enhanced flexibility (#1895)Jesse Talavera-Greenberg2023-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Give `GPU2D::Unit` a virtual destructor - Undefined behavior avoided! * Add an `array2d` alias * Move various parts of `GPU2D::SoftRenderer` to `constexpr` - `SoftRenderer::MosaicTable` is now initialized at compile-time - Most of the `SoftRenderer::Color*` functions are now `constexpr` - The aforementioned functions are used with a constant value in at least one place, so they'll be at least partially computed at compile-time * Generalize `GLRenderer::PrepareCaptureFrame` - Declare it in the base `Renderer3D` class, but make it empty * Remove unneeded `virtual` specifiers * Store `Framebuffer`'s memory in `unique_ptr`s - Reduce the risk of leaks this way * Clean up how `GLCompositor` is initialized - Return it as an `std::optional` instead of a `std::unique_ptr` - Make `GLCompositor` movable - Replace `GLCompositor`'s plain arrays with `std::array` to simplify moving * Pass `GPU` to `GLCompositor`'s important functions instead of passing it to the constructor * Move `GLCompositor` to be a field within `GLRenderer` - Some methods were moved up and made `virtual` * Fix some linker errors * Set the renderer in the frontend * Remove unneeded `virtual` specifiers * Remove `RenderSettings` in favor of just exposing the relevant member variables * Update the frontend to accommodate the core changes * Add `constexpr` and `const` to places in the interpolator * Qualify references to `size_t` * Construct the `optional` directly instead of using `make_optional` - It makes the Linux build choke - I think it's because `GLCompositor`'s constructor is `private`
* Move all core types into namespaces (#1886)Jesse Talavera-Greenberg2023-11-25
| | | | | | | | * Reorganize namespaces - Most types are now moved into the `melonDS` namespace - Only good chance to do this for a while, since a big refactor is next * Fix the build
* Refactor the GPU to be object-oriented (#1873)Jesse Talavera-Greenberg2023-11-09
| | | | | | | | | | | | | | | | | * Refactor GPU3D to be an object - Who has two thumbs and is the sworn enemy of global state? This guy! * Refactor GPU itself to be an object - Wow, it's used in a lot of places - Also introduce a new `Melon` namespace for a few classes - I expect other classes will be moved into `Melon` over time * Change signature of Renderer3D::SetRenderSettings - Make it noexcept, and its argument const * Remove some stray whitespace
* update copyright yearsArisotura2023-11-04
|
* Make the NDS teardown more robust (#1798)Jesse Talavera-Greenberg2023-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make cleanup a little more robust to mitigate undefined behavior - Add some null checks before cleaning up the GPU3D renderer - Make sure that all deleted objects are null - Move cleanup logic out of an assert call - Note that deleting a null pointer is a no-op, so there's no need to check for null beforehand - Use RAII for GLCompositor instead of Init/DeInit methods * Replace a DeInit call that I missed * Make ARMJIT_Memory less likely to generate errors - Set FastMem7/9Start to nullptr at the end - Only close and unmap the file if it's initialized * Make Renderer3D manage its resources with RAII * Don't try to deallocate frontend resources that aren't loaded * Make ARMJIT_Memory::DeInit more robust on the Switch * Reset MemoryFile on Windows to INVALID_HANDLE_VALUE, not nullptr - There is a difference * Don't explicitly store a Valid state in GLCompositor or the 3D renderers - Instead, create them with static methods while making the actual constructors private * Make initialization of OpenGL resources fail if OpenGL isn't loaded * assert that OpenGL is loaded instead of returning failure
* update copyright headersArisotura2022-01-09
|
* finally decouple Config from the core. baahhahahahahArisotura2021-11-18
|
* Fix some compiler warningsWaluigiWare642021-05-03
|
* update copyright year and add missing GPL headersRSDuck2021-03-12
|
* Allow for a more modular renderer backends (#990)Wunk2021-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Draft GPU3D renderer modularization * Update sources C++ standard to C++17 The top-level `CMakeLists.txt` is already using the C++17 standard. * Move GLCompositor into class type Some other misc fixes to push towards better modularity * Make renderer-implementation types move-only These types are going to be holding onto handles of GPU-side resources and shouldn't ever be copied around. * Fix OSX: Remove 'register' storage class specifier `register` has been removed in C++17... But this keyword hasn't done anything in years anyways. OSX builds consider this "warning" an error and it stops the whole build. * Add RestartFrame to Renderer3D interface * Move Accelerated property to Renderer3D interface There are points in the code base where we do: `renderer != 0` to know if we are feeding an openGL renderer. Rather than that we can instead just have this be a property of the renderer itself. With this pattern a renderer can just say how it wants its data to come in rather than have everyone know that they're talking to an OpenGL renderer. * Remove Accelerated flag from GPU * Move 2D_Soft interface in separate header Also make the current 2D engine an "owned" unique_ptr. * Update alignment attribute to standard alignas Uses standardized `alignas` rather than compiler-specific attributes. https://en.cppreference.com/w/cpp/language/alignas * Fix Clang: alignas specifier Alignment must be specified before the array to align the entire array. https://en.cppreference.com/w/cpp/language/alignas * Converted Renderer3D Accelerated to variable This flag is checked a lot during scanline rasterization. So rather than having an expensive vtable-lookup call during mainline rendering code, it is now a public constant bool type that is written to only once during Renderer3D initialization.
* call glFlush only onceRSDuck2021-01-29
| | | | | that seems to atleast get rid of the flicker the weird issue that clears don't work is still there
* Fix some compiler warningsWaluigiWare642021-01-25
|
* include polygon attr opaqueness for translucent polygons in render keyRSDuck2021-01-22
|
* GL: ensure to set depthmask to TRUE before rendering opaque shitArisotura2021-01-21
|
* pad ShaderConfig to a multiple of 16RSDuck2021-01-17
|
* use C++ style structs everywhereRSDuck2021-01-02
|
* GL: don't break rendering order when translucent polygons contain opaque pixels.Arisotura2020-12-11
| | | | | | fixes #831 (also disable edgemarking for now. it sucked anyway)
* GL: align uniform-buffer size to 16-byte boundary. atleast makes RenderDoc ↵Arisotura2020-12-11
| | | | happy.
* fix edge indices countRSDuck2020-11-19
|
* use proper index buffersRSDuck2020-11-16
|
* * fix build errorArisotura2020-08-24
| | | | | * make betterer polygon splitting an option * add GL_LEQUAL depth test for 'equal' mode, might help
* oops.Arisotura2020-08-24
| | | | fixes #725
* GL: hopefully finally fix the checkerboard issueArisotura2020-08-20
|
* blargArisotura2020-08-20
|
* GL: be more careful with framebuffer mappings. might fix issues.Arisotura2020-08-20
|
* 3D/GL: experimental attempt at reducing warping on quads, pentagons, etc...Arisotura2020-08-19
|
* 3D/GL: make polygon generation code cleaner, add quicker codepath for ↵Arisotura2020-08-19
| | | | | | triangles (also laying ground for some evil experiment) also fix stupid bug with line polygons
* * rework GPU's settings interface, make it config-agnosticArisotura2020-05-28
| | | | | * make video settings dialog functional, sorta * fix dialogs that were resizable
* make it hiDPI compliant (I hope)Arisotura2020-05-28
| | | | also misc tweaks
* we don't need a GLShim.Arisotura2020-05-27
| | | | | | blarg. I don't understand this anymore.
* get the OpenGL renderer going.Arisotura2020-05-25
| | | | | | sorta. (also make the blackmagic_II branch obsolete in the process)
* update copyright yearsArisotura2020-02-14
|
* OpenGL: fix bug when rendering translucent polygons coming after shadow ↵Arisotura2019-11-03
| | | | polygons, against a zero-alpha clear-plane (would use wrong shader, resulting in broken transparency)
* HARK HARK HARKArisotura2019-06-25
|
* fix OGL renderer not working at all on some GPUsRSDuck2019-06-17
|
* fix bugs with line polygonsArisotura2019-06-12
|
* hack so that the GL renderer can render linesArisotura2019-06-12
|
* somewhat better edge markingArisotura2019-06-12
|
* fix more stupid shit. askzjkdsfArisotura2019-06-09
|
* fix fog alphaArisotura2019-06-09
|
* miserable, feeble little attempt at edge markingArisotura2019-06-09
|
* fix last bugs when changing video settings with no game loadedArisotura2019-06-08
|
* do binding of VS inputs and FS outputs before linking shader programs, as ↵Arisotura2019-05-31
| | | | | | per OpenGL standard. should fix the rendering issues with strict drivers (AMD, Intel).
* * add needed libui functions under Windows, even if they don't do a whole lotArisotura2019-05-31
| | | | * fix ass-stupid fog bug
* try to fix fog consecutively to the Intel fix. still not perfect for ↵StapleButter2019-05-31
| | | | | | whatever reason also clean up more code
* OpenGL renderer: fix for Intel driver (doesn't like RGB8UI framebuffers)StapleButter2019-05-30
|
* simpler GPU-compositing. will make it easier to grab neighbor 2D/3D pixels ↵Arisotura2019-05-25
| | | | individually for filtering.