Commit Graph

91 Commits (99da6362c43a24c608a2790f668f10a62e3b80a6)

Author SHA1 Message Date
Lioncash bd983414f6 core_timing: Convert core timing into a class
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.
6 years ago
Lioncash 48d9d66dc5 core_timing: Rename CoreTiming namespace to Core::Timing
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.
6 years ago
ReinUsesLisp 2bdbb90af7 video_core: Assert on invalid GPU to CPU address queries 6 years ago
ReinUsesLisp 04e68e9738 maxwell_3d: Allow sampler handles with TSC id zero 6 years ago
ReinUsesLisp 390721a561 maxwell_3d: Allow texture handles with TIC id zero
Also remove "enabled" field from Tegra::Texture::FullTextureInfo because
it would become unused.
6 years ago
ReinUsesLisp 9a82dec74a maxwell_3d: Set rt_separate_frag_data to 1 by default
Commercial games assume that this value is 1 but they never set it. On
the other hand nouveau manually sets this register. On
ConfigureFramebuffers we were asserting for what we are actually
implementing (according to envytools).
6 years ago
ReinUsesLisp b683e41fca gl_rasterizer_cache: Use dirty flags for the depth buffer 6 years ago
ReinUsesLisp 179ee963db gl_rasterizer_cache: Use dirty flags for color buffers 6 years ago
ReinUsesLisp 0ab17ab406 gl_shader_cache: Use dirty flags for shaders 6 years ago
bunnei abea6fa90c gpu: Rewrite GPU command list processing with DmaPusher class.
- More accurate impl., fixes Undertale (among other games).
6 years ago
bunnei 67a154e23d
Merge pull request #1723 from degasus/dirty_flags
gl_rasterizer: Skip VB upload if the state is clean.
6 years ago
bunnei 1a543723ab maxwell_3d: Initialize rasterizer color mask registers as enabled.
- Fixes rendering regression with Sonic Mania.
7 years ago
Rodolfo Bogado 6a2aa6dbdb set default value for point size register 7 years ago
Rodolfo Bogado 1881e86c43 fix viewport and scissor behavior 7 years ago
Markus Wick 97f5c4ffd3 gl_rasterizer: Skip VB upload if the state is clean. 7 years ago
Frederic L ab362aa7e5
gl_rasterizer: Minor cleanup
Minor code cleanup from unaddressed feedback in #1654
7 years ago
Rodolfo Bogado 4a6eff3b7b Try to fix problems with stencil test in some games, relax translation to opengl enums to avoid crashing and only generate logs of the errors. 7 years ago
bunnei 8ea6261547
Merge pull request #1654 from degasus/dirty_flags
gl_rasterizer: Skip VAO binding if the state is clean.
7 years ago
Markus Wick 359db6a673 gl_rasterizer: Skip VAO binding if the state is clean. 7 years ago
Rodolfo Bogado 145ae36963 Implement multi-target viewports and blending 7 years ago
bunnei de0ab806df maxwell_3d: Restructure macro upload to use a single macro code memory.
- Fixes an issue where macros could be skipped.
- Fixes rendering of distant objects in Super Mario Odyssey.
7 years ago
Frederic L 7a5eda5914 global: Use std::optional instead of boost::optional (#1578)
* 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
7 years ago
bunnei 949d9a7136 maxwell_3d: Add code for initializing register defaults. 7 years ago
Lioncash a97cdb5eb4
maxwell_3d: Remove unused variable within ProcessQueryGet() 7 years ago
Lioncash c1e5525fc6 engines/maxwell_*: Use nested namespace specifiers where applicable
These three source files are the only ones within the engines directory
that don't use nested namespaces. We may as well change these over to
keep things consistent.
7 years ago
fearlessTobi 63c2e32e20 Port #4182 from Citra: "Prefix all size_t with std::" 7 years ago
Markus Wick c560043581 rasterizer: Drop unused handler.
This virtual function is called in a very hot spot, and it does nothing.

If this kind of feature is required, please be more specific and add callbacks
in the switch statement within Maxwell3D::WriteReg. There is no point in having
another switch statement within the rasterizer.
7 years ago
bunnei fdd5c97a14 maxwell_3d: Remove assert that no longer applies. 7 years ago
Zach Hilman f32e28c7b8 maxwell_3d: Use CoreTiming for query timestamp 7 years ago
Lioncash 4a587b81b2 core/core: Replace includes with forward declarations where applicable
The follow-up to e2457418da, 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.
7 years ago
Lioncash 20800f2df7 maxwell3d: Move FinishedPrimitiveBatch event after AcceleratedDrawBatch()
The start and finish events should likely not be right after one another
like this, otherwise the batch will appear to complete immediately
7 years ago
Subv c5284efd4f Rasterizer: Implemented instanced rendering.
We keep track of the current instance and update an uniform in the shaders to let them know which instance they are.

Instanced vertex arrays are not yet implemented.
7 years ago
bunnei efe6b473c5 maxwell_3d: Ignore macros that have not been uploaded yet.
- Used by Super Mario Odyssey (in game).
7 years ago
bunnei 57982df105 maxwell_3d: Use correct const buffer size and check bounds.
- Fixes mem corruption with Super Mario Odyssey and Pokkén Tournament DX.
7 years ago
bunnei 904d7eaa94 maxwell_3d: Remove outdated assert. 7 years ago
Lioncash 6030c5ce41 video_core: Eliminate the g_renderer global variable
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.
7 years ago
Subv 8f2c4191ab GPU: Remove the assert that required the CODE_ADDRESS to be 0.
Games usually just leave it at 0 but nouveau sets it to something else. This already works fine, the assert is useless.
7 years ago
Lioncash 8b08f82dc7 maxwell_3d: Remove unused variable within GetStageTextures() 7 years ago
bunnei 8aeff9cf8e gl_rasterizer: Fix check for if a shader stage is enabled. 7 years ago
bunnei c996787d84
Merge pull request #609 from Subv/clear_buffers
GPU: Implemented the CLEAR_BUFFERS register.
7 years ago
Subv c1811ed3d1 GPU: Support clears that don't clear the color buffer. 7 years ago
Subv be51120d23 GPU: Bind and clear the render target when the CLEAR_BUFFERS register is written to. 7 years ago
James Rowe 0d46f0df12 Update clang format 7 years ago
James Rowe 638956aa81 Rename logging macro back to LOG_* 7 years ago
Subv a3d82ef5d9 Build: Fixed some MSVC warnings in various parts of the code. 7 years ago
Subv dbfc39d214 GPU: Implement sampling multiple textures in the generated glsl shaders.
All tested games that use a single texture show no regression.

Only Texture2D textures are supported right now, each shader gets its own "tex_fs/vs/gs" sampler array to maintain independent textures between shader stages, the textures themselves are reused if possible.
7 years ago
Subv d57333406d GPU: Partial implementation of long GPU queries.
Long queries write a 128-bit result value to memory, which consists of a 64 bit query value and a 64 bit timestamp.

In this implementation, only select=Zero of the Crop unit is implemented, this writes the query sequence as a 64 bit value, and a 0u64 value for the timestamp, since we emulate an infinitely fast GPU.

This specific type was hwtested, but more rigorous tests should be performed in the future for the other types.
7 years ago
bunnei f41eb95e13 maxwell_3d: Reset vertex counts after drawing. 7 years ago
Lioncash 8475496630
general: Convert assertion macros over to be fmt-compatible 7 years ago
Subv c16cfbbc6c GPU: Reduce the number of registers of Maxwell3D to 0xE00.
The rest are just macro shim registers.
7 years ago