Commit Graph

5701 Commits (48cf3764626e1ed30450d15e00befb75a4eae329)

Author SHA1 Message Date
Feng Chen 70d51f72ec
vulkan_device: Add missing vulkan image format R5G6B5 in GetFormatProperties
- Used by Dragon Quest Builders
3 years ago
Morph d607ceacf4 gl_rasterizer: Remove unused includes
This removes unused includes, especially the core includes which were causing this file to be recompiled every time files included by those headers are modified.
3 years ago
lat9nq 61121d1b22 gl_device: Force GLASM on NVIDIA drivers 495-496
GLSL shaders currently do not render correctly on the recent NVIDIA
drivers. This adds a check that forces assembly shaders for these
drivers since they seem unaffected and adds a warning informing of the
decision.

Developers can disable the check by enabling graphics debugging.
4 years ago
Fernando S 5299554bb0
Merge pull request #7206 from vonchenplus/fix_vulkan_viewport_issue
Vulkan Rasterizer: Fix viewport issue
4 years ago
Ameer J 494e34af6a
Merge pull request #7070 from FernandoS27/want-you-bad
Vulkan Rasterizer: Correct DepthBias/PolygonOffset on Vulkan.
4 years ago
Fernando Sahmkow ad8afaf1ef Vulran Rasterizer: address feedback. 4 years ago
Feng Chen b769bea61b Fix vulkan viewport issue 4 years ago
bunnei c871320760
Merge pull request #7198 from ameerj/settings-chrono
settings: Remove std::chrono usage
4 years ago
ameerj ef811c6425 settings: Remove std::chrono usage
Alleviates the dependency on chrono for all files that include settings.h
4 years ago
Ameer J 3791c7ca82
Merge pull request #7077 from FernandoS27/face-down
A series of fixes to queries and indexed samplers.
4 years ago
Ameer J 5b735a4c9d
Merge pull request #7127 from FernandoS27/i-saw-a-wabbit
A few fixes on Vulkan and Rasterizer Caching
4 years ago
Morph 894b483a0d
Merge pull request #7157 from ameerj/vic-surface-size
vic: Use the minimum of surface/frame dimensions when writing the final frame to the GPU
4 years ago
Ameer J 018cf3853e
Merge pull request #7109 from vonchenplus/fix_h264_max__reference_num_error
h264: Use max allowed max_num_ref_frames when using CPU decoding
4 years ago
ameerj f346b04d12 vic: Use the minimum of surface/frame dimensions when writing the final frame to the GPU
Addresses possible buffer overflow behavior.
4 years ago
Feng Chen ba8be75037 h264: Use max allowed max_num_ref_frames when using CPU decoding 4 years ago
Valeri 0394e4bb8e
vic: Allow surface to be higher than frame
Touhou Genso Wanderer Lotus Labyrinth R decodes 1920x1080 videos into 1920x1088 surface.
Only allow mismatch for height, since larger width would result in increasingly offset rows and somewhat defeat entire purpose of this check.
4 years ago
ameerj 403fc86c11 vic: Avoid memory corruption when multiple streams with different dimensions are decoded
This is a work around to avoid buffer overflow errors until multi channel/multi stream decoding is supported.
4 years ago
ameerj 5aae61775f vic: Refactor frame writing methods 4 years ago
ameerj 899fdb9c44 vic: Implement RGBX frame format 4 years ago
Fernando S f84328934f
Merge pull request #7118 from ameerj/vc-gpu-impl
gpu: Migrate implementation to the cpp file
4 years ago
bunnei 5b2fa8dd41
Merge pull request #7115 from ameerj/log-compile
common/logging: Reduce dependent header include overhead
4 years ago
bunnei 158a693111
Merge pull request #7101 from ameerj/vk-tess-topology
vk_graphics_pipeline: Force patch list topology when tessellation is used
4 years ago
Fernando Sahmkow 0498669b4b Vulkan: Fix failing barrier on refresh. 4 years ago
FernandoS27 bb8bf740e9 RasterizerInterface: Correct size of CPU addresses to cache. 4 years ago
FernandoS27 7f4de3466a Vulkan: Fix the master Semaphore 4 years ago
ameerj 6c0d902373 nvhost_ctrl: Refactor usage of gpu.LockSync()
This seems to only be used to protect a later gpu function call. So we can move the lock into that call instead.
4 years ago
ameerj 427bf76e62 gpu: Migrate implementation to the cpp file 4 years ago
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
4 years ago
bunnei 8bd5742349
Merge pull request #7061 from ameerj/dma-buffer-misc
buffer_cache, maxwell_dma: Minor refactoring and code fixes
4 years ago
bunnei 91341b421d
Merge pull request #7036 from ameerj/ogl-bgr-v2
gl_texture_cache: Unify BGR copy passes using PBOs
4 years ago
ameerj 6f35fb8d26 vk_graphics_pipeline: Force patch list topology when tessellation is used
Fixes a crash on some drivers when tessellation is used but the IA topology is not patch list.
4 years ago
bunnei 24c0dde958
Merge pull request #7076 from ameerj/amd-botw
vk_texture_cache: Disable cube compatibility flag on non-mesa AMD GCN4 and earlier
4 years ago
Morph 5114819b6b
Merge pull request #7078 from ameerj/vc-jthread-fixes
video_core: Fix jthread related hangs when stopping emulation
4 years ago
ameerj 73666fb262 general: Update style to clang-format-12 4 years ago
ameerj ab63a193d7 video_core: Fix jthread related hangs when stopping emulation
jthread on some compilers is more picky when it comes to the order in which objects are destroyed.
4 years ago
ameerj 1e1ecca691 vk_texture_cache: Disable cube compatibility flag on non-mesa AMD GCN4 and earlier
Fixes rainbow textures on BOTW.
4 years ago
Fernando Sahmkow d702b393a4 Vulkan Query Cache: make sure to wait for the query result. 4 years ago
Fernando Sahmkow 8fdb51ab46 QueryCache: Flush queries in order of running. 4 years ago
Fernando Sahmkow 60a3980561 Vulkan Rasterizer: Correct DepthBias/PolygonOffset on Vulkan. 4 years ago
bunnei 7b22d61fb1
Merge pull request #7003 from ameerj/unlocked-present-mode
vk_swapchain: Use immediate present mode when mailbox is unavailable and FPS is unlocked
4 years ago
ameerj 24049591f6 maxwell_dma: Minor refactoring 4 years ago
ameerj 1ea8073783 buffer_cache: Minor fixes
Loop through the tmp_intervals by reference, rather than by copy, and fix gl clear buffer size calculation.
4 years ago
bunnei a9c3619d26
Merge pull request #7019 from ameerj/videocore-jthread
videocore: Use std::jthread for worker threads
4 years ago
bunnei ff54d9615f
Merge pull request #7011 from ameerj/vk-validation-0x0
vulkan_debug_callback: Ignore InvalidCommandBuffer-VkDescriptorSet errors
4 years ago
ameerj 22162f906b host_shaders: Remove opengl_copy_bgra.comp 4 years ago
ameerj ab808fe7cf gl_texture_cache: Migrate BGRCopyPass from util_shaders
The BGR copies no longer use shaders.
4 years ago
Fernando S a606b1448b
Merge pull request #7027 from ameerj/sorry-amd
vulkan_device: Reorder Float16Int8 declaration
4 years ago
ameerj e3c153efa4 vulkan_device: Reorder Float16Int8 declaration
This variable was going out of scope before its usage in the vulkan device creation, causing a crash on very specific drivers.
4 years ago
ameerj 5601e1cb00 Revert "Merge pull request #7006 from FernandoS27/a-motherfucking-driver"
This reverts commit 62e88d0e74, reversing
changes made to edf3da346f.
4 years ago
ameerj 7f737b022a util_shaders: Unify BGRA copy passes 4 years ago
ameerj 84f7e7e91c vk_scheduler: Use std::jthread 4 years ago
ameerj 877cd60b00 gpu: Use std::jthread for async gpu thread 4 years ago
Morph 2df2b3719a renderers: Log total pipeline count 4 years ago
ameerj db1c4b125f vulkan_debug_callback: Ignore InvalidCommandBuffer-VkDescriptorSet errors
This validation error is spammed on some titles, asserting that VkDescriptorSet 0x0[] was destroyed.

This is likely a validation layer bug when using VK_KHR_push_descriptor, which can avoid using traditional VkDescriptorSet. It should be safe to ignore for now.
4 years ago
Morph d86a9b9a4b
Merge pull request #6943 from FernandoS27/omae-wa-mou-shindeiru
Vulkan: Disable VK_EXT_SAMPLER_FILTER_MINMAX in GCN AMD
4 years ago
Fernando Sahmkow 7a712da2b3 Vulkan: Disable VK_EXT_SAMPLER_FILTER_MINMAX in GCN AMD since it's broken. 4 years ago
Morph 62e88d0e74
Merge pull request #7006 from FernandoS27/a-motherfucking-driver
Vulkan: Blacklist Int8Float16 Extension on AMD on driver 21.9.1
4 years ago
Morph fde9b84b21
Merge pull request #6944 from FernandoS27/dear-drunk-me
Vulkan/Descriptors: Increase sets per pool on AMD propietary driver.
4 years ago
Fernando Sahmkow e7c8a0bb23 Vulkan: Blacklist Int8Float16 Extension on AMD on driver 21.9.1 4 years ago
Fernando S 1bb28dfe2c
Merge pull request #7001 from ameerj/wario-fix
vk_rasterizer: Fix dynamic StencilOp updating when two faces are enabled
4 years ago
Fernando Sahmkow e7ca37b1e5 Vulkan/Descriptors: Increase sets per pool on AMFD propietary driver. 4 years ago
ameerj 35e5a67a83 vk_swapchain: Use immediate present mode when mailbox is unavailable and FPS is unlocked
Allows drivers that do not support VK_PRESENT_MODE_MAILBOX_KHR the ability to present at a framerate higher than the monitor's refresh rate when the FPS is unlocked.
4 years ago
Mai M e4318d2207
Merge pull request #7002 from ameerj/vk-state-unused
vk_state_tracker: Remove unused function
4 years ago
ameerj 678f73069f vk_rasterizer: Fix dynamic StencilOp updating when two faces are enabled
This function was incorrectly using the stencil_two_side_enable register when dynamically updating the StencilOp.
4 years ago
ameerj 8e289ade15 vk_state_tracker: Remove unused function 4 years ago
Morph e67463df24 shader_environment: Add missing <algorithm> include 4 years ago
Morph 63b4c8f9f7 vk_descriptor_pool: Add missing <algorithm> include 4 years ago
Morph 76abf55f25 slot_vector: Add missing <algorithm> include 4 years ago
Morph 554c46d186 video_core/memory_manager: Add missing <algorithm> include 4 years ago
Morph ae028ddf22 codec: Add missing <string_view> include 4 years ago
Fernando S be4e192903
Merge pull request #6846 from ameerj/nvdec-gpu-decode
nvdec: Add GPU video decoding for all capable drivers and platforms
4 years ago
Fernando S 82c867164b
Merge pull request #6901 from ameerj/vk-clear-bits
vk_rasterizer: Only clear depth/stencil buffers when specified in attachment aspect mask
4 years ago
Fernando S ec6490f5ad
Merge pull request #6941 from ameerj/swapchain-srgb
vk_swapchain: Prefer linear swapchain format when presenting sRGB images
4 years ago
Fernando S 472aad69db
Merge pull request #6953 from ameerj/anv-semaphore
renderer_vulkan: Wait on present semaphore at queue submit
4 years ago
Feng Chen 0292374807 Fix blend equation enum error 4 years ago
ameerj 7d854fbdb0 renderer_vulkan: Wait on present semaphore at queue submit
The present semaphore is being signalled by the call to acquire the
swapchain image. This semaphore is meant to be waited on when rendering
to the swapchain image. Currently it is waited on when presenting, but
moving its usage to be waited on in the command buffer submission allows
for proper usage of this semaphore.

Fixes the device lost when launching titles on the Intel Linux Mesa driver.
4 years ago
bunnei b2572a56d3
Merge pull request #6900 from ameerj/attr-reorder
structured_control_flow: Add DemoteCombinationPass
4 years ago
bunnei 956171f024
Merge pull request #6897 from FernandoS27/pineapple-does-not-belong-in-pizza
Project <tentative title>: Rework Garbage Collection.
4 years ago
bunnei ec19d9594f
Merge pull request #6879 from ameerj/decoder-assert
vk_blit_screen: Fix non-accelerated texture size calculation
4 years ago
ameerj 4fda7f1c82 structured_control_flow: Conditionally invoke demote reorder pass
This is only needed on select drivers when a fragment shader discards/demotes.
4 years ago
Fernando Sahmkow fe0acec539 Garbage Collection: Make it more agressive on high priority mode. 4 years ago
Fernando Sahmkow ff48f06fb9 Garbage Collection: Adress Feedback. 4 years ago
ameerj 27f8f3333f vulkan_device: Enable VK_KHR_swapchain_mutable_format if available
Silences validation errors when creating sRGB image views of linear swapchain images
4 years ago
ameerj 3c65c8580f vk_swapchain: Prefer linear swapchain format when presenting sRGB images
Fixes broken sRGB when presenting from a secondary GPU.
4 years ago
Fernando Sahmkow ba82bb359b Garbage Collection: enable as default, eliminate option. 4 years ago
Fernando Sahmkow d540d284b5 VideoCore: Rework Garbage Collection. 4 years ago
ameerj eb2624ed65 vp9_types: Minor refactor of VP9 info structs. 4 years ago
ameerj 3de38c9a70 vp9_types: Remove unused Vp9PictureInfo members 4 years ago
Fernando S 3843995ceb
Merge pull request #6919 from ameerj/vk-int8-capability
vulkan_device: Add a check for int8 support
4 years ago
Ameer J de71a4d70d
Merge pull request #6894 from FernandoS27/bunneis-left-ear
GPU_MemoryManger: Fix GetSubmappedRange.
4 years ago
ameerj 4d535799eb vulkan_device: Add a check for int8 support
Silences validation errors when shaders use int8 without specifying its support to the API
4 years ago
ameerj e0397f00d0 vk_rasterizer: Only clear depth and stencil buffers when set in attachment aspect mask
Silences validation errors for clearing the depth/stencil buffers of framebuffer attachments that were not specified to have depth/stencil usage.
4 years ago
Ameer J bde6b899a1
Merge pull request #6888 from v1993/patch-3
video_core: eliminate constant ternary
4 years ago
Fernando Sahmkow ef2066b272 GPU_MemoryManger: Fix GetSubmappedRange. 4 years ago
Valeri 4fd655cb46
video_core: eliminate constant ternary
`via_header_index` is already checked above, so it would never be true in this branch
4 years ago
ameerj b384129c63 h264: Lower max_num_ref_frames
GPU decoding seems to be more picky when it comes to the maximum number of reference frames.
4 years ago
ameerj cd016d3cb5 configure_graphics: Add GPU nvdec decoding as an option
Some system configurations may see visual regressions or lower performance using GPU decoding compared to CPU decoding. This setting provides the option for users to specify their decoding preference.

Co-Authored-By: yzct12345 <87620833+yzct12345@users.noreply.github.com>
4 years ago
ameerj a832aa699f codec: Improve libav memory alloc and cleanup 4 years ago
ameerj bc3efb79cc codec: Fallback to CPU decoding if no compatible GPU format is found 4 years ago
lat9nq 92bc51b66a cmake: Add VDPAU and NVDEC support to FFmpeg
Adds {h264_,vp9_}{nvdec,vdpau} hwaccels.
4 years ago
ameerj 537c6ac8fe vk_blit_screen: Fix non-accelerated texture size calculation
Addresses the potential OOB access in UnswizzleTexture.
4 years ago
Merry 1770503185 xbyak: Update include path 4 years ago
bunnei 87d63b858a
Merge pull request #6861 from yzct12345/const-mempy-is-all-the-speed
decoders: Optimize memcpy for the other functions
4 years ago
bunnei 0509fe3377
Merge pull request #6838 from ameerj/sws-align
vic: Specify sws_scale height stride.
4 years ago
ameerj 356e10898f codec: Replace deprecated av_init_packet usage 4 years ago
ameerj 659039ca6d nvdec: Implement GPU accelerated decoding for all platforms
Supplements the VAAPI intel gpu decoder by implementing the D3D11VA decoder for Windows, and CUVID/VDPAU for Nvidia and AMD on drivers linux respectively.
4 years ago
yzct12345 430255caf8
decoders: Templates allow memcpy optimizations 4 years ago
Fernando S 6a082df427
Merge pull request #6820 from yzct12345/split-cache
texture_cache: Split out template definitions
4 years ago
ameerj a779cede7c vic: Specify sws_scale height stride.
Silences a sws_scale runtime warning about unaligned strides.
4 years ago
Mai M 2da91ec75b
Merge pull request #6844 from ameerj/vp9-empty-frame
vp9: Ensure the first frame is complete
4 years ago
ameerj fa22695705 vp9: Ensure the first frame is complete
Silences a runtime error due to the first frame missing the frame data, and being set to hidden despite being a key-frame.
4 years ago
yzct12345 c4eafcc861
texture_cache: Address ameerj's review 4 years ago
Fernando S 859deda3bb
Merge pull request #6834 from K0bin/buffer-image-granularity
Respect Vulkan bufferImageGranularity
4 years ago
bunnei bd0e1d3a25
Merge pull request #6830 from ameerj/nvdec-unimpld-codec
nvdec: Better logging for unimplemented codecs
4 years ago
Robin Kertels bb29dcb7f2
vulkan_memory_allocator: Respect bufferImageGranularity 4 years ago
ameerj 928b64d2ce nvdec: Better logging for unimplemented codecs 4 years ago
bunnei 268b5764c7
Merge pull request #6791 from ameerj/astc-opt
astc_decoder: Various performance and memory optimizations
4 years ago
yzct12345 e80323b8b0
texture_cache: Address ameerj's review 4 years ago
bunnei f183668a87
Merge pull request #6799 from ameerj/vp9-fixes
nvdec: Fix VP9 reference frame refreshes
4 years ago
ameerj e3688f0627 vp9: Cleanup unused variables
With reference frames refreshes fix, we no longer need to buffer two frames in advance.
We can also remove other unused or otherwise unneeded variables.
4 years ago
ameerj a3f80a97a3 vp9: Fix reference frame refreshes
This resolves the artifacting when decoding VP9 streams.
4 years ago
yzct12345 02e98f6c93
texture_cache: Don't change copyright year 4 years ago
yzct12345 5566f3dbc0
texture_cache: Address ameerj's review 4 years ago
yzct12345 f9563c8f24
texture_cache: Split templates out 4 years ago
yzct12345 2868d4ba84
nvdec: Implement VA-API hardware video acceleration (#6713)
* nvdec: VA-API

* Verify formatting

* Forgot a semicolon for Windows

* Clarify comment about AV_PIX_FMT_NV12

* Fix assert log spam from missing negation

* vic: Remove forgotten debug code

* Address lioncash's review

* Mention VA-API is Intel/AMD

* Address v1993's review

* Hopefully fix CMakeLists style this time

* vic: Improve cache locality

* vic: Fix off-by-one error

* codec: Async

* codec: Forgot the GetValue()

* nvdec: Address ameerj's review

* codec: Fallback to CPU without VA-API support

* cmake: Address lat9nq's review

* cmake: Make VA-API optional

* vaapi: Multiple GPU

* Apply suggestions from code review

Co-authored-by: Ameer J <52414509+ameerj@users.noreply.github.com>

* nvdec: Address ameerj's review

* codec: Use anonymous instead of static

* nvdec: Remove enum and fix memory leak

* nvdec: Address ameerj's review

* codec: Remove preparation for threading

Co-authored-by: Ameer J <52414509+ameerj@users.noreply.github.com>
4 years ago
yzct12345 f56d0db5bd
decoders: Optimize swizzle copy performance (#6790)
This makes UnswizzleTexture up to two times faster. It is the main bottleneck in NVDEC video decoding.
4 years ago
Fernando S 30f0b7cf31
Merge pull request #6720 from ameerj/vk-screenshot
renderer_vulkan: Implement screenshots
4 years ago
Ameer J db32c3762b
Merge pull request #6765 from ReinUsesLisp/y-negate-vk
vk_rasterizer: Flip viewport on Y_NEGATE
4 years ago
ameerj c439fc9be9 astc_decoder: Reduce workgroup size
This reduces the amount of over dispatching when there are odd dimensions (i.e. ASTC 8x5), which rarely evenly divide into 32x32.
4 years ago
ameerj 5ab8053511 astc_decoder: Compute offset swizzles in-shader
Alleviates the dependency on the swizzle table and a uniform which is constant for all ASTC texture sizes.
4 years ago
ameerj b2862e4772 astc_decoder: Make use of uvec4 for payload data 4 years ago
ameerj a75d70fa90 astc_decoder: Simplify Select2DPartition 4 years ago
ameerj 5665d05547 astc_decoder: Optimize the use EncodingData
This buffer was a list of EncodingData structures sorted by their bit length, with some duplication from the cpu decoder implementation.
We can take advantage of its sorted property to optimize its usage in the shader.

Thanks to wwylele for the optimization idea.
4 years ago
ameerj 15c0c213b1 astc.h: Move data to cpp implementation
Moves leftover values that are no longer used by the gpu decoder back to the cpp implementation.
4 years ago
bunnei 7530594602
Merge pull request #6759 from ReinUsesLisp/pipeline-statistics
renderer_vulkan: Add setting to log pipeline statistics
4 years ago
ReinUsesLisp b185567a03 vk_rasterizer: Flip viewport on Y_NEGATE
Matches OpenGL's behavior. I don't believe this register flips geometry,
but we have to try to match behavior on both backends.
4 years ago
ameerj 7ac99bb127 renderers: Add explicit invert_y bool to screenshot callback
OpenGL and Vulkan images render in different coordinate systems. This allows us to specify the coordinate system of the screenshot within each renderer
4 years ago
ameerj 75e7f54fb0 renderer_vulkan: Implement screenshots 4 years ago
ameerj 548bac8989 vk_blit_screen: Add public CreateFramebuffer method 4 years ago
ameerj 1e6c5d323d vk_blit_screen: Make Draw method more generic
Allows specifying the framebuffer and render area dimensions, rather than being hard coded for the render window.
4 years ago
ReinUsesLisp 3b006f4fe2 renderer_vulkan: Add setting to log pipeline statistics
Use VK_KHR_pipeline_executable_properties when enabled and available to
log statistics about the pipeline cache in a game.

For example, this is on Turing GPUs when generating a pipeline cache
from Super Smash Bros. Ultimate:

Average pipeline statistics
==========================================
Code size:       6433.167
Register count:    32.939

More advanced results could be presented, at the moment it's just an
average of all 3D and compute pipelines.
4 years ago
bunnei 92887a65f0
Merge pull request #6749 from lioncash/rtarget
render_target: Add missing initializer for size extent
4 years ago
Rodrigo Locatti ab206d6378
Merge pull request #6748 from lioncash/engine-init
video_core/engine: Consistently initialize rasterizer pointers
4 years ago
bunnei 2717e79c74
Merge pull request #6745 from lioncash/copies
video_core: Remove some unused variables
4 years ago
Lioncash 00e100de08 render_target: Add missing initializer for size extent
Everything else has a default constructor that does the straightforward
thing of initializing most members to a default value, except for the
size.

We explicitly initialize the size (and others, for consistency), to
prevent potential uninitialized reads from occurring. Particularly given
the largeish surface area that this struct is used in.
4 years ago
Lioncash f8964dd89a video_core/engine: Consistently initialize rasterizer pointers
Ensures all of the engines have consistent and deterministic
initialization of the rasterizer pointers.
4 years ago
Lioncash 8c82c594f0 vulkan_wrapper: Fix SetObjectName() always indicating objects as images
We should be using the passed in object type instead.
4 years ago
Lioncash ec56a17acd buffer_cache: Remove unused small_vector in CommitAsyncFlushesHigh()
Given this is non-trivial, the constructor is required to execute, so
this removes a bit of redundant codegen.
4 years ago
Lioncash 075a744e38 gl_shader_cache: Remove unused variable 4 years ago
Lioncash 296728ec46 vk_compute_pass: Remove unused captures
Resolves two compiler warnings.
4 years ago