aboutsummaryrefslogtreecommitdiff
path: root/src/GPU2D.h
Commit message (Collapse)AuthorAge
* 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
|
* update copyright headersArisotura2022-01-09
|
* update copyright year and add missing GPL headersRSDuck2021-03-12
|
* separate GPU2D registers and rendererRSDuck2021-02-27
|
* 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.
* only start display capture on first lineRSDuck2020-12-09
| | | | | fixes Spearpillar in Pokemon D/P/Pt also fixes #782 and #474
* rename the class as wellRSDuck2020-12-07
| | | | this is getting emberassing
* lay base for multiple GPU2D backendsRSDuck2020-12-06
|
* Merge vram dirty trackingRSDuck2020-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit b463a05d4b909372f0cd1ad91caa0c77a25e5901 Author: RSDuck <rsduck@users.noreply.github.com> Date: Mon Nov 30 01:55:35 2020 +0100 minor fix commit ce73cebbdf5da243d7ebade82d8799ded9cd6b28 Author: RSDuck <rsduck@users.noreply.github.com> Date: Mon Nov 30 00:43:08 2020 +0100 fix dirty flags of BG/OBJ mappings not being reset commit fc5d73a6178e3adc444398bdd23de8314b5ca8f8 Author: RSDuck <rsduck@users.noreply.github.com> Date: Mon Nov 30 00:11:13 2020 +0100 use flat vram for gpu2d everywhere commit 34ee9fe2bf04fcfa2a5a1c8d78d70007e606f1a2 Author: RSDuck <rsduck@users.noreply.github.com> Date: Sat Nov 28 19:10:34 2020 +0100 mark VRAM dirty for display capture commit e8778fa2f429c6df0eece19d6a5ee83ae23a0cf4 Author: RSDuck <rsduck@users.noreply.github.com> Date: Sat Nov 28 18:59:31 2020 +0100 use flat VRAM for textures and texpals also skip rendering if nothing changed and a bunch of fixes commit 53f2041e2e1a28b35702a2ed51de885c36689f71 Author: RSDuck <rsduck@users.noreply.github.com> Date: Fri Nov 27 18:29:56 2020 +0100 use vram dirty tracking for extpals also preparations to take this further commit 4cdfa329e95aed26d3b21319c8fd86a04abf20f7 Author: RSDuck <rsduck@users.noreply.github.com> Date: Mon Nov 16 23:32:22 2020 +0100 VRAM dirty tracking
* GPU2D: don't an indirect call in tight loopsRSDuck2020-11-16
|
* * rework GPU's settings interface, make it config-agnosticArisotura2020-05-28
| | | | | * make video settings dialog functional, sorta * fix dialogs that were resizable
* update copyright yearsArisotura2020-02-14
|
* fix sprite y-flipArisotura2019-11-03
| | | | also, meaningless shenanigans
* uuuh we should only do it once per scanlineArisotura2019-09-15
|
* begin work on mosaicArisotura2019-09-15
| | | | OBJ Y mosaic emulated correctly, there's atleast that.
* GPU2D: delay palette lookup for spritesArisotura2019-09-05
|
* GPU2D: fill gaps in BG modesArisotura2019-07-24
| | | | | * mode6 actually works on the sub GPU, albeit limited to 1/4 the full bitmap size due to having only 128K of VRAM * mode7 draws BG0, BG1 and sprites. no BG2/BG3.
* GPU2D: hardware renders sprites one scanline in advance.Arisotura2019-06-10
| | | | fixes #375 (midframe OAM update)
* fix crash when using -O3.StapleButter2019-05-30
| | | | gcc will try to optimize the memfill with MMX opcodes, but those seem to crash if the memory isn't aligned to a 8-byte boundary.
* simpler GPU-compositing. will make it easier to grab neighbor 2D/3D pixels ↵Arisotura2019-05-25
| | | | individually for filtering.
* welp.Arisotura2019-05-21
| | | | progress
* begin botching the codeArisotura2019-05-19
| | | | BAHAHAHAAAA
* actually finish display capture in hardware-accel modeArisotura2019-05-18
|
* BAHAHAHAHAHAHAHAAArisotura2019-05-16
|
* finish de-hardcoding it. also, code 4x variant (not that I guarantee it to ↵Arisotura2019-05-12
| | | | be fast, but hey, it's here)
* make GPU2D somewhat more flexible. change LineScale to be log2.Arisotura2019-05-12
|
* hires hax. somewhat functionalArisotura2019-05-08
|
* also, update copyright nameArisotura2019-01-22
|
* small optimization: avoid calling InterleaveSprites() if no sprites were drawn.StapleButter2019-01-06
|
* implement proper support for POWCNT1.StapleButter2018-12-18
| | | | fixes #260
* revise windows to be even closer to hardware.StapleButter2018-11-25
| | | | apparently hardware only ever updates its 'inside/outside window' status when reaching the coordinates. which becomes apparent if you, like, try to invert a window midframe.
* GPU doneStapleButter2018-10-18
|
* fixor copyright years.StapleButter2018-09-15
|
* 2D: mosaicStapleButter2017-07-23
| | | | sprites might be mosaiced wrong, esp. rotscaled ones. blrgdfgdf
* add some more GPU IOStapleButter2017-07-23
|
* * bump version numberStapleButter2017-07-16
| | | | * BLDALPHA is readable
* 2D: implement large BG, fix non-large bitmap BG. fixes #61StapleButter2017-07-05
|
* 2D: implement enough of mode6 to fix #65 -- shows 3D layer. large BG still ↵StapleButter2017-06-28
| | | | needs to be done.
* proper display FIFO emulationStapleButter2017-06-26
|
* windows!StapleButter2017-04-09
|
* * implement missing graphics (affine BG, rotscaled bitmap sprite)StapleButter2017-03-24
| | | | | | * fix potential crash upon exit * more work on the input config UI * misc fixes
* fix that bug where NSMB's backgrounds lagged one frame behindStapleButter2017-03-21
|
* implement some obscure DMA typesStapleButter2017-03-20
|
* reorganize repo, move shit aroundStapleButter2017-03-16