Commit graph

831 commits

Author SHA1 Message Date
Morph
99ceb03a1c general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
Liam
a24e7ba61b maxwell3d: add small_index_2 register 2022-04-14 09:57:06 -04:00
ameerj
1bc7d61b57 video_core: Reduce unused includes 2022-03-19 15:01:31 -04:00
Fernando S
c3c351e2c2
Merge pull request #8023 from ameerj/kirby-pop-in
maxwell_3d: Implement a safer CB data upload
2022-03-16 12:14:08 +01:00
ameerj
5119a57614 maxwell_3d: Implement a safer CB data upload
This makes constant buffer uploads safer and more accurate by updating the GPU memory as soon as the CB Data method is invoked. The previous implementation was deferring the updates until a different maxwell 3d method was detected, then writing all CB data at once.
2022-03-14 19:18:36 -04:00
byte[]
be0e6a2bb4 Maxwell3D: Link to override constant definition in nouveau 2022-03-14 11:06:25 -04:00
byte[]
364c67e49b Maxwell3D: restore original topology when topology overrides are disabled 2022-03-14 11:00:08 -04:00
Liam
37aa472269 Maxwell3D: Use override constants from nouveau
This fixes some incorrect rendering in Sunshine
2022-03-14 10:11:58 -04:00
Liam
56c646d82c Maxwell3D: Restrict topology override effect to after the register is set 2022-03-11 19:42:12 -05:00
Liam
70e632f153 Maxwell3D: mark index buffers as dirty after updating counts 2022-03-11 08:51:22 -05:00
Liam
f1521183f8 Maxwell3D: read small-index draw and primitive topology override registers
This allows Galaxy and Sunshine to render for the first time.
2022-03-10 19:21:04 -05:00
Lody
4498908e72 MaxwellDMA: Implement semaphore operations 2022-03-07 13:46:18 +08:00
Fernando Sahmkow
8a6e6465a7 Rasterizer: Refactor inlineToMemory. 2022-02-01 01:47:28 +01:00
Fernando Sahmkow
4258d515e6 Rasterizer: Implement Inline2Memory Acceleration. 2022-01-29 22:53:27 +01:00
Fernando Sahmkow
f54280dafd Inline2Memory: Flush before writting buffer. 2022-01-29 17:42:28 +01:00
Lioncash
a05d9405b9 video_core/macro: Remove unused parameter from Execute()
Simplifies the function interface.
2022-01-25 13:41:38 -05:00
ameerj
5daf3abe65 common/logging: Move Log::Entry declaration to a separate header
This reduces the load of requiring to include std::chrono in all files which include log.h
2021-10-01 20:48:49 -04:00
ameerj
24049591f6 maxwell_dma: Minor refactoring 2021-09-19 20:36:41 -04:00
Feng Chen
0292374807 Fix blend equation enum error 2021-09-07 10:12:09 +08:00
Lioncash
f8964dd89a video_core/engine: Consistently initialize rasterizer pointers
Ensures all of the engines have consistent and deterministic
initialization of the rasterizer pointers.
2021-07-27 07:30:57 -04:00
ReinUsesLisp
fba6bd92d4 vk_rasterizer: Workaround bug in VK_EXT_vertex_input_dynamic_state
Workaround potential bug on Nvidia's driver where only updating high
attributes leaves low attributes out dated.
2021-07-22 21:51:39 -04:00
ReinUsesLisp
7dafa96ab5 shader: Rework varyings and implement passthrough geometry shaders
Put all varyings into a single std::bitset with helpers to access it.

Implement passthrough geometry shaders using host's.
2021-07-22 21:51:39 -04:00
ReinUsesLisp
4f052a1f39 vk_graphics_pipeline: Implement conservative rendering 2021-07-22 21:51:39 -04:00
ReinUsesLisp
395bed3a0a shader: Unify shader stage types 2021-07-22 21:51:39 -04:00
ReinUsesLisp
d554778311 vulkan: Use VK_EXT_provoking_vertex when available 2021-07-22 21:51:35 -04:00
FernandoS27
c736b9ffab DMA: Restrict optimised path for BlockToLinear further. 2021-07-22 21:51:34 -04:00
ReinUsesLisp
85cce78583 shader: Primitive Vulkan integration 2021-07-22 21:51:22 -04:00
ReinUsesLisp
c67d64365a shader: Remove old shader management 2021-07-22 21:51:22 -04:00
Fernando Sahmkow
1ae4b684ff Buffer cache: Fixes, Clang and Feedback. 2021-07-15 02:02:08 +02:00
Fernando Sahmkow
495b8e31b5 DMAEngine: Revert flushing from Pitch to BlpockLinear. 2021-07-14 16:44:53 +02:00
Fernando Sahmkow
b780d5b5c5 DMAEngine: Accelerate BufferClear 2021-07-13 03:49:47 +02:00
Fernando Sahmkow
be1a3f7a0f accelerateDMA: Accelerate Buffer Copies. 2021-07-11 01:33:17 +02:00
Feng Chen
c7ad195fd3
Out of bound blit (#6531)
* Fix out of bound blit error

* Fix code read

* Fix ci error

Co-authored-by: Feng Chen <chen.feng@gloritysolutions.com>
2021-07-08 11:06:09 -07:00
Lioncash
be6844c1ed maxwell3d: Add missing return in default SizeInBytes() case
We were returning '1' in ComponentCount()'s default case but were
neglecting to do the same with SizeInBytes().
2021-06-23 11:50:40 -04:00
ameerj
859ba21f6d buffer_cache: Simplify uniform disabling logic 2021-06-01 13:26:58 -04:00
bunnei
de5bf640b7
Merge pull request #6196 from bunnei/asserts-setting
core: settings: Add setting for debug assertions and disable by default.
2021-04-14 17:47:18 -07:00
bunnei
a4c6712a4b common: Move settings to common from core.
- Removes a dependency on core and input_common from common.
2021-04-14 16:24:03 -07:00
Lioncash
31932904c5 engine_interface: Add missing virtual destructor
Eliminates a potential bug vector related to inheritance. Plus, we
should generally be specifying the destructor as virtual within purely
virtual interfaces to begin with.
2021-04-12 09:53:55 -04:00
ReinUsesLisp
82c2601555 video_core: Reimplement the buffer cache
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-13 02:17:22 -03:00
ReinUsesLisp
75ccd9959c gpu: Report renderer errors with exceptions
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.
2021-02-13 02:16:19 -03:00
ReinUsesLisp
80a673a27f maxwell_3d: Silence array bounds warnings 2021-01-24 04:31:41 -03:00
ReinUsesLisp
3ff978aa4f common/common_funcs: Rename INSERT_UNION_PADDING_{BYTES,WORDS} to _NOINIT
INSERT_PADDING_BYTES_NOINIT is more descriptive of the underlying behavior.
2021-01-15 16:27:28 -03:00
ReinUsesLisp
9764c13d6d video_core: Rewrite the texture cache
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-30 03:38:50 -03:00
bunnei
37bec068c2
Merge pull request #5157 from lioncash/array-dirty
maxwell_3d: Remove unused dirty_pointer array
2020-12-15 00:35:47 -08:00
Lioncash
4c5f5c9bf3 video_core: Remove unnecessary enum class casting in logging messages
fmt now automatically prints the numeric value of an enum class member
by default, so we don't need to use casts any more.

Reduces the line noise a bit.
2020-12-07 00:41:50 -05:00
Lioncash
9e7a1f1351 maxwell_3d: Move member variables to end of class
Follows our established coding style.
2020-12-06 20:56:00 -05:00
Lioncash
ce0712bf95 maxwell_3d: Resolve -Wdocumentation warning
Removes a documentation comment for a non-existent member.
2020-12-06 20:48:12 -05:00
Lioncash
bcc5c4403a maxwell_3d: Remove unused dirty_pointer array
This is unused and removing it shrinks the structure by 3584 bytes.
2020-12-06 20:46:57 -05:00
comex
a6e6cd5788 maxwell_dma: Rename RenderEnable::Mode::FALSE and TRUE to avoid name conflict
On Apple platforms, FALSE and TRUE are defined as macros by
<mach/boolean.h>, which is included by various system headers.

Note that there appear to be no actual users of the names to fix up.
2020-12-05 17:59:02 -05:00
Lioncash
677a8b208d video_core: Resolve more variable shadowing scenarios
Resolves variable shadowing scenarios up to the end of the OpenGL code
to make it nicer to review. The rest will be resolved in a following
commit.
2020-12-04 16:19:09 -05:00