Commit Graph

4707 Commits

Author SHA1 Message Date
131b342130 OpenGL: Guarantee writes to Buffers. 2020-04-22 11:36:18 -04:00
1fb516cd97 GPU: Implement Flush Requests for Async mode. 2020-04-22 11:36:17 -04:00
b7bc3c2549 FenceManager: Manage syncpoints and rename fences to semaphores. 2020-04-22 11:36:16 -04:00
96bb961a64 BufferCache: Refactor async managing. 2020-04-22 11:36:15 -04:00
b10db7e4a5 FenceManager: Implement async buffer cache flushes on High settings 2020-04-22 11:36:15 -04:00
4adfc9bb08 Rasterizer: Document SignalFence & ReleaseFences and setup skeletons on Vulkan. 2020-04-22 11:36:14 -04:00
a081a7c855 GPU: Fix rebase errors. 2020-04-22 11:36:13 -04:00
e84eb64e51 Rasterizer: Disable fence managing in synchronous gpu. 2020-04-22 11:36:12 -04:00
165ae823f5 ThreadManager: Sync async reads on accurate gpu. 2020-04-22 11:36:12 -04:00
57fdbd9b89 FenceManager: Implement should wait. 2020-04-22 11:36:11 -04:00
1f345ebe3a GPU: Implement a Fence Manager. 2020-04-22 11:36:10 -04:00
487379c593 OpenGL: Implement Fencing backend. 2020-04-22 11:36:10 -04:00
ed7e965712 TextureCache: Flush linear textures after finishing rendering. 2020-04-22 11:36:09 -04:00
339d0d9d6c GPU: Delay Fences. 2020-04-22 11:36:08 -04:00
8b1eb44b3e BufferCache: Implement OnCPUWrite and SyncGuestHost 2020-04-22 11:36:07 -04:00
da8f17715d GPU: Refactor synchronization on Async GPU 2020-04-22 11:36:06 -04:00
a60a22d9c2 Texture Cache: Implement OnCPUWrite and SyncGuestHost 2020-04-22 11:36:05 -04:00
084ceb925a UI: Replasce accurate GPU option for GPU Accuracy Level 2020-04-22 11:36:04 -04:00
6f47bd9641 vk_memory_manager: Remove unified memory model flag
All drivers (even Intel) seem to have a device local memory type that is
not host visible. Remove this flag so all devices follow the same path.

This fixes a crash when trying to map to host device local memory on
integrated devices.
2020-04-21 22:06:38 -03:00
d64290884a Merge pull request #3714 from lioncash/copies
gl_shader_decompiler: Avoid copies where applicable
2020-04-21 20:16:02 -04:00
488ed8bd02 vk_rasterizer: Add lazy default buffer maker and use it for empty buffers
Introduce a default buffer getter that lazily constructs an empty
buffer. This is intended to match OpenGL's buffer 0.

Use this for disabled vertex and uniform buffers.

While we are at it, include vertex buffer usages for staging buffers to
silence validation errors.
2020-04-21 19:55:52 -03:00
0bbae63300 gl_rasterizer: Fix buffers without size
On NVN buffers can be enabled but have no size. According to deko3d and
the behavior we see in Animal Crossing: New Horizons these buffers get
the special address of 0x1000 and limit themselves to 0xfff.

Implement buffers without a size by binding a null buffer to OpenGL
without a side.

1d1930beea/source/maxwell/gpu_3d_vbo.cpp (L62-L63)
2020-04-21 19:55:44 -03:00
f293b15611 Merge pull request #3718 from ReinUsesLisp/better-pipeline-state
fixed_pipeline_state: Pack structure, use memcmp and CityHash on it
2020-04-21 18:17:58 -03:00
9bf3abcb63 Merge pull request #3698 from lioncash/warning
General: Resolve minor assorted warnings
2020-04-21 14:11:18 -04:00
d3e0cefa60 Merge pull request #3695 from ReinUsesLisp/default-attributes
maxwell_3d: Initialize format attributes constant as one
2020-04-20 21:40:18 -04:00
8734ccb0cb shader/arithmetic_integer: Fix LEA_IMM encoding
The operand order in LEA_IMM was flipped compared to nvdisasm. Fix that
using nxas as reference:

8dbc389957/table.h (L122)
2020-04-20 21:54:59 -03:00
cb5b8ca886 Merge pull request #3733 from ambasta/patch-2
Initialize quad_indexed_pass before uint8_pass
2020-04-20 20:36:46 -04:00
ec2f8f4272 Merge pull request #3700 from ReinUsesLisp/stream-buffer-sizes
vk_stream_buffer: Fix out of memory on boot on recent Nvidia drivers
2020-04-20 09:37:42 -04:00
5324b1d01e Initialize quad_indexed_pass before uint8_pass
Fixes Werror=reorder in gcc
2020-04-20 04:53:52 +05:30
4932010c6f Merge pull request #3729 from lioncash/globals
dma_pusher: Remove reliance on the global system instance
2020-04-19 19:12:40 -03:00
85c17a2c35 Merge pull request #3694 from ReinUsesLisp/indexed-quads
vk_compute_pass: Implement indexed quads
2020-04-19 16:52:40 -04:00
44e959157b dma_pusher: Remove reliance on the global system instance
With this, the video core is now has no calls to the global system
instance at all.
2020-04-19 16:12:08 -04:00
2ea7a70da0 Merge pull request #3686 from lioncash/table
texture_cache/format_lookup_table: Fix incorrect green, blue, and alpha indices
2020-04-19 15:33:33 -04:00
73db83c0ab Merge pull request #3679 from lioncash/track
track: Eliminate redundant copies
2020-04-19 01:22:47 -04:00
afcc84a172 renderer_vulkan: assume X11 if not Windows/macOS after bf1d66b7c0
Render.Vulkan <Error> video_core/renderer_vulkan/renderer_vulkan.cpp:CreateInstance:131: Presentation not supported on this platform
Render.Vulkan <Error> video_core/renderer_vulkan/renderer_vulkan.cpp:CreateSurface:378: Presentation not supported on this platform
Core <Critical> core/core.cpp:Load:199: Failed to initialize system (Error 5)!
2020-04-19 00:32:23 +00:00
c81bf06d03 vulkan/wrapper: Sort physical devices
Sort discrete GPUs over the rest, Nvidia over AMD, AMD over Intel, Intel
over the rest. This gives us a somewhat consistent order when Optimus
is removed (renderdoc does this when it's attached).

This can break the configuration of users with an Intel GPU that
manually remove Optimus on yuzu. That said, it's a very unlikely to
happen.
2020-04-18 21:31:15 -03:00
d62f57cf5a fixed_pipeline_state: Hash and compare the whole structure
Pad FixedPipelineState's size to 384 bytes to be a multiple of 16.

Compare the whole struct with std::memcmp and hash with CityHash. Using
CityHash instead of a naive hash should reduce the number of collisions.
Improve used type traits to ensure this operation is safe.

With these changes the improvements to the hashable pipeline state are:

Optimized structure
Hash:            89 ns
Comparison:     103 ns
Construction*:  164 ns
Struct size:    384 bytes

Original structure
Hash:           148 ns
Equal:          174 ns
Construction*:  281 ns
Size:          1384 bytes

* Attribute state initialization is not measured

These measures are averages taken with std::chrono::high_accuracy_clock
on MSVC shipped on Visual Studio 16.6.0 Preview 2.1.
2020-04-18 19:57:26 -03:00
b571c92dfd fixed_pipeline_state: Pack blending state
Reduce FixedPipelineState's size to 364 bytes.
2020-04-18 19:23:35 -03:00
548dd27f45 fixed_pipeline_state: Pack rasterizer state
Reduce FixedPipelineState's size to 600 bytes.
2020-04-18 19:22:57 -03:00
7790144a55 fixed_pipeline_state: Pack depth stencil state
Reduce FixedPipelineState's size to 632 bytes.
2020-04-18 19:22:11 -03:00
ab6704f20c fixed_pipeline_state: Pack attribute state
Reduce FixedPipelineState's size from 1384 to 664 bytes
2020-04-18 19:21:19 -03:00
5305806071 Merge pull request #3716 from bunnei/fix-another-impl-fallthrough
video_core: gl_shader_decompiler: Fix implicit fallthrough errors.
2020-04-18 15:17:52 -04:00
03726fb7f5 video_core: gl_shader_decompiler: Fix implicit fallthrough errors. 2020-04-18 15:15:21 -04:00
bf328ed35a gl_shader_decompiler: Avoid copies where applicable
Avoids unnecessary reference count increments where applicable and also
avoids reallocating a vector.

Unlikely to make a huge difference, but given how trivial of an
amendment it is, why not?
2020-04-17 20:48:52 -04:00
07fbef1776 video_code: Fix implicit switch fallthrough.
Since yesterday, this breaks the build on linux.
So let's fix it.
2020-04-17 23:43:35 +02:00
a7b6bd56d7 vk_stream_buffer: Fix out of memory on boot on recent Nvidia drivers
Nvidia recently introduced a new memory type for data streaming
(awesome!), but yuzu was assuming that all heaps had enough memory
for the assumed stream buffer size (256 MiB).

This worked fine on AMD but Nvidia's new memory heap was smaller than
256 MiB. This commit changes this assumption and allocates a bit less
than the size of the preferred heap, with a maximum of 256 MiB (to avoid
allocating all system memory on integrated devices).

- Fixes a crash on NVIDIA 450.82.0.0
2020-04-17 18:12:48 -03:00
990c0b184f Revert "gl_shader_cache: Use CompileDepth::FullDecompile on GLSL" 2020-04-17 17:41:48 -03:00
b8f5c71f2d Merge pull request #3666 from bunnei/new-vmm
Implement a new virtual memory manager
2020-04-17 16:33:08 -04:00
ca3af2961c Merge pull request #3682 from lioncash/uam
gl_query_cache: Resolve use-after-move in CachedQuery move assignment operator
2020-04-17 01:24:08 -04:00
32fc2aae3c video_core: memory_manager: Updates for Common::PageTable changes. 2020-04-17 00:59:34 -04:00