Commit Graph

11813 Commits (dfd998216cb83f040dcc3bb5d94b5159b0ca6149)

Author SHA1 Message Date
bunnei 30faf6a964
Merge pull request #3308 from lioncash/private
maxwell_3d: Make dirty_pointers private
5 years ago
bunnei d23869811d
Merge pull request #3304 from lioncash/fwd-decl
renderer_opengl/utils: Forward declare private structs
5 years ago
Lioncash 9e874898f5 maxwell_3d: Make dirty_pointers private
This isn't used outside of the class itself, so we can make it private
for the time being.
5 years ago
James Rowe b429095b61 Fix git version in scm_rev.cpp 5 years ago
ReinUsesLisp c375d735e6 gl_state: Implement PROGRAM_POINT_SIZE
For gl_PointSize to have effect we have to activate
GL_PROGRAM_POINT_SIZE.
5 years ago
Lioncash 7af56dfa76 renderer_opengl/utils: Remove unused header inclusions
Nothing from these headers are used, so they can be removed.
5 years ago
Lioncash 06d30fbcca renderer_opengl/utils: Forward declare private structs
Keeps the definitions hidden and allows changes to the structs without
needing to recompile all users of classes containing said structs.
5 years ago
ReinUsesLisp 66a1c777c9 gl_texture_cache: Use local variables to simplify DownloadTexture 5 years ago
ReinUsesLisp cdb00546f0 gl_texture_cache: Fix format for RGBX16F 5 years ago
ReinUsesLisp 2d09467f6f gl_texture_cache: Use Snorm internal format for RG8S 5 years ago
ReinUsesLisp 02624c35ec gl_texture_cache: Use Snorm internal format for ABGR8S 5 years ago
Rodrigo Locatti 64cd46579b
Merge pull request #3303 from lioncash/reorder
control_flow: Silence -Wreorder warning for CFGRebuildState
5 years ago
Rodrigo Locatti 81e9e229fa
Merge pull request #3302 from lioncash/unused-var
gl_shader_cache: Remove unused variables
5 years ago
Lioncash a1eee1749e control_flow: Silence -Wreorder warning for CFGRebuildState
Organizes the initializer list in the same order that the variables
would actually be initialized in.
5 years ago
bunnei a83e28b237
Merge pull request #3296 from Simek/hotkeys_resize
GUI/configure: resize hotkeys action column to fit content
5 years ago
Lioncash f10ea944e0 gl_shader_cache: Remove unused STAGE_RESERVED_UBOS constant
Given this isn't used, this can be removed entirely.
5 years ago
Lioncash 4cd5ad90f3 gl_shader_cache: std::move entries in CachedShader constructor
Avoids several reallocations of std::vector instances where applicable.
5 years ago
Lioncash 15a6840e7a gl_shader_cache: Remove unused entries variable in BuildShader()
Eliminates a few unnecessary constructions of std::vectors.
5 years ago
bunnei 55f95e7f26
Merge pull request #3287 from ReinUsesLisp/ldg-stg-16
shader_ir/memory: Implement u16 and u8 for STG and LDG
5 years ago
bunnei 15788ffcde
Merge pull request #3288 from ReinUsesLisp/uncurse-aoffi
shader_ir/texture: Simplify AOFFI code
5 years ago
bunnei 6985eea519
Merge pull request #3290 from ReinUsesLisp/gl-clamp
maxwell_to_vk: Implement GL_CLAMP hacking Nvidia's driver
5 years ago
bunnei e749f17257
Merge pull request #3292 from degasus/heap_space_fix
core/kernel: Fix GetTotalPhysicalMemoryUsed.
5 years ago
ReinUsesLisp 09e17fbb0f vk_texture_cache: Implement generic texture cache on Vulkan
It currently ignores PBO linearizations since these should be dropped as
soon as possible on OpenGL.
5 years ago
ReinUsesLisp 2b2712fa95 texture_cache/surface_params: Make GetNumLayers public 5 years ago
Bartosz Kaszubowski da3049aa74 GUI: add few missing hotkeys to main menu 5 years ago
Bartosz Kaszubowski 6726e8b784 GUI/configure: resize hotkeys column to content 5 years ago
Markus Wick c76ffa5019 core/kernel: Fix GetTotalPhysicalMemoryUsed.
module._memory was already moved over to a new shared_ptr.
So code_memory_size was not increased at all.

This lowers the heap space and so saves a bit of memory, usually between 50 to 100 MB.

This fixes a regression of c0a01f3adc
5 years ago
Rodrigo Locatti b1138e5ea1
vk_compute_pass: Address feedback
Comment hardcoded SPIR-V modules.
5 years ago
ReinUsesLisp 3d46709b7f maxwell_to_vk: Implement GL_CLAMP hacking Nvidia's driver
Nvidia's driver defaults invalid enumerations to GL_CLAMP. Vulkan
doesn't expose GL_CLAMP through its API, but we can hack it on Nvidia's
driver using the internal driver defaults.
5 years ago
ReinUsesLisp 13021b534c shader_ir/texture: Simplify AOFFI code 5 years ago
ReinUsesLisp e2a2a556b9 shader_ir/memory: Implement u16 and u8 for STG and LDG
Using the same technique we used for u8 on LDG, implement u16.

In the case of STG, load memory and insert the value we want to set
into it with bitfieldInsert. Then set that value.
5 years ago
ReinUsesLisp 908e085d02 vk_compute_pass: Add compute passes to emulate missing Vulkan features
This currently only supports quad arrays and u8 indices.

In the future we can remove quad arrays with a table written from the
CPU, but this was used to bootstrap the other passes helpers and it
was left in the code.

The blob code is generated from the "shaders/" directory. Read the
instructions there to know how to generate the SPIR-V.
5 years ago
ReinUsesLisp 82a64da077 vk_shader_util: Add helper to build SPIR-V shaders 5 years ago
Fernando Sahmkow 80436c1330
Merge pull request #3279 from ReinUsesLisp/vk-pipeline-cache
vk_pipeline_cache: Initial implementation
5 years ago
bunnei 319c4d2108
Merge pull request #3272 from bunnei/vi-close-layer
service: vi: Implement CloseLayer.
5 years ago
ReinUsesLisp 6888d776ff vk_pipeline_cache: Initial implementation
Given a pipeline key, this cache returns a pipeline abstraction (for
graphics or compute).
5 years ago
ReinUsesLisp 2effdeb924 vk_graphics_pipeline: Initial implementation
This abstractio represents the state of the 3D engine at a given draw.
Instead of changing individual bits of the pipeline how it's done in
APIs like D3D11, OpenGL and NVN; on Vulkan we are forced to put
everything together into a single, immutable object.

It takes advantage of the few dynamic states Vulkan offers.
5 years ago
ReinUsesLisp dc96a59fa0 vk_compute_pipeline: Initial implementation
This abstraction represents a Vulkan compute pipeline.
5 years ago
ReinUsesLisp b392a5986e vk_pipeline_cache: Add file and define descriptor update template filler
This function allows us to share code between compute and graphics
pipelines compilation.
5 years ago
ReinUsesLisp 3142f1b597 fixed_pipeline_state: Add depth clamp 5 years ago
ReinUsesLisp 9c548146ca vk_rasterizer: Add placeholder 5 years ago
bunnei 5be00cba15
Merge pull request #3276 from ReinUsesLisp/pipeline-reqs
vk_update_descriptor/vk_renderpass_cache: Add pipeline cache dependencies
5 years ago
bunnei ee9b4a7f9a
Merge pull request #3278 from ReinUsesLisp/vk-memory-manager
renderer_vulkan: Buffer cache, stream buffer and memory manager changes
5 years ago
ReinUsesLisp 5aeff9aff5 vk_renderpass_cache: Initial implementation
The renderpass cache is used to avoid creating renderpasses on each
draw. The hashed structure is not currently optimized.
5 years ago
ReinUsesLisp 322d6a0311 vk_update_descriptor: Initial implementation
The update descriptor is used to store in flat memory a large chunk of
staging data used to update descriptor sets through templates. It
provides a push interface to easily insert descriptors following the
current pipeline. The order used in the descriptor update template has
to be implicitly followed. We can catch bugs here using validation
layers.
5 years ago
ReinUsesLisp 5b01f80a12 vk_stream_buffer/vk_buffer_cache: Avoid halting and use generic cache
The stream buffer before this commit once it was full (no more bytes to
write before looping) waiting for all previous operations to finish.
This was a temporary solution and had a noticeable performance penalty
in performance (from what a profiler showed).

To avoid this mark with fences usages of the stream buffer and once it
loops wait for them to be signaled. On average this will never wait.
Each fence knows where its usage finishes, resulting in a non-paged
stream buffer.

On the other side, the buffer cache is reimplemented using the generic
buffer cache. It makes use of the staging buffer pool and the new
stream buffer.
5 years ago
ReinUsesLisp ceb851b590 vk_memory_manager: Misc changes
* Allocate memory in discrete exponentially increasing chunks until the
128 MiB threshold. Allocations larger thant that increase linearly by
256 MiB (depending on the required size). This allows to use small
allocations for small resources.

* Move memory maps to a RAII abstraction. To optimize for debugging
tools (like RenderDoc) users will map/unmap on usage. If this ever
becomes a noticeable overhead (from my profiling it doesn't) we can
transparently move to persistent memory maps without harming the API,
getting optimal performance for both gameplay and debugging.

* Improve messages on exceptional situations.

* Fix typos "requeriments" -> "requirements".

* Small style changes.
5 years ago
ReinUsesLisp 85bb6a6f08 vk_buffer_cache: Temporarily remove buffer cache
This is intended for a follow up commit to avoid circular dependencies.
5 years ago
bunnei 984563b773
Merge pull request #3277 from ReinUsesLisp/make-current
yuzu/bootmanager: Remove {glx,wgl}MakeCurrent on SwapBuffers
5 years ago
ReinUsesLisp 8306703a7d yuzu/bootmanager: Remove {glx,wgl}MakeCurrent on SwapBuffers
MakeCurrent is a costly (according to Nsight's profiler it takes a tenth
of a millisecond to complete), and we don't have a reason to call it
because:
- Qt no longer signals a warning if it's not called
- yuzu no longer supports macOS
5 years ago
bunnei 09908207fb
Merge pull request #3261 from degasus/page_table
core/memory + arm/dynarmic: Use a global offset within our arm page table.
5 years ago
bunnei 89fc75d769
Merge pull request #3257 from degasus/no_busy_loops
video_core: Block in WaitFence.
5 years ago
Fernando Sahmkow 56e450a3f7
Merge pull request #3264 from ReinUsesLisp/vk-descriptor-pool
vk_descriptor_pool: Initial implementation
5 years ago
bunnei 6fe51f398f
Merge pull request #2945 from FernandoS27/fix-bcat
nifm: Only return that there's an internet connection when there's a BCATServer
5 years ago
bunnei be5c149d37 service: time: Implement GetStandardLocalSystemClock. 5 years ago
bunnei cd0a7dfdbc
Merge pull request #3258 from FernandoS27/shader-amend
Shader_IR: add the ability to amend code in the shader ir.
5 years ago
bunnei 361285add9 time: Remove overflow error checking (currently breaks ADO builds). 5 years ago
bunnei a4e840181c service: time: Implement GetClockSnapshotFromSystemClockContext. 5 years ago
bunnei fab2607c6b service: time: Implement IsStandardNetworkSystemClockAccuracySufficient. 5 years ago
bunnei 4414640285 system_archive: Add a basic HLE implementation for time zone binary. 5 years ago
bunnei 78f977c980 service: time: Rewrite implementation of glue services. 5 years ago
Fernando Sahmkow 3dd6b55851 Shader_IR: Address Feedback 5 years ago
bunnei 5135b74179 core: Initialize several structs that make use of Common::UUID. 5 years ago
Fernando Sahmkow a1667a7b46 Shader_IR: Implement TXD Array.
This commit extends the compilation of TXD to support array samplers on
TXD.
5 years ago
bunnei 64c5631579 service: vi: Implement CloseLayer.
- Needed for Undertale.
5 years ago
Rodrigo Locatti 6e347d8d1b
Update src/video_core/renderer_vulkan/vk_descriptor_pool.cpp
Co-Authored-By: Mat M. <mathew1800@gmail.com>
5 years ago
bunnei 624a0f7f3f
Merge pull request #3247 from FernandoS27/remap-fix
NvServices: Correct Ioctl Remap.
5 years ago
ReinUsesLisp 0d6d8129c4 yuzu: Remove Maxwell debugger
This was carried from Citra and wasn't really used on yuzu. It also adds
some runtime overhead. This commit removes it from yuzu's codebase.
5 years ago
bunnei ae0e481677
Merge pull request #3243 from ReinUsesLisp/topologies
maxwell_to_gl: Implement missing primitive topologies
5 years ago
ReinUsesLisp 1fe7df4517 vk_descriptor_pool: Initial implementation
Create a large descriptor pool where we allocate all our descriptors
from. It has to be wide enough to support any pipeline, hence its large
numbers.

If the descritor pool is filled, we allocate more memory at that moment.
This way we can take advantage of permissive drivers like Nvidia's that
allocate more descriptors than what the spec requires.
5 years ago
Markus Wick 0986caa8d8 core/memory + arm/dynarmic: Use a global offset within our arm page table.
This saves us two x64 instructions per load/store instruction.

TODO: Clean up our memory code. We can use this optimization here as well.
5 years ago
bunnei 028b2718ed
Merge pull request #3239 from ReinUsesLisp/p2r
shader/p2r: Implement P2R Pr
5 years ago
Fernando Sahmkow b3371ed09e Shader_IR: add the ability to amend code in the shader ir.
This commit introduces a mechanism by which shader IR code can be
amended and extended. This useful for track algorithms where certain
information can derived from before the track such as indexes to array
samplers.
5 years ago
Fernando Sahmkow 7bd447355f
Merge pull request #3248 from ReinUsesLisp/vk-image
vk_image: Add an image object abstraction
5 years ago
Rodrigo Locatti 4cbb363d3f
vk_image: Avoid unnecesary equals 5 years ago
Fernando Sahmkow 287d5921cf
Merge pull request #3249 from ReinUsesLisp/vk-staging-buffer-pool
vk_staging_buffer_pool: Add a staging pool for temporary operations
5 years ago
Markus Wick cb9dd01ffd video_core: Block in WaitFence.
This function is called rarely and blocks quite often for a long time.
So don't waste power and let the CPU sleep.

This might also increase the performance as the other cores might be allowed to clock higher.
5 years ago
Rodrigo Locatti f2c61bbe13
vk_staging_buffer_pool: Initialize last epoch to zero 5 years ago
Fernando Sahmkow f846e3d6d0
Merge pull request #3250 from ReinUsesLisp/empty-fragment
gl_rasterizer: Allow rendering without fragment shader
5 years ago
bunnei 8a76f816a4
Merge pull request #3228 from ReinUsesLisp/ptp
shader/texture: Implement AOFFI and PTP for TLD4 and TLD4S
5 years ago
ReinUsesLisp 5b989f189f
gl_rasterizer: Allow rendering without fragment shader
Rendering without a fragment shader is usually used in depth-only
passes.
5 years ago
ReinUsesLisp 3813af2f3c
vk_staging_buffer_pool: Add a staging pool for temporary operations
The job of this abstraction is to provide staging buffers for temporary
operations. Think of image uploads or buffer uploads to device memory.

It automatically deletes unused buffers.
5 years ago
ReinUsesLisp c83bf7cd1e
vk_image: Add an image object abstraction
This object's job is to contain an image and manage its transitions.
Since Nvidia hardware doesn't know what a transition is but Vulkan
requires them anyway, we have to state track image subresources
individually.

To avoid the overhead of tracking each subresource in images with many
subresources (think of cubemap arrays with several mipmaps), this commit
tracks when subresources have diverged. As long as this doesn't happen
we can check the state of the first subresource (that will be shared
with all subresources) and update accordingly.

Image transitions are deferred to the scheduler command buffer.
5 years ago
Fernando Sahmkow a5bb1ac6e3 NvServices: Correct Ioctl Remap.
This commit corrects a padding value in Ioctl Remap that was actually an 
offset to the mapping address.
5 years ago
Fernando Sahmkow 5619d24377
Merge pull request #3244 from ReinUsesLisp/vk-fps
fixed_pipeline_state: Define structure and loaders
5 years ago
bunnei 4af569ee47
Merge pull request #3236 from ReinUsesLisp/rasterize-enable
gl_rasterizer: Implement RASTERIZE_ENABLE
5 years ago
ReinUsesLisp b9e3f5eb36
fixed_pipeline_state: Define symetric operator!= and mark as noexcept
Marks as noexcept Hash, operator== and operator!= for consistency.
5 years ago
ReinUsesLisp 4a3026b16b
fixed_pipeline_state: Define structure and loaders
The intention behind this hasheable structure is to describe the state
of fixed function pipeline state that gets compiled to a single graphics
pipeline state object. This is all dynamic state in OpenGL but Vulkan
wants it in an immutable state, even if hardware can edit it freely.

In this commit the structure is defined in an optimized state (it uses
booleans, has paddings and many data entries that can be packed to
single integers). This is intentional as an initial implementation that
is easier to debug, implement and review. It will be optimized in later
stages, or it might change if Vulkan gets more dynamic states.
5 years ago
ReinUsesLisp 5770418fb3
maxwell_3d: Add depth bounds registers 5 years ago
ReinUsesLisp 91d35559e5
maxwell_to_gl: Implement missing primitive topologies
Many of these topologies are exclusively available in OpenGL.
5 years ago
bunnei e976d0e924
Merge pull request #3241 from ReinUsesLisp/gl-shader-cache
gl_shader_cache: Style changes
5 years ago
bunnei 1e76655f83
Merge pull request #3238 from ReinUsesLisp/vk-resource-manager
vk_resource_manager: Catch device losses and other changes
5 years ago
bunnei 0f3ac9cfeb
Merge pull request #3203 from FernandoS27/tex-cache-fixes
Texture Cache: Add HLE methods for building 3D textures
5 years ago
Fernando Sahmkow 3dc585d011
Merge pull request #3237 from ReinUsesLisp/vk-shader-decompiler
vk_shader_decompiler: Misc changes
5 years ago
Fernando Sahmkow 218ee18417 Texture Cache: Improve documentation 5 years ago
Fernando Sahmkow a3916588b6 Texture Cache: Address Feedback 5 years ago
Fernando Sahmkow 51c9e98677 Texture Cache: Add HLE methods for building 3D textures within the GPU in certain scenarios.
This commit adds a series of HLE methods for handling 3D textures in
general. This helps games that generate 3D textures on every frame and
may reduce loading times for certain games.
5 years ago
Fernando Sahmkow aea978e037
Merge pull request #3230 from ReinUsesLisp/vk-emu-shaders
renderer_vulkan/shader: Add helper GLSL shaders
5 years ago
Fernando Sahmkow 27efcc15e9
Merge pull request #3240 from ReinUsesLisp/decomp-cond-code
vk_shader_decompiler: Use Visit instead of reimplementing it
5 years ago
bunnei 16dcfacbfc
Merge pull request #3235 from ReinUsesLisp/ldg-u8
shader/memory: Implement LDG.U8 and unaligned U8 loads
5 years ago