summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-12-08video_core: Integrate SMAALiam5-2/+873
Co-authored-by: goldenx86 <goldenx86@users.noreply.github.com> Co-authored-by: BreadFish64 <breadfish64@users.noreply.github.com>
2022-12-08video_core: The draw manager manages whether Clear is required.FengChen1-3/+0
2022-12-08video_core: Implement maxwell3d draw manager and split draw logicFeng Chen3-11/+16
2022-12-05Vulkan: Implement Alpha coverageFernando Sahmkow3-2/+6
2022-12-04vulkan_common: clean up extension usageLiam8-21/+21
2022-12-04vulkan_common: promote host query reset usage to coreLiam1-1/+1
2022-12-04vulkan_common: promote descriptor update template usage to coreLiam5-16/+16
2022-12-01shader_recompiler: add gl_Layer translation GS for older hardwareLiam1-1/+32
2022-11-27Vulkan: update initializationLiam1-2/+2
Co-authored-by: bylaws <bylaws@users.noreply.github.com>
2022-11-24GPU: Implement additional render target formats.Fernando Sahmkow1-0/+1
2022-11-24Fermi2D: Rework blit engine and add a software blitter.Fernando Sahmkow1-2/+1
2022-11-24FSR Sharpening Slider part 1 - only a global sliderMatías Locatti1-1/+5
2022-11-24maxwell_to_vk: Add R16_SINTMorph1-1/+1
This was somehow missed when the format was added to GL
2022-11-24maxwell_to_vk: Fix format usage bitsMorph1-2/+2
- VK_FORMAT_B8G8R8A8_UNORM supports the STORAGE_IMAGE_BIT - VK_FORMAT_R4G4B4A4_UNORM_PACK16 does not support the COLOR_ATTACHMENT_BIT
2022-11-23general: fix compile for Apple ClangLiam8-2/+8
2022-11-17maxwell3d: full HLE for multi-layer clearsLiam2-3/+3
2022-11-16Update renderer_vulkan.cppMatías Locatti1-0/+4
2022-11-15video_core: Reimplement inline index buffer bindingFeng Chen2-17/+0
2022-11-14Add break for default casesKyle Kienapfel2-0/+2
Visual Studio has an option to search all files in a solution, so I did a search in there for "default:" looking for any missing break statements. I've left out default statements that return something, and that throw something, even if via ThrowInvalidType. UNREACHABLE leads towards throw R_THROW macro leads towards a return
2022-11-11Fix regs regression with OpenGL two-sided stencil, and re-add data invalidation regKelebek13-0/+14
2022-11-11ir/texture_pass: Use host_info instead of querying Settings::values (#9176)Morph3-2/+3
2022-11-07video_core: Fix few issues in Tess stageFengChen1-0/+1
2022-11-05video_core: Fix scaling graphical regressions for multiple gamesFengChen1-4/+4
2022-11-04Update shader cache version. (#9175)gidoly1-1/+1
2022-11-04video_core: Fix SNORM texture buffer emulating error (#9001)Feng Chen2-7/+7
2022-10-30Vulkan: Fix regression caused by limiting render area to width/height of rendef targets.Fernando Sahmkow1-6/+6
2022-10-30vk_blit_screen: recreate swapchain images on guest format changeLiam2-1/+10
2022-10-28vk_scheduler: Remove recorded_countsRobin Kertels1-3/+1
2022-10-25video_core: Catch vulkan clear op not all channel need clearFengChen1-8/+13
2022-10-22video_core: Implement maxwell inline_index methodFengChen2-0/+17
2022-10-21video_coare: Reimplementing the maxwell drawing trigger mechanismFengChen2-7/+6
2022-10-20video_core: don't build ASTC decoder shader unless requestedLiam4-14/+19
2022-10-19video_core: renderer_vulkan: vk_query_cache: Avoid shutdown crash in QueryPool::Reserve.bunnei1-3/+4
2022-10-13renderer_(opengl/vulkan): Fix tessellation clockwise parameterMorph1-2/+2
This should be assigned CW only on Triangles_CW rather than not Triangles_CCW, making CCW the default winding order rather than CW.
2022-10-10Fix stencil func registers, make clip control equivalent to how it was before, but surely wrong.Kelebek13-15/+17
2022-10-07Update 3D regsKelebek18-439/+457
2022-10-07Revert "vulkan: automatically use larger staging buffer sizes when possible"liamwhite2-60/+27
2022-10-06vulkan_blitter: Fix pool allocation double free.Byte2-5/+10
2022-10-06state_tracker: workaround channel setup for homebrewLiam2-1/+3
2022-10-06Address Feedback from bylaws.Fernando Sahmkow1-1/+1
2022-10-06General: Fix clang format.Fernando Sahmkow1-9/+4
2022-10-06Vulkan Swapchain: Overall improvements.Fernando Sahmkow2-4/+13
2022-10-06Vulkan Texture Cache: Limit render area to the max width/height of the targets.Fernando Sahmkow2-9/+26
2022-10-06VideoCore: Implement formats needed for N64 emulation.Fernando Sahmkow2-2/+2
2022-10-06DMA & InlineToMemory Engines Rework.bunnei3-4/+2
2022-10-06Shader Decompiler: Check for shift when deriving composite samplers.Fernando Sahmkow2-4/+5
2022-10-06VideoCore: Refactor fencing system.Fernando Sahmkow4-31/+16
2022-10-06Vulkan: Fix Scissor on ClearsFernando Sahmkow1-1/+8
2022-10-06NVDRV: Further refactors and eliminate old code.Fernando Sahmkow1-4/+0
2022-10-06Texture cache: Fix the remaining issues with memory mnagement and unmapping.Fernando Sahmkow2-3/+3
2022-10-06VideoCore: Fix channels with disk pipeline/shader cache.Fernando Sahmkow4-24/+31
2022-10-06OpenGl: Implement Channels.Fernando Sahmkow4-6/+10
2022-10-06VideoCore: implement channels on gpu caches.Fernando Sahmkow11-79/+134
2022-10-06Texture Cache: Add ASTC 10x5 Format.Fernando Sahmkow1-0/+2
2022-10-04vk_scheduler: wait for command processing to completeLiam1-2/+4
2022-10-04common: remove "yuzu:" prefix from thread namesLiam2-3/+3
2022-09-25vulkan: automatically use larger staging buffer sizes when possibleLiam2-27/+60
2022-09-20video_core: Fix legacy to generic location unpairedFengChen1-0/+1
2022-09-20video_core: Generate mipmap texture by drawingFengChen4-6/+48
2022-08-31(shader/pipeline)_cache: Raise shader/pipeline cache versionMorph1-1/+1
Since the following commit: https://github.com/yuzu-emu/yuzu/commit/a83a5d2e4c8932df864dd4cea2b04d87a12c8760 , many games will refuse to boot unless the shader/pipeline cache has been invalidated.
2022-08-25video_code: support rectangle textureFengChen2-7/+6
2022-08-24video_core: vulkan: rasterizer: Workaround on viewport swizzle on AMDNarr the Reg1-1/+8
2022-08-20video_core: support framebuffer crop rect top not zerovonchenplus1-6/+12
2022-08-19video_core: implement R16G16B16X16 texture formatLiam1-1/+1
2022-08-08Make vsync setting work for VulkanDJRobX1-2/+3
2022-08-03renderer_vulkan: add format fallbacks for R16G16B16_SFLOAT, R16G16B16_SSCALED, R8G8B8_SSCALEDLiam4-183/+193
2022-08-02vk_texture_cache: return VK_NULL_HANDLE for views of null imagesLiam1-0/+12
2022-07-30video_core: stop waiting for shader compilation on user cancelLiam1-1/+1
2022-07-28video_core: differentiate between tiled and untiled framebuffer sizes for unaccelerated copiesLiam1-9/+7
2022-07-19video_core: use correct byte size for framebufferLiam1-5/+8
2022-07-17yuzu: settings: Remove framerate cap and merge unlocked framerate setting.bunnei1-3/+3
- These were all somewhat redundant.
2022-07-06renderer_(gl/vk): Implement ASTC_10x6_UNORMMorph1-0/+1
- Used by Monster Hunter Rise Update 10.0.2
2022-06-27video_core: Replace VKUpdateDescriptorQueue with UpdateDescriptorQueuegerman7714-33/+33
2022-06-27video_core: Replace VKSwapchain with Swapchaingerman775-25/+23
2022-06-27video_core: Replace VKQueryCache with QueryCachegerman776-28/+27
2022-06-27video_core: Replace VKScheduler with Schedulergerman7735-111/+110
2022-06-27video_core: Replace VKBlitScreen with BlitScreengerman773-51/+51
2022-06-27video_core: Replace VKFenceManager with FenceManagergerman773-15/+14
2022-06-15vk_compute_pass: Explicitly cast to VkAccessFlagsMorph1-25/+26
According to the standard, a narrowing conversion is an implicit conversion from an integer or unscoped enumeration type to an integer type that cannot represent all the values of the original type, except when the value is a literal or constant expression. MSVC, unlike GCC or Clang, determines this to be a narrowing conversion despite the enumeration exclusively containing values that fit within the range of a 32 bit integer, emitting a warning since designated initializers prohibit narrowing conversions. To solve this, explicitly cast to the type we are initializing.
2022-06-14vk_compute_pass: Use VK_ACCESS_NONEMorph1-1/+1
This enumeration was introduced in Vulkan 1.3, prefer using this instead of defaulting the enum. Also resolves a narrowing conversion warning on MSVC.
2022-06-14vk_compute_pass: Silence Wextra warningMorph1-1/+1
Silences a warning about using enumerated and non-enumerated types in a conditional expression.
2022-06-14common: Change semantics of UNREACHABLE to unconditionally crashLiam6-24/+24
2022-05-06vk_rasterizer: fix stencil test when two faces are disabledLody1-2/+2
2022-04-26renderer_vulkan: Update screen info if the framebuffer size has changedMorph1-0/+5
2022-04-23general: Convert source file copyright comments over to SPDXMorph56-168/+112
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-14video_core: implement formats for N64 emulationFernando Sahmkow2-7/+44
2022-04-07video_core: Replace lock_guard with scoped_lockMerry6-10/+10
2022-04-04Vulkan: crop to screen dimensions if crop not explicitly requestedLiam1-2/+3
2022-03-26Revert "Memory GPU <-> CPU: reduce infighting in the texture cache by adding CPU Cached memory."bunnei1-5/+1
2022-03-25Texture Cache: Add Cached CPU system.Fernando Sahmkow1-1/+5
2022-03-25hle: nvflinger: Migrate android namespace -> Service::android.bunnei1-5/+5
2022-03-25hle: nvflinger: Move PixelFormat to its own header.bunnei1-5/+5
2022-03-25Garbage Collection: Final tuning.Fernando Sahmkow1-1/+1
2022-03-25Buffer Cache: Tune to the levels of the new GC.Fernando Sahmkow2-0/+18
2022-03-25Garbage Collection: Redesign the algorithm to do a better use of memory.Fernando Sahmkow3-1/+14
2022-03-24Vulkan: Use 3D helpers for MSAA scaling on NV drivers 510+ameerj2-7/+3
Nvidia Vulkan drivers 510+ crash when blitting MSAA images. Fall-back to 3D scale helpers for MSAA image scaling.
2022-03-20general: Fix clang/gcc build errorsameerj1-0/+1
2022-03-19video_core: Reduce unused includesameerj23-43/+1
2022-03-18general: Reduce core.h includesameerj1-1/+0
2022-03-18vk_texture_cache: Do not reinterpret DepthStencil source imagesameerj1-5/+0
Fixes star pointer interactions in Super Mario Galaxy on some drivers, notably Nvidia. Co-Authored-By: Fernando S. <1731197+fernandos27@users.noreply.github.com>
2022-03-16Vulkan: convert S8D24 <-> ABGR8Liam3-2/+17
2022-03-12emit_spirv, vk_compute_pass: Resolve VS2022 compiler errorsameerj1-1/+2
2022-03-11TextureCacheRuntime: allow converting D24S8 to ABGR8Liam1-1/+2
I can't see how this would be useful, but Galaxy uses it.
2022-02-25maxwell_to_(gl/vk): Add 11_11_10 float vertex formatMorph1-0/+2
- Used by パワプロクンポケットR
2022-02-24vk_blit_screen: Add missing format bgra8Lody1-0/+2
2022-02-21vulkan_device: fix missing format in ANVvoidanix1-2/+4
Currently Mesa's ANV driver does not support VK_FORMAT_B5G6R5_UNORM_PACK16, implement an alternative for it.
2022-02-01Rasterizer: Refactor inlineToMemory.Fernando Sahmkow2-3/+4
2022-01-31Vulkan: Fix Scheduler Chunks when their FuncType is 0.Fernando Sahmkow2-4/+6
2022-01-29Rasterizer: Implement Inline2Memory Acceleration.Fernando Sahmkow2-0/+23
2022-01-25vk_fsr: Replace comma operator with semicolonLioncash1-1/+1
Generally, we should be ending statements with a semicolon not a comma Resolves a clang diagnostic.
2022-01-04ShaderDecompiler: Add a debug option to dump the game's shaders.Fernando Sahmkow1-0/+9
2021-12-24vk_texture_cache: Use 3D scale helpers for MSAA texture scaling on Intel Windows driversameerj2-18/+23
Fixes a crash when scaling MSAA textures in titles such as Sonic Colors Ultimate.
2021-12-24blit_image: Remove unused functionameerj2-50/+0
2021-12-24vk_texture_cache: Fix invalidated pointer accessameerj2-5/+15
The vulkan ImageView held a reference to its source image for rescale status checking. This pointer is sometimes invalidated when the texture cache slot_images container is resized. To avoid an invalid pointer dereference, the ImageView now holds a reference to the container itself.
2021-12-18Address format clangvonchenplus1-1/+1
2021-12-18Vulkan: Fix the checks for primitive restart extension.Fernando Sahmkow1-2/+5
2021-12-18Vulkan: implement Logical Operations.Fernando Sahmkow1-2/+2
2021-12-18Vulkan: Implement VK_EXT_primitive_topology_list_restartFernando Sahmkow1-2/+2
2021-12-11maxwell_to_vk: Add ASTC_2D_5X4_UNORMMorph1-1/+1
2021-12-09maxwell_to_vk: Add ASTC_2D_8X5_UNORMMorph1-1/+1
- Used by Lego City Undercover
2021-12-08renderer_vulkan: Add R16G16_UINTMorph1-1/+1
- Used by Immortals Fenyx Rising
2021-12-05vk_texture_cache: Add ABGR src format check for D24S8 conversionsameerj1-1/+5
2021-12-05blit_image: Refactor upscale factors usageameerj4-60/+51
The image view itself can be queried to see if it is being rescaled or not, removing the need to pass the upscale/down shift factors from the texture cache.
2021-12-05vk_texture_cache: Add a function to ImageView to check if src image is rescaledameerj2-4/+22
2021-12-05blit_image: Refactor ConvertPipeline functionsameerj2-29/+15
2021-12-05blit_image: Refactor ConvertPipelineEx functionsameerj2-33/+18
reduces much of the duplication between the color/depth variants
2021-12-05vk_blit_screen: Minor refactor of filter pipeline selectionameerj1-21/+16
2021-12-05Revert "Merge pull request #7395 from Morph1984/resolve-comments"ameerj3-16/+31
This reverts commit d20f91da11fe7c5d5f1bd4f63cc3b4d221be67a4, reversing changes made to 5082712b4e44ebfe48bd587ea2fa38767b7339cb.
2021-11-22Texture Cache: Always copy on NVIDIA.Fernando Sahmkow1-0/+5
2021-11-22TextureCache: Simplify blitting of D24S8 formats and fix bugs.Fernando Sahmkow4-90/+66
2021-11-21VulkanTexturECache: Use reinterpret on D32_S8 formats.Fernando Sahmkow1-2/+7
2021-11-21vk_texture_cache: Mark VkBufferUsageFlags as static constexprMorph1-3/+3
2021-11-21vk_blit_image: Consolidate CreatePipelineTargetEx functionsMorph2-28/+13
2021-11-20TextureCache: Refactor and fix linux compiling.Fernando Sahmkow1-5/+2
2021-11-20TextureCache: Implement buffer copies on Vulkan.Fernando Sahmkow2-1/+184
2021-11-20TextureCache: Add R16G16 to D24S8 converter.Fernando Sahmkow3-0/+19
2021-11-19TextureCache: Add B10G11R11 to D24S8 converter.Fernando Sahmkow3-13/+64
2021-11-19Implement convert legacy to genericFeng Chen1-0/+2
2021-11-19TextureCache: Implement additional D24S8 convertions.Fernando Sahmkow3-0/+42
2021-11-19Vulkan: implement D24S8 <-> RGBA8 convertions.Fernando Sahmkow3-0/+126
2021-11-18renderer_vulkan: Implement S8_UINT stencil formatMorph2-0/+8
It should be noted that on Windows, only nvidia gpus support this format natively as of this commit.
2021-11-17texture_cache: Use pixel format conversion when supported by the runtimeameerj1-0/+1
2021-11-17TextureCache: Fix OGL cleaningFernando Sahmkow2-0/+20
2021-11-16TextureCache: Add automatic anisotropic filtering and refactor code.Fernando Sahmkow1-7/+1
2021-11-16TextureCache: Make a better Anisotropic setter.Fernando Sahmkow1-1/+8
2021-11-16Vulkan: fix regression.FernandoS271-14/+17
2021-11-16FSR: Fix GCC build errorsameerj3-43/+50
2021-11-16Vulkan: Reimplement FSR constant generation functions to avoid GCC warningsMarshall Mohror1-8/+145
2021-11-16vk_blit_screen: Fix AA destruction orderameerj1-9/+10
2021-11-16Presentation: Only use FP16 in scaling shaders on supported devices in VulkanMarshall Mohror3-19/+46
2021-11-16renderer_vulkan/blit_image: Use generic color state on Depth to Color blitsameerj1-1/+1
Fixes Bayonetta 2 on AMD
2021-11-16vk_texture_cache: Refactor 3D scaling helpersameerj2-113/+74
2021-11-16VulkanBufferCache: Avoid adding barriers between multiple copies.Fernando Sahmkow2-4/+40
2021-11-16Vulkan: Fix FXAA in AMD.Fernando Sahmkow1-2/+40
2021-11-16Vulkan: Implement FXAAFernandoS272-21/+386
2021-11-16VideoCore: Add gaussian filtering.FernandoS272-0/+51
2021-11-16Vulkan: fix waiting on semaphore.FernandoS271-1/+3
2021-11-16TextureCache: fix rescaling in aliases and overlap joins.FernandoS271-9/+10
2021-11-16Presentation: Fix turning FSR on and off in settingsMarshall Mohror1-0/+11
2021-11-16Video Core: fix building for GCC.Fernando Sahmkow4-22/+40
2021-11-16Vulkan Rasterizer: Fix clears on integer textures.FernandoS271-1/+33
2021-11-16Texture cache: fix Intel with rescaler.FernandoS271-2/+2
2021-11-16TextureCache: Fix blitting filter in Vulkan and correct viewport/scissor calculation when downscaling.FernandoS272-20/+44
2021-11-16Texture Cache: fix memory managment and optimize scaled downloads, uploads.Fernando Sahmkow2-6/+21
2021-11-16Vulkan: Fix Blit Depth StencilFernando Sahmkow2-14/+20
2021-11-16Texture Cache: Fix downscaling and correct memory comsumption.Fernando Sahmkow2-10/+86
2021-11-16Presentation: add Nearest Neighbor filter.Fernando Sahmkow2-8/+37
2021-11-16vulkan: Implement FidelityFX Super ResolutionMarshall Mohror4-15/+480
2021-11-16Texture Cache: Rescale conversions between depth and colorFernandoS274-23/+35
2021-11-16Texture cache: Fix memory consumption and ignore rating when a depth texture is rendered.Fernando Sahmkow1-2/+7
2021-11-16vulkan: Fix rescaling push constant usageameerj4-35/+42
2021-11-16vk_texture_cache: Use 3D to scale images when blit is unsupportedameerj4-29/+87
2021-11-16vk_texture_cache: Fix BlitScale of non-2D imagesameerj1-10/+9
2021-11-16video_core: Refactor resolution scale functionameerj1-13/+6
2021-11-16vk_texture_cache: Fix unsupported blit format error checkingameerj1-5/+5
2021-11-16vk_texture_cache: Fix early returns on unsupported scalesameerj1-18/+10
2021-11-16video_core: Misc resolution scaling related refactoringameerj3-19/+29
2021-11-16Texture Cache: Fix Rescaling on MultisampleFernando Sahmkow1-2/+6
2021-11-16TextureCache: Base fixes on rescaling.Fernando Sahmkow1-1/+2
2021-11-16vk_texture_cache: Simplify scaled image managementameerj2-107/+34
2021-11-16vk_rasterizer: Fix scaling on Y_NEGATEameerj1-3/+9
2021-11-16vk_texture_cache: Use nearest neighbor scaling when availableameerj1-2/+7
2021-11-16vk_texture_cache: Minor cleanupameerj2-11/+8
2021-11-16Renderers: Unify post processing filter shadersameerj1-4/+4
2021-11-16Renderer: Implement Bicubic and ScaleForce filters.Fernando Sahmkow2-10/+121
2021-11-16Texture Cache: fix scaling on upload and stop scaling on base resolution.Fernando Sahmkow1-14/+32
2021-11-16emit_spirv: Fix RescalingLayout alignmentameerj2-4/+7
2021-11-16emit_spirv: Fix RescalingLayout alignmentameerj1-1/+1
2021-11-16shader: Properly scale image reads and add GL SPIR-V supportReinUsesLisp2-7/+18
Thanks for everything!
2021-11-16shader: Properly blacklist and scale image loadsReinUsesLisp2-6/+10
2021-11-16texture_cache: Add getter to query if image view is rescaledReinUsesLisp1-2/+1
2021-11-16vk_rasterizer: Minor style changeReinUsesLisp1-2/+2
2021-11-16texture_cache: Simplify image view queries and blacklistingReinUsesLisp5-114/+82
2021-11-16Vulkan: Fix downscaling Blit.Fernando Sahmkow1-14/+18
2021-11-16Vulkan: Fix AA when rescaling.Fernando Sahmkow1-1/+1
2021-11-16Texture Cache: Implement Blacklisting.Fernando Sahmkow2-3/+54
2021-11-16vulkan: Implement rescaling shader patchingReinUsesLisp8-27/+103
2021-11-16vk_texture_cache: Properly scale blit source imagesReinUsesLisp1-2/+2
2021-11-16vk_graphics_pipeline: Use Shader::NumDescriptors when possibleReinUsesLisp1-18/+6
2021-11-16vk_texture_cache: Simplify and optimize scaling blitsReinUsesLisp1-106/+62
2021-11-16vk_texture_cache: Fix scaling blit validation errorsReinUsesLisp1-81/+78
2021-11-16Fix blits with mipsReinUsesLisp1-12/+16
2021-11-16Fix blitsReinUsesLisp1-10/+10
2021-11-16TextureCache: Fix rescaling of ImageCopiesFernando Sahmkow1-13/+27
2021-11-16TextureCache: Modify Viewports/Scissors according to Rescale.Fernando Sahmkow2-32/+61
2021-11-16Texture Cache: More rescaling fixes.Fernando Sahmkow1-0/+8
2021-11-16Texture Cache: Implement Vulkan UpScaling & DownScalingFernando Sahmkow2-25/+244
2021-11-16VideoCore: Initial Setup for the Resolution Scaler.Fernando Sahmkow2-15/+85
2021-10-23Vulran Rasterizer: address feedback.Fernando Sahmkow1-3/+5
2021-10-22Fix vulkan viewport issueFeng Chen1-0/+1
2021-10-04Vulkan: Fix failing barrier on refresh.Fernando Sahmkow1-1/+2
2021-10-04Vulkan: Fix the master SemaphoreFernandoS271-4/+12
2021-10-03gpu: Migrate implementation to the cpp fileameerj2-1/+2
2021-09-28vk_graphics_pipeline: Force patch list topology when tessellation is usedameerj1-1/+10
Fixes a crash on some drivers when tessellation is used but the IA topology is not patch list.
2021-09-24general: Update style to clang-format-12ameerj2-11/+7
2021-09-24video_core: Fix jthread related hangs when stopping emulationameerj1-1/+1
jthread on some compilers is more picky when it comes to the order in which objects are destroyed.
2021-09-24vk_texture_cache: Disable cube compatibility flag on non-mesa AMD GCN4 and earlierameerj1-1/+1
Fixes rainbow textures on BOTW.
2021-09-24Vulkan Query Cache: make sure to wait for the query result.Fernando Sahmkow1-1/+2
2021-09-23Vulkan Rasterizer: Correct DepthBias/PolygonOffset on Vulkan.Fernando Sahmkow2-3/+14
2021-09-16vk_scheduler: Use std::jthreadameerj2-17/+9
2021-09-14renderers: Log total pipeline countMorph1-0/+2
2021-09-13Vulkan/Descriptors: Increase sets per pool on AMFD propietary driver.Fernando Sahmkow1-3/+3
2021-09-13vk_swapchain: Use immediate present mode when mailbox is unavailable and FPS is unlockedameerj3-4/+38
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.
2021-09-12vk_rasterizer: Fix dynamic StencilOp updating when two faces are enabledameerj1-6/+8
This function was incorrectly using the stencil_two_side_enable register when dynamically updating the StencilOp.
2021-09-12vk_state_tracker: Remove unused functionameerj1-4/+0
2021-09-11vk_descriptor_pool: Add missing <algorithm> includeMorph1-0/+1
2021-09-02renderer_vulkan: Wait on present semaphore at queue submitameerj5-26/+33
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.
2021-08-30structured_control_flow: Conditionally invoke demote reorder passameerj1-0/+2
This is only needed on select drivers when a fragment shader discards/demotes.
2021-08-29vulkan_device: Enable VK_KHR_swapchain_mutable_format if availableameerj1-0/+11
Silences validation errors when creating sRGB image views of linear swapchain images
2021-08-29vk_swapchain: Prefer linear swapchain format when presenting sRGB imagesameerj3-11/+10
Fixes broken sRGB when presenting from a secondary GPU.
2021-08-25vulkan_device: Add a check for int8 supportameerj1-1/+1
Silences validation errors when shaders use int8 without specifying its support to the API
2021-08-21vk_rasterizer: Only clear depth and stencil buffers when set in attachment aspect maskameerj3-6/+24
Silences validation errors for clearing the depth/stencil buffers of framebuffer attachments that were not specified to have depth/stencil usage.
2021-08-16vk_blit_screen: Fix non-accelerated texture size calculationameerj1-1/+3
Addresses the potential OOB access in UnswizzleTexture.
2021-08-07texture_cache: Address ameerj's reviewyzct123451-0/+2
2021-08-05texture_cache: Don't change copyright yearyzct123451-1/+1
2021-08-05texture_cache: Address ameerj's reviewyzct123453-3/+3
2021-08-05texture_cache: Split templates outyzct123452-1/+11
2021-08-01astc_decoder: Reduce workgroup sizeameerj1-2/+2
This reduces the amount of over dispatching when there are odd dimensions (i.e. ASTC 8x5), which rarely evenly divide into 32x32.
2021-08-01astc_decoder: Compute offset swizzles in-shaderameerj2-67/+5
Alleviates the dependency on the swizzle table and a uniform which is constant for all ASTC texture sizes.
2021-08-01astc_decoder: Optimize the use EncodingDataameerj1-33/+9
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.
2021-07-29vk_rasterizer: Flip viewport on Y_NEGATEReinUsesLisp1-2/+7
Matches OpenGL's behavior. I don't believe this register flips geometry, but we have to try to match behavior on both backends.
2021-07-29renderers: Add explicit invert_y bool to screenshot callbackameerj1-1/+1
OpenGL and Vulkan images render in different coordinate systems. This allows us to specify the coordinate system of the screenshot within each renderer
2021-07-29renderer_vulkan: Implement screenshotsameerj2-0/+152
2021-07-29vk_blit_screen: Add public CreateFramebuffer methodameerj2-14/+18
2021-07-29vk_blit_screen: Make Draw method more genericameerj3-55/+71
Allows specifying the framebuffer and render area dimensions, rather than being hard coded for the render window.
2021-07-28renderer_vulkan: Add setting to log pipeline statisticsReinUsesLisp8-19/+195
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.
2021-07-27vk_compute_pass: Remove unused capturesLioncash1-3/+2
Resolves two compiler warnings.
2021-07-26vk_staging_buffer_pool: Fall back to host memory when allocation failsRobin Kertels1-8/+21
2021-07-26vk_stream_buffer: Remove unused stream bufferReinUsesLisp2-244/+0
Remove unused file.
2021-07-26vk_compute_pass: Fix pipeline barrier for indexed quadsReinUsesLisp1-1/+1
Use an index buffer barrier instead of a vertex input read barrier.
2021-07-26vk_buffer_cache: Add transform feedback usage to null bufferReinUsesLisp1-3/+7
Fixes bad API usages on Vulkan.
2021-07-23vulkan/blit_image: Commit descriptor sets within worker threadReinUsesLisp1-9/+7
Fixes race condition caused. The descriptor pool is not thread safe, so we have to commit descriptor sets within the same thread.
2021-07-23Revert "renderers: Disable async shader compilation"ReinUsesLisp1-1/+1
This reverts commit 4a152767286717fa69bfc94846a124a366f70065.
2021-07-23shader_environment: Receive cache version from outsideReinUsesLisp1-3/+6
This allows us invalidating OpenGL and Vulkan separately in the future.
2021-07-23shader_recompiler, video_core: Resolve clang errorslat9nq1-3/+1
Silences the following warnings-turned-errors: -Wsign-conversion -Wunused-private-field -Wbraced-scalar-init -Wunused-variable And some other errors
2021-07-23renderers: Fix clang formattingameerj3-8/+12
2021-07-23renderers: Disable async shader compilationameerj1-1/+1
The current implementation is prone to causing graphical issues. Disable until a better solution is implemented.
2021-07-23maxwell_to_vk: Add R16_SNORMReinUsesLisp1-1/+1
2021-07-23shader: Ignore global memory ops on devices lacking int64 supportameerj1-0/+1
2021-07-23emit_spirv: Workaround VK_KHR_shader_float_controls on fp16 NvidiaReinUsesLisp1-0/+1
Fix regression on Fire Emblem: Three Houses when using native fp16.
2021-07-23vk_rasterizer: Workaround bug in VK_EXT_vertex_input_dynamic_stateReinUsesLisp2-14/+19
Workaround potential bug on Nvidia's driver where only updating high attributes leaves low attributes out dated.
2021-07-23vk_graphics_pipeline: Implement smooth linesReinUsesLisp3-0/+23
2021-07-23vk_graphics_pipeline: Implement line widthReinUsesLisp5-6/+28
2021-07-23shader: Rework varyings and implement passthrough geometry shadersReinUsesLisp2-10/+12
Put all varyings into a single std::bitset with helpers to access it. Implement passthrough geometry shaders using host's.
2021-07-23vk_graphics_pipeline: Implement conservative renderingReinUsesLisp3-9/+26
2021-07-23shader: Unify shader stage typesReinUsesLisp4-11/+11
2021-07-23shader: Emulate 64-bit integers when not supportedReinUsesLisp1-1/+1
Useful for mobile and Intel Xe devices.
2021-07-23gl_shader_cache: Check previous pipeline before checking hash mapReinUsesLisp1-2/+1
Port optimization from Vulkan.
2021-07-23shaders: Allow shader notify when async shaders is disabledameerj1-7/+5
2021-07-23vk_graphics_pipeline: Use VK_KHR_push_descriptor when availableReinUsesLisp4-24/+45
~51% faster on Nvidia compared to previous method.
2021-07-23shader: Properly manage attributes not written from previous stagesReinUsesLisp1-4/+12
2021-07-23shader: Add support for native 16-bit floatsReinUsesLisp2-4/+11
2021-07-23shader: Rename maxwell/program.h to translate_program.hReinUsesLisp1-1/+1
2021-07-23vk_rasterizer: Exit render passes on fragment barriersReinUsesLisp1-0/+1
2021-07-23vk_graphics_pipeline: Fix path with no VK_EXT_extended_dynamic_stateRodrigo Locatti1-1/+1
2021-07-23vk_pipeline_cache: Skip cached pipelines with different dynamic stateReinUsesLisp1-0/+6
2021-07-23vulkan: Add VK_EXT_vertex_input_dynamic_state supportReinUsesLisp8-116/+276
Reduces the number of total pipelines generated on Vulkan. Tested on Super Smash Bros. Ultimate.
2021-07-23shader: Reorder shader cache directoriesReinUsesLisp1-10/+7
2021-07-23vk_rasterizer: Implement first indexReinUsesLisp1-2/+5
2021-07-23vulkan: Use VK_EXT_provoking_vertex when availableReinUsesLisp3-3/+12
2021-07-23vk_pipeline_cache,shader_notify: Add shader notificationsReinUsesLisp7-49/+83
2021-07-23vk_pipeline_cache: Add asynchronous shadersReinUsesLisp3-3/+33
2021-07-23vk_rasterizer: Flush work on clear and dispatchesReinUsesLisp1-0/+3
2021-07-23vk_swapchain: Handle outdated swapchainsReinUsesLisp3-17/+34
Fixes pixelated presentation on Intel devices.
2021-07-23vk_buffer_cache: Handle null texture buffersReinUsesLisp1-0/+4
Fixes a crash on Age of Calamity cutscenes.
2021-07-23vk_pipeline_cache: Set support_derivative_control to trueReinUsesLisp1-0/+1
2021-07-23buffer_cache: Reduce uniform buffer size from shader usageReinUsesLisp4-7/+18
Increases performance significantly on certain titles.
2021-07-23fixed_pipeline_state: Use regular for loop instead of ranges for perfReinUsesLisp1-2/+3
MSVC generates better code for it.
2021-07-23vk_swapchain: Avoid recreating the swapchain on each frameReinUsesLisp2-15/+9
Recreate only when requested (or sRGB is changed) instead of tracking the frontend's size. That size is still used as a hint.
2021-07-23vulkan: Conditionally use shaderInt16ReinUsesLisp1-1/+1
Add support for Polaris AMD devices.
2021-07-23vulkan: Enable depth bounds and use it conditionallyReinUsesLisp2-1/+9
Intel devices pre-Xe don't support this.
2021-07-23vk_buffer_cache: Add transform feedback usage to buffersReinUsesLisp1-15/+22
2021-07-23opengl: Declare fragment outputs even if they are not usedReinUsesLisp1-0/+7
Fixes Ori and the Blind Forest's menu on GLASM. For some reason (probably high level optimizations) it is not sanitized on SPIR-V for OpenGL. Vulkan is unaffected by this change.
2021-07-23buffer_cache: Mark uniform buffers as dirty if any enable bit changesReinUsesLisp2-1/+8
2021-07-23shader: Handle host exceptionsReinUsesLisp1-11/+24
2021-07-23video_core,shader: Clang-format fixesReinUsesLisp2-5/+10
2021-07-23video_core: Abstract transform feedback translation utilityReinUsesLisp3-111/+15
2021-07-23shader: Split profile and runtime information in separate structsReinUsesLisp2-215/+208
2021-07-23vk_update_descriptor: Properly initialize payload on the update descriptor queueReinUsesLisp1-1/+3
2021-07-23vk_pipeline_cache: Enable int8 and int16 types on VulkanReinUsesLisp1-0/+2
2021-07-23vk_scheduler: Use locks instead of SPSC a queueReinUsesLisp2-32/+42
This tries to fix a data race where we'd wait forever for the GPU.
2021-07-23vk_query_cache: Wait before reading queriesReinUsesLisp1-9/+2
2021-07-23vk_master_semaphore: Use fetch_add to increase master semaphore tickReinUsesLisp2-6/+4
2021-07-23Move SPIR-V emission functions to their own headerReinUsesLisp1-4/+4
2021-07-23shader: Initial OpenGL implementationReinUsesLisp6-66/+31
2021-07-23spirv: Support OpenGL uniform buffers and change bindingsReinUsesLisp1-2/+5
2021-07-23shader: Address feedbackFernandoS271-9/+9
2021-07-23shader: Implement VertexA stageFernandoS271-3/+14
2021-07-23vk_graphics_pipeline: Fix texture buffer descriptorsReinUsesLisp1-7/+8
2021-07-23vk_scheduler: Allow command submission on worker threadReinUsesLisp8-182/+200
This changes how Scheduler::Flush works. It queues the current command buffer to be sent to the GPU but does not do it immediately. The Vulkan worker thread takes care of that. Users will have to use Scheduler::Flush + Scheduler::WaitWorker to get the previous behavior. Scheduler::Finish is unchanged. To avoid waiting on work never queued, Scheduler::Wait sends the current command buffer if that's what the caller wants to wait.
2021-07-23vk_compute_pass: Fix -Wshadow warningReinUsesLisp1-3/+3
2021-07-23shader: Move pipeline cache logic to separate filesReinUsesLisp4-649/+104
Move code to separate files to be able to reuse it from OpenGL. This greatly simplifies the pipeline cache logic on Vulkan. Transform feedback state is not yet abstracted and it's still intrusively stored inside vk_pipeline_cache. It will be moved when needed on OpenGL.
2021-07-23vulkan: Defer descriptor set work to the Vulkan threadReinUsesLisp8-79/+69
Move descriptor lookup and update code to a separate thread. Delaying this removes work from the main GPU thread and allows creating descriptor layouts on another thread. This reduces a bit the workload of the main thread when new pipelines are encountered.
2021-07-23vulkan: Rework descriptor allocation algorithmReinUsesLisp15-197/+314
Create multiple descriptor pools on demand. There are some degrees of freedom what is considered a compatible pool to avoid wasting large pools on small descriptors.
2021-07-23vk_graphics_pipeline: Generate specialized pipeline config functions and improve codeReinUsesLisp2-31/+230
2021-07-23shader: Accelerate pipeline transitions and use dirty flags for shadersReinUsesLisp4-56/+105
2021-07-23vk_compute_pipeline: Fix index comparison oversight on compute texture buffersReinUsesLisp1-1/+1
2021-07-23vk_graphics_pipeline: Guard against non-tessellation pipelines using patchesReinUsesLisp1-2/+8
2021-07-23shader: Fix bugs and build issues on GCCRodrigo Locatti2-3/+3
2021-07-23shader: Fix render targets with null attachmentsReinUsesLisp2-26/+34
2021-07-23shader: Implement indexed texturesReinUsesLisp3-64/+95
2021-07-23shader: Move microinstruction header to the value headerReinUsesLisp1-1/+1
2021-07-23shader: Implement D3D samplersReinUsesLisp3-37/+51
2021-07-23shader: Implement SR_Y_DIRECTIONFernandoS273-0/+4
2021-07-23spirv: Implement ViewportMask with NV_viewport_array2ReinUsesLisp1-0/+1
2021-07-23shader: Implement tessellation shaders, polygon mode and invocation idReinUsesLisp5-2/+48
2021-07-23vk_pipeline_cache: Silence GCC warningslat9nq1-0/+2
Silences `-Werror=missing-field-initializers` due to missing initializers.
2021-07-23spirv: Implement image buffersReinUsesLisp3-21/+37
2021-07-23spirv: Implement alpha testameerj1-0/+36
2021-07-23shader: Implement transform feedbacks and define file formatReinUsesLisp3-7/+156
2021-07-23shader: Implement early Z testsReinUsesLisp1-0/+1
2021-07-23shader: Implement geometry shadersReinUsesLisp2-7/+56
2021-07-23pipeline_helper: Simplify descriptor objects initializationReinUsesLisp1-33/+25
2021-07-23shader: Implement ATOM/S and REDameerj1-0/+1
2021-07-23nsight_aftermath_tracker: Report used shaders to Nsight AftermathReinUsesLisp2-1/+4
2021-07-23spirv: Guard against typeless image reads on unsupported devicesReinUsesLisp1-0/+1
2021-07-23vk_rasterizer: Request outside render pass execution context for computeReinUsesLisp1-0/+1
2021-07-23pipeline_helper: Add missing [[maybe_unused]]ReinUsesLisp1-1/+1
2021-07-23shader: Implement SULD and SUSTReinUsesLisp7-65/+127
2021-07-23shader: Address feedback + clang formatlat9nq1-2/+2
2021-07-23shader_recompiler,video_core: Cleanup some GCC and Clang errorslat9nq4-15/+15
Mostly fixing unused *, implicit conversion, braced scalar init, fpermissive, and some others. Some Clang errors likely remain in video_core, and std::ranges is still a pertinent issue in shader_recompiler shader_recompiler: cmake: Force bracket depth to 1024 on Clang Increases the maximum fold expression depth thread_worker: Include condition_variable Don't use list initializers in control flow Co-authored-by: ReinUsesLisp <reinuseslisp@airmail.cc>
2021-07-23shader: Interact texture buffers with buffer cacheReinUsesLisp7-115/+140
2021-07-23shader: Implement texture buffersReinUsesLisp4-12/+29
2021-07-23vk_pipeline_cache: Fix num of pipeline workers on weird platformsReinUsesLisp1-1/+1
2021-07-23shader: Fix ShadowCube declaration type, set number of pipeline threads based on hardwareFernandoS271-1/+3
2021-07-23vk_compute_pass: Fix compute passesReinUsesLisp3-23/+19
2021-07-23shader: Remove atomic flags and use mutex + cond variable for pipelinesReinUsesLisp4-11/+32
2021-07-23vk_pipeline_cache: Remove unnecesary scope in pipeline cache lockingReinUsesLisp1-15/+12
2021-07-23vk_pipeline_cache: Small fixes to the pipeline cacheFernandoS271-10/+14
2021-07-23shader: Mark SSBOs as written when they areFernandoS272-2/+2
2021-07-23shader: Implement ViewportIndexFernandoS271-0/+1
2021-07-23vulkan: Serialize pipelines on a separate threadReinUsesLisp2-67/+64
2021-07-23vulkan: Create pipeline layouts in separate threadsReinUsesLisp7-63/+65
2021-07-23vulkan: Build pipelines in parallel at runtimeReinUsesLisp9-165/+197
Wait from the worker thread for a pipeline to build before binding it to the command buffer. This allows queueing pipelines to multiple threads.
2021-07-23vk_pipeline_cache: Name SPIR-V modulesReinUsesLisp1-1/+11
2021-07-23spirv: Add fixed pipeline point sizeReinUsesLisp1-0/+3
2021-07-23shader: Implement BRXFernandoS271-1/+49
2021-07-23vk_pipeline_cache: Fix size hashing of shadersReinUsesLisp1-8/+7
2021-07-23shader: Implement LDS, STS, LDL, and STS and use SPIR-V 1.4 when availableReinUsesLisp1-4/+43
2021-07-23shader: Better interpolation and disabled attributes supportReinUsesLisp2-2/+5
2021-07-23spirv: Remove dependencies on Environment when generating SPIR-VReinUsesLisp1-7/+3
2021-07-23vk_pipeline_cache: Fix pipeline and shader cachesReinUsesLisp2-6/+21
2021-07-23shader: Fix rasterizer integration order issuesReinUsesLisp3-7/+6
2021-07-23shader: Implement TXQ and fix FragDepthReinUsesLisp1-0/+92
2021-07-23shader: Implement NDC [-1, 1], attribute types and default varying initializationReinUsesLisp3-3/+37
2021-07-23shader: Implement VOTEameerj2-1/+8
2021-07-23vk_pipeline_cache: Fix ReleaseContents orderReinUsesLisp1-2/+2
2021-07-23vk_pipeline_cache: Add pipeline cacheReinUsesLisp2-0/+7
2021-07-23vk_pipeline_cache: Add pipeline cacheReinUsesLisp4-98/+332
2021-07-23shader: Implement DMNMX, DSET, DSETPameerj1-0/+2
2021-07-23spirv: Implement VertexId and InstanceId, refactor codeReinUsesLisp1-0/+1
2021-07-23shader: Implement I2FReinUsesLisp1-1/+2
2021-07-23shader: Add partial rasterizer integrationReinUsesLisp18-409/+1278
2021-07-23spirv: Add SignedZeroInfNanPreserve logicameerj1-0/+4
2021-07-23shader: Initial support for textures and TEXReinUsesLisp4-1/+111
2021-07-23spirv: Fixes and Intel specific workaroundsReinUsesLisp1-0/+1
2021-07-23shader: Rename, implement FADD.SAT and P2R (imm)ReinUsesLisp1-2/+2
2021-07-23shader: Add denorm flush supportReinUsesLisp2-7/+15
2021-07-23spirv: Add lower fp16 to fp32 passReinUsesLisp3-4/+9
2021-07-23shader: Primitive Vulkan integrationReinUsesLisp11-77/+428
2021-07-23shader: Remove old shader managementReinUsesLisp9-1604/+41
2021-07-23spirv: Initial SPIR-V supportReinUsesLisp2-3265/+0
2021-07-20vk_texture_cache: Use VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL when possibleReinUsesLisp1-21/+35
Silences performance warnings generated from validation layers on each frame.
2021-07-20vk_buffer_cache: Fix quad index array with 0 vertices (#6627)Fernando S1-0/+7
2021-07-19Update src/video_core/renderer_vulkan/vk_texture_cache.cppyzct123451-1/+1
Co-authored-by: Vitor K <vitor-kiguchi@hotmail.com>
2021-07-19Update src/video_core/renderer_vulkan/vk_texture_cache.cppyzct123451-1/+1
Co-authored-by: Vitor K <vitor-kiguchi@hotmail.com>
2021-07-18Ignore wrong blit formatyzct123451-1/+4
2021-07-18vk_texture_cache: Finalize renderpass when downloading imagesReinUsesLisp1-0/+1
2021-07-18vk_compute_pass: Fix pipeline barriers on non-initialized ASTC imagesReinUsesLisp1-2/+3
2021-07-18vk_compute_pass: Fix ASTC buffer setup synchronizationReinUsesLisp1-14/+14
2021-07-13vk_rasterizer: Only clear valid color attachmentsameerj1-2/+4
2021-07-13DMAEngine: Accelerate BufferClearFernando Sahmkow4-0/+33
2021-07-12accelerateDMA: Fixes and feedback.Fernando Sahmkow1-4/+5
2021-07-11accelerateDMA: Accelerate Buffer Copies.Fernando Sahmkow2-1/+24
2021-07-09Fence Manager: remove reference fencing.Fernando Sahmkow1-5/+2
2021-07-09Fence Manager: Force ordering on WFI.Fernando Sahmkow1-0/+4
2021-07-09Fence Manager: Add fences on Reference Count.Fernando Sahmkow2-0/+8
2021-07-09vk_buffer_cache: Use emulated null buffers for transform feedbackReinUsesLisp2-11/+19
Vulkan does not support null buffers on transform feedback bindings. Emulate these using the same null buffer we were using for index buffers.
2021-07-09configure_graphics: Use u8 for bg_color valuesameerj1-1/+4
2021-07-04Texture Cache: Initial Implementation of Sparse Textures.Fernando Sahmkow2-0/+8
2021-06-29yuzu qt: Make most UISettings a BasicSettinglat9nq1-4/+9
For simple primitive settings, moves their defaults and labels to definition time. Also fixes typo and clang-format yuzu qt: config: Fix rng_seed
2021-06-28general: Make most settings a BasicSettinglat9nq1-10/+5
Creates a new BasicSettings class in common/settings, and forces setting a default and label for each setting that uses it in common/settings. Moves defaults and labels from both frontends into common settings. Creates a helper function in each frontend to facillitate reading the settings now with the new default and label properties. Settings::Setting is also now a subclass of Settings::BasicSetting. Also adds documentation for both Setting and BasicSetting.
2021-06-26vk_buffer_cache: Silence implicit cast warningsReinUsesLisp1-2/+3
2021-06-24common: Replace common_sizes into user-literalsWunkolo2-3/+10
Removes common_sizes.h in favor of having `_KiB`, `_MiB`, `_GiB`, etc user-literals within literals.h. To keep the global namespace clean, users will have to use: ``` using namespace Common::Literals; ``` to access these literals.
2021-06-22vk_master_semaphore: Use jthread for debug threadReinUsesLisp2-19/+8
2021-06-21video_core: Add GPU vendor name to window title barameerj1-0/+4
2021-06-20Reaper: Guarantee correct deletion.Fernando Sahmkow2-0/+10
2021-06-19astc_decoder.comp: Remove unnecessary LUT SSBOsameerj1-64/+10
We can move them to instead be compile time constants within the shader.
2021-06-19astc: Various robustness enhancements for the gpu decoderameerj1-32/+7
These changes should help in reducing crashes/drivers panics that may occur due to synchronization issues between the shader completion and later access of the decoded texture.
2021-06-17Reaper: Change memory restrictions on TC depending on host memory on VK.Fernando Sahmkow2-0/+7
2021-06-16configure_graphics: Add Accelerate ASTC decoding settingameerj1-1/+6
2021-06-01buffer_cache: Simplify uniform disabling logicameerj2-0/+5
2021-05-16perf_stats: Rework FPS counter to be more accurateameerj1-0/+1
The FPS counter was based on metrics in the nvdisp swapbuffers call. This metric would be accurate if the gpu thread/renderer were synchronous with the nvdisp service, but that's no longer the case. This commit moves the frame counting responsibility onto the concrete renderers after their frame draw calls. Resulting in more meaningful metrics. The displayed FPS is now made up of the average framerate between the previous and most recent update, in order to avoid distracting FPS counter updates when framerate is oscillating between close values. The status bar update frequency was also changed from 2 seconds to 500ms.
2021-05-08texture_cache: Handle out of bound texture blitsameerj4-43/+36
Some games interleave a texture blit using regions which are out-of-bounds. This addresses the interleaving to avoid oob reads from the src texture.
2021-04-25vk_texture_cache: Swap R and B channels of color flipped formatameerj1-1/+24
Swaps the Red and Blue channels of the A1B5G5R5_UNORM texture format, which was being incorrectly rendered.
2021-04-15common: Move settings to common from core.bunnei3-3/+3
- Removes a dependency on core and input_common from common.
2021-04-12vk_master_semaphore: Deduplicate atomic access within IsFree()Lioncash1-1/+1
We can just reuse the already existing KnownGpuTick() to deduplicate the access.
2021-04-12vk_master_semaphore: Add missing const qualifier for IsFree()Lioncash1-1/+1
This member function doesn't modify class state.
2021-04-12vk_texture_cache: Make use of Common::BitCast where applicableLioncash1-5/+6
Also clarify the TODO comment a little more on the lacking implementations for std::bit_cast.
2021-04-11vk_buffer_cache: Fix offset for NULL vertex buffersJoshua Ashton1-1/+1
The Vulkan spec states: If an element of pBuffers is VK_NULL_HANDLE, then the corresponding element of pOffsets must be zero. https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBindVertexBuffers2EXT.html#VUID-vkCmdBindVertexBuffers2EXT-pBuffers-04112
2021-04-11renderer_vulkan: Check return value of AcquireNextImageJoshua Ashton3-5/+10
We can get into a really bad state by ignoring this leading to device loss and using incorrect resources.
2021-03-25astc_decoder: Refactor for style and more efficient memory useameerj1-79/+96
2021-03-13astc_decoder: Reimplement LayersRodrigo Locatti3-95/+122
Reimplements the approach to decoding layers in the compute shader. Fixes multilayer astc decoding when using Vulkan.
2021-03-13renderer_vulkan: Accelerate ASTC decodingameerj7-9/+386
Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
2021-03-04texture_cache: Blacklist BGRA8 copies and views on OpenGLameerj1-0/+5
In order to force the BGRA8 conversion on Nvidia using OpenGL, we need to forbid texture copies and views with other formats. This commit also adds a boolean relating to this, as this needs to be done only for the OpenGL api, Vulkan must remain unchanged.
2021-02-23vk_command_pool: Reduce the command pool size from 4096 to 4ReinUsesLisp1-1/+1
This allows drivers to reuse memory more easily and preallocate less. The optimal number has been measured booting Pokémon Sword.
2021-02-16vk_rasterizer: Fix loading shader addresses twiceReinUsesLisp1-1/+0
This was recently introduced on a wrongly rebased commit.
2021-02-15Review 1Kelebek11-2/+2
2021-02-15Implement texture offset support for TexelFetch and TextureGather and add offsets for TldsKelebek11-7/+24
Formatting
2021-02-13vk_resource_pool: Load GPU tick once and compare with itReinUsesLisp2-8/+8
Other minor style improvements. Rename free_iterator to hint_iterator, to describe better what it does.
2021-02-13vk_update_descriptor: Inline and improve code for binding buffersReinUsesLisp4-24/+24
Allow compilers with our settings inline hot code.
2021-02-13fixed_pipeline_cache: Use dirty flags to lazily update keyReinUsesLisp7-56/+103
Use dirty flags to avoid building pipeline key from scratch on each draw call. This saves a bit of unnecesary work on each draw call.
2021-02-13vk_master_semaphore: Mark gpu_tick atomic operations with relaxed orderReinUsesLisp1-4/+4
2021-02-13vk_staging_buffer_pool: Inline tick testsReinUsesLisp2-1/+7
Load the current tick to a local variable, moving it out of an atomic and allowing us to compare the value without going through a pointer each time. This should make the loop more optimizable.
2021-02-13gl_stream_buffer/vk_staging_buffer_pool: Fix size checkReinUsesLisp1-1/+1
Fix a tragic off-by-one condition that causes Vulkan's stream buffer to think it's always full, using fallback memory. The OpenGL was also affected by this bug to a lesser extent.
2021-02-13video_core: Fix clang build issuesReinUsesLisp1-1/+5
2021-02-13vk_staging_buffer_pool: Fix softlock when stream buffer overflowsReinUsesLisp2-19/+20
There was still a code path that could wait on a timeline semaphore tick that would never be signalled. While we are at it, make use of more STL algorithms.
2021-02-13vk_buffer_cache: Add support for null index buffersReinUsesLisp2-4/+40
Games can bind a null index buffer (size=0) where all indices are evaluated as zero. VK_EXT_robustness2 doesn't support this and all drivers segfault when a null index buffer is passed to vkCmdBindIndexBuffer. Workaround this by creating a 4 byte buffer and filling it with zeroes. If it's read out of bounds, robustness takes care of returning zeroes as indices.
2021-02-13vk_staging_buffer_pool: Get a staging buffer instead of waitingReinUsesLisp2-9/+18
Avoids waiting idle while the GPU finishes to do work, and fixes an issue where we'd wait forever if a single command buffer (logic tick) all the data.
2021-02-13buffer_cache: Skip cache on small uploads on VulkanReinUsesLisp2-1/+9
Ports from OpenGL the optimization to skip small 3D uniform buffer uploads. This will take advantage of the previously introduced stream buffer. Fixes instances where the staging buffer offset was being ignored.
2021-02-13vk_staging_buffer_pool: Add stream buffer for small uploadsReinUsesLisp7-64/+214
This uses a ring buffer similar to OpenGL's stream buffer for small uploads. This stops us from allocating several small buffers, reducing memory fragmentation and cache locality. It uses dedicated allocations when possible.
2021-02-13video_core: Reimplement the buffer cacheReinUsesLisp20-1003/+585
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-13gpu: Report renderer errors with exceptionsReinUsesLisp6-141/+91
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-01-28vk_scheduler: Fix unaligned placement new expressionsReinUsesLisp1-6/+6
We were accidentaly creating an object in an unaligned memory address. Fix this by manually aligning the offset.
2021-01-25vk_graphics_pipeline: Fix narrowing conversion on MSVCReinUsesLisp1-2/+2
2021-01-24vk_texture_cache: Support image store on sRGB images with VkImageViewUsageCreateInfoReinUsesLisp3-38/+72
Vulkan 1.0 didn't support creating sRGB image views on an ABGR8 VkImage with storage usage bits. VK_KHR_maintenance2 addressed this allowing to reduce the usage bits on a VkImageView. To allow image store on non-sRGB image views when the VkImage is created with sRGB, always create VkImages without sRGB and add the sRGB format on the view.
2021-01-24video_core: Silence -Wmissing-field-initializers warningsReinUsesLisp2-1/+2
2021-01-24maxwell_to_vk: Silence -Wextra warnings about using different enum typesReinUsesLisp2-2/+2
2021-01-23vk_pipeline_cache: Properly bypass VertexA shadersReinUsesLisp1-9/+3
The VertexA stage is not yet implemented, but Vulkan is adding its descriptors, causing a discrepancy in the pushed descriptors and the template. This generally ends up in a driver side crash. Bypass the VertexA stage for now.
2021-01-16vk_shader_decompiler: Show comments as OpUndef with a typeReinUsesLisp1-1/+4
Silence the new validation layer error about SPIR-V not allowing OpUndef on a OpTypeVoid, even when the SPIR-V spec doesn't say anything against it. They will be inserted as an undefined int to avoid SPIRV-Cross and validation errors, but only when a debugging tool is attached.
2021-01-15vk_texture_cache: Use Download memory types for texture flushesReinUsesLisp2-5/+10
Use the Download memory type where it matters.
2021-01-15vulkan_memory_allocator: Add "download" memory usage hintReinUsesLisp7-35/+48
Allow users of the allocator to hint memory usage for downloads. This removes the non-descriptive boolean passed for "host visible" or not host visible memory commits, and uses an enum to hint device local, upload and download usages.
2021-01-15vulkan_common: Move allocator to the common directoryReinUsesLisp10-330/+8
Allow using the abstraction from the OpenGL backend.
2021-01-15renderer_vulkan: Rename Vulkan memory manager to memory allocatorReinUsesLisp15-54/+52
"Memory manager" collides with the guest GPU memory manager, and a memory allocator sounds closer to what the abstraction aims to be.
2021-01-15vk_memory_manager: Improve memory manager and its APIReinUsesLisp13-343/+318
Fix a bug where the memory allocator could leave gaps between commits. To fix this the allocation algorithm was reworked, although it's still short in number of lines of code. Rework the allocation API to self-contained movable objects instead of naively using an unique_ptr to do the job for us. Remove the VK prefix.
2021-01-15vk_buffer_cache: Remove unused functionReinUsesLisp1-4/+0
2021-01-08vk_fence_manager: Use timeline semaphores instead of spin waitsReinUsesLisp3-54/+18
With timeline semaphores we can avoid creating objects. Instead of creating an event, grab the current tick from the scheduler and flush the current command buffer. When the fence has to be queried/waited, we can do so against the master semaphore instead of spinning on an event. If Vulkan supported NVN like events or fences, we could signal from the command buffer and wait for that without splitting things in two separate command buffers.
2021-01-04vk_rasterizer: Skip binding empty descriptor sets on computeReinUsesLisp1-2/+4
Fixes unit tests where compute shaders had no descriptors in the set, making Vulkan drivers crash when binding an empty set.
2021-01-04renderer_vulkan/nsight_aftermath_tracker: Move to vulkan_commonReinUsesLisp2-307/+0
2021-01-04renderer_vulkan: Move device abstraction to vulkan_commonReinUsesLisp27-1214/+27
2021-01-04gl_texture_cache: Avoid format views on Intel and AMDReinUsesLisp1-0/+5
Intel and AMD proprietary drivers are incapable of rendering to texture views of different formats than the original texture. Avoid creating these at a cache level. This will consume more memory, emulating them with copies.
2021-01-03renderer_vulkan: Rename VKDevice to DeviceReinUsesLisp50-166/+163
The "VK" prefix predates the "Vulkan" namespace. It was carried around the codebase for consistency. "VKDevice" currently is a bad alias with "VkDevice" (only an upcase character of difference) that can cause confusion. Rename all instances of it.
2021-01-02general: Fix various spelling errorsMorph1-1/+1
2020-12-31vulkan_instance: Allow different Vulkan versions and enforce 1.1ReinUsesLisp5-28/+12
For listing the available physical devices we can use Vulkan 1.0. Now that MoltenVK supports 1.1 we can require it for running games. Add missing documentation.
2020-12-31vk_device: Use an array to report lacking device limitsReinUsesLisp1-13/+17
This makes easier to add and tune the required device limits.
2020-12-31vk_device: Stop initialization when device is not suitableReinUsesLisp2-61/+39
VKDevice::IsSuitable was not being called. To address this issue, check suitability before initialization and throw an exception if it fails. By doing this, we can deduplicate some code on queue searches. Previosuly we would first search if a present and graphics queue existed, then on initialization we would search again to find the index.
2020-12-31renderer_vulkan: Remove two step initialization on VKDeviceReinUsesLisp4-25/+7
The Vulkan device abstraction either initializes successfully on the constructor or throws a Vulkan exception.
2020-12-31renderer_vulkan: Throw when enumerating devices failsReinUsesLisp1-22/+13
Report device enumeration errors with exceptions to be consistent with other initialization related function calls. Reduces the amount of code to maintain.
2020-12-31renderer_vulkan: Initialize surface in separate fileReinUsesLisp2-73/+3
Move surface initialization code to a separate file. It's unlikely to use this code outside of Vulkan, but keeping platform-specific code (Win32, Xlib, Wayland) in its own translation unit keeps things cleaner.
2020-12-31renderer_vulkan: Catch and report exceptionsReinUsesLisp1-2/+5
Move more Vulkan code to report errors with exceptions and report them through a log before notifying it with an error boolean for backwards compatibility. In the future we can replace the rasterizer two-step initialization to always use exceptions.
2020-12-31renderer_vulkan: Create debug callback on separate file and throwReinUsesLisp2-34/+7
Initialize debug callbacks (messenger) from a separate file. This allows sharing code with different backends. Change our Vulkan error handling to use exceptions instead of error codes, simplifying the initialization process.
2020-12-31renderer_vulkan: Move instance initialization to a separate fileReinUsesLisp1-111/+1
Simplify Vulkan's backend initialization code by moving it to a separate file, allowing us to initialize a Vulkan instance from different backends.
2020-12-31vulkan_common: Rename renderer_vulkan/wrapper.h to vulkan_common/vulkan_wrapper.hReinUsesLisp50-2189/+48
Allows sharing Vulkan wrapper code between different rendering backends.
2020-12-31vulkan_common: Move dynamic library load to a separate fileReinUsesLisp1-31/+8
Allows us to initialize a Vulkan dynamic library from different backends without duplicating code.
2020-12-30maxwell_to_vk: Initialize usage variable in SurfaceFormat()Lioncash1-1/+1
Silences a -Wmaybe-uninitialized warning
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp52-2582/+2979
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-26renderer_vulkan/fixed_pipeline_state: Move enabled bindings to static stateReinUsesLisp3-26/+12
Without using VK_EXT_robustness2, we can't consider the 'enabled' (not null) vertex buffers as dynamic state, as this leads to invalid Vulkan state. Move this to static state that is always hashed and compared in the pipeline key. The bits for enabled vertex buffers are moved into the attribute state bitfield. This is not 'correct' as it's not an attribute state, but that struct has bits to spare, and it's used in an array of 32 elements (the exact same number of vertex buffer bindings).
2020-12-25vk_shader_decompiler: Silence warning when compiling without assertsReinUsesLisp1-0/+1
2020-12-07video_core: Make use of ordered container contains() where applicableLioncash2-3/+2
With C++20, we can use the more concise contains() member function instead of comparing the result of the find() call with the end iterator.
2020-12-07video_core: Remove unnecessary enum class casting in logging messagesLioncash4-27/+24
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-07renderer_vulkan: Add missing `override` specifiercomex1-1/+1
2020-12-07video_core: Adjust `NUM` macro to avoid Clang warningcomex1-1/+1
The previous definition was: #define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / sizeof(u32)) In cases where `field_name` happens to refer to an array, Clang thinks `sizeof(an array value) / sizeof(a type)` is an instance of the idiom where `sizeof` is used to compute an array length. So it thinks the type in the denominator ought to be the array element type, and warns if it isn't, assuming this is a mistake. In reality, `NUM` is not used to get array lengths at all, so there is no mistake. Silence the warning by applying Clang's suggested workaround of parenthesizing the denominator.
2020-12-05video_core: Resolve more variable shadowing scenarios pt.3Lioncash12-119/+119
Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
2020-12-05video_core: Resolve more variable shadowing scenarios pt.2Lioncash32-241/+249
Migrates the video core code closer to enabling variable shadowing warnings as errors. This primarily sorts out shadowing occurrences within the Vulkan code.
2020-12-04video_core: Resolve more variable shadowing scenariosLioncash2-3/+3
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-11-26vk_shader_decompiler: Implement force early fragment testsReinUsesLisp5-10/+13
Force early fragment tests when the 3D method is enabled. The established pipeline cache takes care of recompiling if needed. This is implemented only on Vulkan to avoid invalidating the shader cache on OpenGL.
2020-11-25cleanup unneeded comments and newlinesameerj1-6/+0
2020-11-25Refactor MaxwellToSpirvComparison. Use Common::BitCastameerj3-31/+34
Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
2020-11-25Address PR feedback from Reinameerj5-40/+31
2020-11-25vulkan_renderer: Alpha Test Culling Implementationameerj5-2/+76
Used by various textures in many titles, e.g. SSBU menu.
2020-11-23Overhaul EmuWindow::PollEvents to fix yuzu-cmd calling SDL_PollEvents off main threadcomex1-3/+1
EmuWindow::PollEvents was called from the GPU thread (or the CPU thread in sync-GPU mode) when swapping buffers. It had three implementations: - In GRenderWindow, it didn't actually poll events, just set a flag and emit a signal to indicate that a frame was displayed. - In EmuWindow_SDL2_Hide, it did nothing. - In EmuWindow_SDL2, it did call SDL_PollEvents, but this is wrong because SDL_PollEvents is supposed to be called on the thread that set up video - in this case, the main thread, which was sleeping in a busyloop (regardless of whether sync-GPU was enabled). On macOS this causes a crash. To fix this: - Rename EmuWindow::PollEvents to OnFrameDisplayed, and give it a default implementation that does nothing. - In EmuWindow_SDL2, do not override OnFrameDisplayed, but instead have the main thread call SDL_WaitEvent in a loop.
2020-10-30General: Resolve a few missing initializer warningsLioncash2-2/+9
Resolves a few -Wmissing-initializer warnings.
2020-10-28video_core: Enforce -Wredundant-move and -Wpessimizing-moveReinUsesLisp1-1/+1
Silence three warnings and make them errors to avoid introducing more in the future.
2020-10-13vk_graphics_pipeline: Manage primitive topology as fixed stateReinUsesLisp6-26/+7
Vulkan has requirements for primitive topologies that don't play nicely with yuzu's. Since it's only 4 bits, we can move it to fixed state without changing the size of the pipeline key. - Fixes a regression on recent Nvidia drivers on Fire Emblem: Three Houses.
2020-10-09vk_device: Block VK_EXT_extended_dynamic_state for RDNA devicesgoldenx861-0/+24
RDNA devices seem to crash when using VK_EXT_extended_dynamic_state in the latest 20.9.2 proprietary Windows drivers. As a workaround, for now we block device names corresponding to current RDNA released products.
2020-10-07renderer_vulkan/wrapper: Fix physical device sortingReinUsesLisp1-13/+35
The old code had a sort function that was invalid and it didn't work as expected when the base vector had a different order (e.g. renderdoc was attached). This sorts devices as expected and fixes a debug assert on MSVC.
2020-09-30Remove ext_extended_dynamic_state blacklistMatías Locatti1-8/+0
Latest AMD 20.9.2 driver fixed this, there's no reason to keep it blocked, as the previous stable signed driver release doesn't include the extension.
2020-09-25vk_stream_buffer: Fix initializing Vulkan with NVIDIA on Linuxlat9nq1-1/+2
The previous fix only partially solved the issue, as only certain GPUs that needed 9 or less MiB subtracted would work (i.e. GTX 980 Ti, GT 730). This takes from DXVK's example to divide `heap_size` by 2 to determine `allocable_size`. Additionally tested on my Quadro K4200, which previously required setting it to 12 to boot.
2020-09-25vk_command_pool: Move definition of Pool into the cpp fileLioncash2-4/+6
Allows the implementation details to be changed without recompiling any files that include this header.
2020-09-25vk_command_pool: Make use of override on destructorLioncash1-1/+1
2020-09-25vk_command_pool: Add missing header guardLioncash1-0/+2
2020-09-20renderer_opengl: Remove emulated mailbox presentationReinUsesLisp2-6/+0
Emulated mailbox presentation was causing performance issues on Nvidia's OpenGL driver. Remove it.
2020-09-19vk_query_cache: Hack counter destructor to avoid reserving queriesReinUsesLisp1-1/+10
This is a hack to destroy all HostCounter instances before the base class destructor is called. The query cache should be redesigned to have a proper ownership model instead of using shared pointers. For now, destroy the host counter hierarchy from the derived class destructor.
2020-09-19renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphoreReinUsesLisp37-799/+609
This reworks how host<->device synchronization works on the Vulkan backend. Instead of "protecting" resources with a fence and signalling these as free when the fence is known to be signalled by the host GPU, use timeline semaphores. Vulkan timeline semaphores allow use to work on a subset of D3D12 fences. As far as we are concerned, timeline semaphores are a value set by the host or the device that can be waited by either of them. Taking advantange of this, we can have a monolithically increasing atomic value for each submission to the graphics queue. Instead of protecting resources with a fence, we simply store the current logical tick (the atomic value stored in CPU memory). When we want to know if a resource is free, it can be compared to the current GPU tick. This greatly simplifies resource management code and the free status of resources should have less false negatives. To workaround bugs in validation layers, when these are attached there's a thread waiting for timeline semaphores.
2020-09-16video_core: Enforce -Werror=switchReinUsesLisp2-4/+36
This forces us to fix all -Wswitch warnings in video_core.
2020-09-06video_core: Remove all Core::System references in rendererReinUsesLisp19-240/+221
Now that the GPU is initialized when video backends are initialized, it's no longer needed to query components once the game is running: it can be done when yuzu is booting. This allows us to pass components between constructors and in the process remove all Core::System references in the video backend.
2020-08-31vk_device: Fix driver id check on AMD for VK_EXT_extended_dynamic_stateReinUsesLisp1-6/+9
'driver_id' can only be known on Vulkan 1.1 after creating a logical device. Move the driver id check to disable VK_EXT_extended_dynamic_state after the logical device is successfully initialized. The Vulkan device will have the extension enabled but it will not be used.
2020-08-29vk_device: Blacklist AMD proprietary from VK_EXT_extended_dynamic_stateReinUsesLisp1-1/+6
Vertex binding's <stride> is bugged on AMD's proprietary drivers when using VK_EXT_extended_dynamic_state. Blacklist it for now while we investigate how to report this issue to AMD.
2020-08-22video_core: Initialize renderer with a GPUReinUsesLisp2-3/+8
Add an extra step in GPU initialization to be able to initialize render backends with a valid GPU instance.
2020-08-21vk_state_tracker: Fix primitive topologyReinUsesLisp3-13/+14
State track the current primitive topology with a regular comparison instead of using dirty flags. This fixes a bug in dirty flags for this particular state and it also avoids unnecessary state changes as this property is stored in a frequently changed bit field.
2020-08-20vk_device: Use Vulkan 1.0 properlyReinUsesLisp5-52/+66
Enable the required capabilities to use Vulkan 1.0 without validation errors and disable those that are not compatible with it.
2020-08-20renderer_vulkan: Create a Vulkan 1.0 instance when 1.1 is not availableReinUsesLisp3-6/+26
This commit doesn't make yuzu compatible with Vulkan 1.0 yet, it only creates an 1.0 instance.
2020-08-18common/telemetry: Migrate namespace into the Common namespaceLioncash1-1/+1
Migrates the Telemetry namespace into the Common namespace to make the code consistent with the rest of our common code.
2020-08-16Remove unneeded newlines, optional Registry in shader paramsameerj3-6/+5
Addressing feedback from Rodrigo
2020-08-16move thread 1/4 count computation into allocate workers methodameerj1-11/+1
2020-08-16Address feedback, add shader compile notifier, update setting textameerj6-93/+51
2020-08-16Vk Async Worker directly emplace in cacheameerj2-5/+16
2020-08-16Address feedback. Bruteforce delete duplicatesameerj5-19/+38
2020-08-16Vk Async pipeline compilationameerj11-14/+98
2020-08-16common/fileutil: Convert namespace to Common::FSLioncash2-8/+8
Migrates a remaining common file over to the Common namespace, making it consistent with the rest of common files. This also allows for high-traffic FS related code to alias the filesystem function namespace as namespace FS = Common::FS; for more concise typing.
2020-08-14vulkan/wrapper: Avoid unnecessary copy in EnumerateInstanceExtensionProperties()Lioncash1-1/+1
Given this is implicitly creating a std::optional, we can move the vector into it.
2020-08-13General: Tidy up clang-format warnings part 2Lioncash1-14/+14
2020-08-03vulkan: Silence more -Wmissing-field-initializer warningsLioncash6-3/+18
2020-07-25vulkan: Resolve -Wmissing-field-initializer warningsLioncash2-0/+4
2020-07-21video_core: Remove unused variablesLioncash2-4/+2
Silences several compiler warnings about unused variables.
2020-07-21vk_rasterizer: Remove unused variable in Clear()Lioncash1-4/+0
The relevant values are already assigned further down in the lambda, so this can be removed entirely.
2020-07-18vk_device: Fix build error on old MSVC versionsReinUsesLisp1-3/+3
Designated initializers on old MSVC versions fail to build when they take the address of a constant.
2020-07-17wrapper: Make use of designated initializers where applicableLioncash1-56/+64
2020-07-17vk_texture_cache: Make use of designated initializers where applicableLioncash1-96/+135
2020-07-17vk_texture_cache: Amend mismatched access masks and indices in UploadBufferLioncash1-6/+4
Discovered while converting relevant parts of the codebase over to designated initializers.
2020-07-17vk_swapchain: Make use of designated initializers where applicableLioncash1-43/+51
2020-07-17vk_stream_buffer: Make use of designated initializers where applicableLioncash1-19/+16
2020-07-17vk_staging_buffer_pool: Make use of designated initializers where applicableLioncash1-13/+12
2020-07-17vk_shader_util: Make use of designated initializers where applicableLioncash1-7/+7
2020-07-17vk_scheduler: Make use of designated initializers where applicableLioncash1-27/+30
2020-07-17vk_sampler_cache: Make use of designated initializers where applicableLioncash1-24/+27
2020-07-17vk_resource_manager: Make use of designated initializers where applicableLioncash1-15/+14
2020-07-17vk_renderpass_cache: Make use of designated initializers where applicableLioncash1-59/+70
2020-07-17vk_rasterizer: Make use of designated initializers where applicableLioncash1-41/+47
2020-07-17vk_query_cache: Make use of designated initializers where applicableLioncash1-8/+8
2020-07-17vk_pipeline_cache: Make use of designated initializers where applicableLioncash1-31/+35
2020-07-17vk_memory_manager: Make use of designated initializers where applicableLioncash1-7/+6
2020-07-17vk_image: Make use of designated initializers where applicableLioncash1-15/+23
2020-07-17vk_descriptor_pool: Make use of designated initializers where applicableLioncash1-15/+18
2020-07-17vk_graphics_pipeline: Resolve narrowing warningsLioncash1-2/+4
For whatever reason, VK_TRUE and VK_FALSE aren't defined as having a VkBool32 type, so we need to cast to it explicitly.
2020-07-16vk_compute_pipeline: Make use of designated initializers where applicableLioncash1-63/+68
2020-07-16vk_compute_pass: Make use of designated initializers where applicableLioncash1-95/+99
Note: Some barriers can't be converted over yet, as they ICE MSVC.
2020-07-16vk_buffer_cache: Make use of designated initializers where applicableLioncash1-30/+33
Note: An array within CopyFrom() cannot be converted over yet, as it ICEs MSVC when converted over.
2020-07-16renderer_{opengl,vulkan}: Clamp shared memory to host's limitReinUsesLisp2-3/+14
This stops shaders from failing to build when the exceed host's shared memory size limit. An error is logged.
2020-07-14vk_device: Make use of designated initializers where applicableLioncash1-124/+152
Avoids redundant repetitions of variable names, and allows assignment all in one statement.
2020-07-14vk_graphics_pipeline: Make use of designated initializers where applicableLioncash1-198/+223
Avoids redundant variable name repetitions.
2020-07-13video_core: Rearrange pixel format namesReinUsesLisp3-99/+99
Normalizes pixel format names to match Vulkan names. Previous to this commit pixel formats had no convention, leading to confusion and potential bugs.
2020-07-13video_core: Fix DXT4 and RGB565ReinUsesLisp2-1/+4
2020-07-13video_core: Fix B5G6R5_UNORM render target formatReinUsesLisp1-0/+1
2020-07-13video_core: Fix B5G6R5UReinUsesLisp1-1/+1
2020-07-13video_core: Implement RGBA32_SINT render targetReinUsesLisp2-0/+2
2020-07-13video_core: Implement RGBA32_SINT render targetReinUsesLisp2-0/+2
2020-07-13video_core: Implement RGBA16_SINT render targetReinUsesLisp2-0/+2
2020-07-13video_core: Implement RGBA8_SINT render targetReinUsesLisp2-0/+2
2020-07-13video_core: Implement RG32_SINT render targetReinUsesLisp2-0/+2
2020-07-13video_core: Implement RG8_SINT render target and fix RG8_UINTReinUsesLisp2-0/+2
2020-07-13video_core: Implement R8_SINT render targetReinUsesLisp2-0/+2
2020-07-13video_core: Implement R8_SNORM render targetReinUsesLisp2-0/+2
2020-07-13vk_blit_screen: Make use of designated initializers where applicableLioncash1-334/+384
Now that we make use of C++20, we can use designated initializers to make things a little nicer to read.
2020-07-13vk_state_tracker: Fix dirty flags for stencil_enable on VK_EXT_extended_dynamic_stateReinUsesLisp1-0/+1
Fixes a regression on any game using stencil on devices with VK_EXT_extended_dynamic_state.
2020-07-10vk_rasterizer: Pass <pSizes> to CmdBindVertexBuffers2EXTReinUsesLisp1-6/+6
This has been fixed in Nvidia's public beta driver 451.74. The previous beta driver will be broken, people using these will have to update.
2020-07-10configuration: implement per-game configurations (#4098)lat9nq1-1/+1
* Switch game settings to use a pointer In order to add full per-game settings, we need to be able to tell yuzu to switch to using either the global or game configuration. Using a pointer makes it easier to switch. * configuration: add new UI without changing existing funcitonality The new UI also adds General, System, Graphics, Advanced Graphics, and Audio tabs, but as yet they do nothing. This commit keeps yuzu to the same functionality as originally branched. * configuration: Rename files These weren't included in the last commit. Now they are. * configuration: setup global configuration checkbox Global config checkbox now enables/disables the appropriate tabs in the game properties dialog. The use global configuration setting is now saved to the config, defaulting to true. This also addresses some changes requested in the PR. * configuration: swap to per-game config memory for properties dialog Does not set memory going in-game. Swaps to game values when opening the properties dialog, then swaps back when closing it. Uses a `memcpy` to swap. Also implements saving config files, limited to certain groups of configurations so as to not risk setting unsafe configurations. * configuration: change config interfaces to use config-specific pointers When a game is booted, we need to be able to open the configuration dialogs without changing the settings pointer in the game's emualtion. A new pointer specific to just the configuration dialogs can be used to separate changes to just those config dialogs without affecting the emulation. * configuration: boot a game using per-game settings Swaps values where needed to boot a game. * configuration: user correct config during emulation Creates a new pointer specifically for modifying the configuration while emulation is in progress. Both the regular configuration dialog and the game properties dialog now use the pointer Settings::config_values to focus edits to the correct struct. * settings: split Settings::values into two different structs By splitting the settings into two mutually exclusive structs, it becomes easier, as a developer, to determine how to use the Settings structs after per-game configurations is merged. Other benefits include only duplicating the required settings in memory. * settings: move use_docked_mode to Controls group `use_docked_mode` is set in the input settings and cannot be accessed from the system settings. Grouping it with system settings causes it to be saved with per-game settings, which may make transferring configs more difficult later on, especially since docked mode cannot be set from within the game properties dialog. * configuration: Fix the other yuzu executables and a regression In main.cpp, we have to get the title ID before the ROM is loaded, else the renderer will reflect only the global settings and now the user's game specific settings. * settings: use a template to duplicate memory for each setting Replaces the type of each variable in the Settings::Values struct with a new class that allows basic data reading and writing. The new struct Settings::Setting duplicates the data in memory and can manage global overrides per each setting. * configuration: correct add-ons config and swap settings when apropriate Any add-ons interaction happens directly through the global values struct. Swapping bewteen structs now also includes copying the necessary global configs that cannot be changed nor saved in per-game settings. General and System config menus now update based on whether it is viewing the global or per-game settings. * settings: restore old values struct No longer needed with the Settings::Setting class template. * configuration: implement hierarchical game properties dialog This sets the apropriate global or local data in each setting. * clang format * clang format take 2 can the docker container save this? * address comments and style issues * config: read and write settings with global awareness Adds new functions to read and write settings while keeping the global state in focus. Files now generated per-game are much smaller since often they only need address the global state. * settings: restore global state when necessary Upon closing a game or the game properties dialog, we need to restore all global settings to the original global state so that we can properly open the configuration dialog or boot a different game. * configuration: guard setting values incorrectly This disables setting values while a game is running if the setting is overwritten by a per game setting. * config: don't write local settings in the global config Simple guards to prevent writing the wrong settings in the wrong files. * configuration: add comments, assume less, and clang format No longer assumes that a disabled UI element means the global state is turned off, instead opting to directly answer that question. Still however assumes a game is running if it is in that state. * configuration: fix a logic error Should not be negated * restore settings' global state regardless of accept/cancel Fixes loading a properties dialog and causing the global config dialog to show local settings. * fix more logic errors Fixed the frame limit would set the global setting from the game properties dialog. Also strengthened the Settings::Setting member variables and simplified the logic in config reading (ReadSettingGlobal). * fix another logic error In my efforts to guard RestoreGlobalState, I accidentally negated the IsPowered condition. * configure_audio: set toggle_stretched_audio to tristate * fixed custom rtc and rng seed overwriting the global value * clang format * rebased * clang format take 4 * address my own review Basically revert unintended changes * settings: literal instead of casting "No need to cast, use 1U instead" Thanks, Morph! Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com> * Revert "settings: literal instead of casting " This reverts commit 95e992a87c898f3e882ffdb415bb0ef9f80f613f. * main: fix status buttons reporting wrong settings after stop emulation * settings: Log UseDockedMode in the Controls group This should have happened when use_docked_mode was moved over to the controls group internally. This just reflects this in the log. * main: load settings if the file has a title id In other words, don't exit if the loader has trouble getting a title id. * use a zero * settings: initalize resolution factor with constructor instead of casting * Revert "settings: initalize resolution factor with constructor instead of casting" This reverts commit 54c35ecb46a29953842614620f9b7de1aa9d5dc8. * configure_graphics: guard device selector when Vulkan is global Prevents the user from editing the device selector if Vulkan is the global renderer backend. Also resets the vulkan_device variable when the users switches back-and-forth between global and Vulkan. * address reviewer concerns Changes function variables to const wherever they don't need to be changed. Sets Settings::Setting to final as it should not be inherited from. Sets ConfigurationShared::use_global_text to static. Co-Authored-By: VolcaEM <volcaem@users.noreply.github.com> * main: load per-game settings after LoadROM This prevents `Restart Emulation` from restoring the global settings *after* the per-game settings were applied. Thanks to BSoDGamingYT for finding this bug. * Revert "main: load per-game settings after LoadROM" This reverts commit 9d0d48c52d2dcf3bfb1806cc8fa7d5a271a8a804. * main: only restore global settings when necessary Loading the per-game settings cannot happen after the ROM is loaded, so we have to specify when to restore the global state. Again thanks to BSoD for finding the bug. * configuration_shared: address reviewer concerns except operator overrides Dropping operator override usage in next commit. Co-Authored-By: LC <lioncash@users.noreply.github.com> * settings: Drop operator overrides from Setting template Requires using GetValue and SetValue explicitly. Also reverts a change that broke title ID formatting in the game properties dialog. * complete rebase * configuration_shared: translate "Use global configuration" Uses ConfigurePerGame to do so, since its usage, at least as of now, corresponds with ConfigurationShared. * configure_per_game: address reviewer concern As far as I understand, it prevents the program from unnecessarily copying strings. Co-Authored-By: LC <lioncash@users.noreply.github.com> Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com> Co-authored-by: VolcaEM <volcaem@users.noreply.github.com> Co-authored-by: LC <lioncash@users.noreply.github.com>
2020-07-10vk_stream_buffer: set allocable_size to 9 MiBlat9nq1-1/+1
This solves the crash on Linux systems running the current Linux Long Lived branch nVidia driver.
2020-06-28maxwell_to_vk: Reorder vertex formats and add A2B10G10R10 for all types except floatMorph1-75/+69
2020-06-27General: Tune the priority of main emulation threads so they have higher priority than less important helper threads.Fernando Sahmkow1-0/+2
2020-06-27vk_rasterizer: Use nullptr for <pSizes> in CmdBindVertexBuffers2EXTReinUsesLisp1-6/+6
Disable this temporarily.
2020-06-27vk_pipeline_cache: Avoid hashing and comparing dynamic state when possibleReinUsesLisp6-23/+51
With extended dynamic states, some bytes don't have to be collected from the pipeline key, hence we can avoid hashing and comparing them on lookups.
2020-06-27vulkan/fixed_pipeline_state: Move state out of individual structuresReinUsesLisp4-121/+84
2020-06-27vk_rasterizer: Use VK_EXT_extended_dynamic_stateReinUsesLisp5-46/+356
2020-06-27renderer_vulkan/wrapper: Add VK_EXT_extended_dynamic_state functionsReinUsesLisp2-0/+64
2020-06-27fixed_pipeline_state: Add requirements for VK_EXT_extended_dynamic_stateReinUsesLisp7-155/+143
This moves dynamic state present in VK_EXT_extended_dynamic_state to a separate structure in FixedPipelineState. This is structure is at the bottom allowing us to hash and memcmp only when the extension is not supported.
2020-06-27vk_device: Enable VK_EXT_extended_dynamic_state when availableReinUsesLisp2-0/+32
2020-06-26gl_buffer_cache: Copy to buffers created as STREAM_READ before downloadingReinUsesLisp2-6/+6
After marking buffers as resident, Nvidia's driver seems to take a slow path. To workaround this issue, copy to a STREAM_READ buffer and then call GetNamedBufferSubData on it. This is a temporary solution until we have asynchronous flushing.
2020-06-24buffer_cache: Use buffer methods instead of cache virtual methodsReinUsesLisp2-54/+58
2020-06-24gl_buffer_cache: Mark buffers as residentReinUsesLisp4-18/+29
Make stream buffer and cached buffers as resident and query their address. This allows us to use GPU addresses for several proprietary Nvidia extensions.
2020-06-22renderer_vulkan: Update validation layer name and test before enablingReinUsesLisp3-5/+43
Update validation layer string to VK_LAYER_KHRONOS_validation. While we are at it, properly check for available validation layers before enabling them.
2020-06-20vulkan/wrapper: Remove noexcept from GetSurfaceCapabilitiesKHR()Lioncash2-3/+2
Check() can throw an exception if the Vulkan result isn't successful. We remove the check so that std::terminate isn't outright called and allows for better debugging (should it ever actually fail).
2020-06-18vk_rasterizer: Don't preserve contents on full screen clearsReinUsesLisp2-7/+58
There's no need to load contents from the CPU when a clear resets all the contents of the underlying memory. This is already implemented on OpenGL and the texture cache.
2020-06-18vk_update_descriptor: Upload descriptor sets data directlyReinUsesLisp3-42/+30
Instead of copying to a temporary payload before sending the update task to the worker thread, insert elements to the payload directly.
2020-06-18vk_rasterizer: BindTransformFeedbackBuffersEXT accepts a size of type VkDeviceSizeMerryMage1-1/+1
2020-06-18renderer_vulkan: Fix macOS GetBundleDirectory referenceMerryMage1-1/+3
2020-06-18vk_sampler_cache: Emulate GL_LINEAR/NEAREST minification filtersMorph1-2/+4
Emulate GL_LINEAR/NEAREST minification filters using minLod = 0 and maxLod = 0.25 during sampler creation
2020-06-18maxwell_to_vk: Reorder filter cases and correct mipmap_filter=NoneMorph1-17/+15
maxwell_to_vk: Reorder filtering modes to start with None, then Nearest, then Linear. maxwell_to_vk: Logs filter modes under UNREACHABLE_MSG instead of UNIMPLEMENTED_MSG, since any unknown filter modes are invalid and not unimplemented. maxwell_to_vk: Return VK_SAMPLER_MIPMAP_MODE_NEAREST instead of VK_SAMPLER_MIPMAP_MODE_LINEAR when mipmap_filter is None with the description from the VkSamplerCreateInfo(3) man page.
2020-06-09buffer_cache: Avoid passing references of shared pointers and misc style changesReinUsesLisp3-24/+16
Instead of using as template argument a shared pointer, use the underlying type and manage shared pointers explicitly. This can make removing shared pointers from the cache more easy. While we are at it, make some misc style changes and general improvements (like insert_or_assign instead of operator[] + operator=).
2020-06-08texture_cache: Implement rendering to 3D texturesReinUsesLisp3-39/+79
This allows rendering to 3D textures with more than one slice. Applications are allowed to render to more than one slice of a texture using gl_Layer from a VTG shader. This also requires reworking how 3D texture collisions are handled, for now, this commit allows rendering to slices but not to miplevels. When a render target attempts to write to a mipmap, we fallback to the previous implementation (copying or flushing as needed). - Fixes color correction 3D textures on UE4 games (rainbow effects). - Allows Xenoblade games to render to 3D textures directly.
2020-06-07rasterizer_cache: Remove files and includesReinUsesLisp2-5/+3
The rasterizer cache is no longer used. Each cache has its own generic implementation optimized for the cached data.
2020-06-07vk_pipeline_cache: Use generic shader cacheReinUsesLisp4-55/+52
Trivial port the generic shader cache to Vulkan.
2020-06-05shader/texture: Join separate image and sampler pairs offlineReinUsesLisp1-0/+11
Games using D3D idioms can join images and samplers when a shader executes, instead of baking them into a combined sampler image. This is also possible on Vulkan. One approach to this solution would be to use separate samplers on Vulkan and leave this unimplemented on OpenGL, but we can't do this because there's no consistent way of determining which constant buffer holds a sampler and which one an image. We could in theory find the first bit and if it's in the TIC area, it's an image; but this falls apart when an image or sampler handle use an index of zero. The used approach is to track for a LOP.OR operation (this is done at an IR level, not at an ISA level), track again the constant buffers used as source and store this pair. Then, outside of shader execution, join the sample and image pair with a bitwise or operation. This approach won't work on games that truly use separate samplers in a meaningful way. For example, pooling textures in a 2D array and determining at runtime what sampler to use. This invalidates OpenGL's disk shader cache :) - Used mostly by D3D ports to Switch
2020-06-02vk_shader_decompiler: Implement atomic image operationsReinUsesLisp1-40/+24
Implement atomic operations on images. On GLSL these are atomicImage* functions (e.g. atomicImageAdd).
2020-06-02vk_rasterizer: Implement storage texelsReinUsesLisp8-52/+120
This is the equivalent of an image buffer on OpenGL. - Used by Octopath Traveler
2020-06-02maxwell_to_vk: Add R16UI image formatReinUsesLisp2-71/+74
- Used by Octopath Traveler
2020-05-29vk_rasterizer: Skip transform feedbacks when extension is unavailableReinUsesLisp1-0/+7
Avoids calling transform feedback procedures when VK_EXT_transform_feedback is not available.
2020-05-27shader/other: Implement MEMBAR.CTSReinUsesLisp1-3/+4
This silences an assertion we were hitting and uses workgroup memory barriers when the game requests it.
2020-05-26texture_cache: Implement depth stencil texture swizzlesReinUsesLisp1-16/+13
Stop ignoring image swizzles on depth and stencil images. This doesn't fix a known issue on Xenoblade Chronicles 2 where an OpenGL texture changes swizzles twice before being used. A proper fix would be having a small texture view cache for this like we do on Vulkan.
2020-05-26fixed_pipeline_state: Remove unnecessary check for front faces flipReinUsesLisp1-2/+1
The check to flip faces when viewports are negative were a left over from the old OpenGL code. This is not required on Vulkan where we have negative viewports.
2020-05-22shader/other: Implement BAR.SYNC 0x0ReinUsesLisp1-0/+17
Trivially implement this particular case of BAR. Unless games use OpenCL or CUDA barriers, we shouldn't hit any other case here.
2020-05-22shader/other: Implement thread comparisons (NV_shader_thread_group)ReinUsesLisp1-0/+23
Hardware S2R special registers match gl_Thread*MaskNV. We can trivially implement these using Nvidia's extension on OpenGL or naively stubbing them with the ARB instructions to match. This might cause issues if the host device warp size doesn't match Nvidia's. That said, this is unlikely on proper shaders. Refer to the attached url for more documentation about these flags. https://www.khronos.org/registry/OpenGL/extensions/NV/NV_shader_thread_group.txt
2020-05-22shader_decompiler: Visit source nodes even when they assign to RZReinUsesLisp1-1/+3
Some operations like atomicMin were ignored because they returned were being stored to RZ. This operations have a side effect and it was being ignored.
2020-05-22vk_shader_decompiler: Don't assert for void returnsReinUsesLisp1-2/+1
Atomic instructions can be used without returning anything and this is valid code. Remove the assert.
2020-05-21buffer_cache: Use boost::intrusive::set for cachingReinUsesLisp2-0/+2
Instead of using boost::icl::interval_map for caching, use boost::intrusive::set. interval_map is intended as a container where the keys can overlap with one another; we don't need this for caching buffers and a std::set-like data structure that allows us to search with lower_bound is enough.
2020-05-18maxwell_to_vk: Add format B8G8R8A8_SRGBMorph2-2/+3
Add format B8G8R8A8_SRGB and add Attachable capability for B8G8R8A8_UNORM Used by Bravely Default II
2020-05-16vk_rasterizer: Match OpenGL's FlushAndInvalidate behaviorReinUsesLisp1-1/+3
Match OpenGL's behavior. This can fix or simplify bisecting issues on Vulkan.
2020-05-13vk_rasterizer: Implement constant attributesReinUsesLisp4-13/+26
Constant attributes (in OpenGL known disabled attributes) are not supported on Vulkan, even with extensions. To emulate this behavior we return zero on reads from disabled vertex attributes in shader code. This has no caching cost because attribute formats are not dynamic state on Vulkan and we have to store it in the pipeline cache anyway. - Fixes Animal Crossing: New Horizons terrain borders
2020-05-13vk_rasterizer: Remove buffer check in attribute selectionReinUsesLisp1-4/+0
This was a left over from OpenGL when disabled buffers where not properly emulated. We no longer have to assert this as it is checked in vertex buffer initialization.
2020-05-10VkPipelineCache: Use a null shader on invalid address.Fernando Sahmkow1-2/+1
2020-05-10VideoCore: Use SyncGuestMemory mechanism for Shader/Pipeline Cache invalidation.Fernando Sahmkow1-2/+2
2020-05-09shader_ir: Separate float-point comparisons in ordered and unorderedReinUsesLisp1-1/+26
This allows us to use native SPIR-V instructions without having to manually check for NAN.
2020-05-05vk_sampler_cache: Use VK_EXT_custom_border_color when availableReinUsesLisp3-2/+44
This should fix grass interactions on Breath of the Wild on Vulkan. It is currently untested against validation layers. Nvidia's Windows 443.09 beta driver or Linux 440.66.12 is required for now.
2020-05-04vk_graphics_pipeline: Implement viewport swizzles with NV_viewport_swizzleReinUsesLisp7-0/+83
2020-05-02vk_graphics_pipeline: Implement rasterizer_enable on VulkanReinUsesLisp3-1/+3
We can simply enable rasterizer discard matching the current pipeline key.
2020-04-30maxwell_to_vk: implement missing signed int formatsDan1-2/+14
2020-04-30texture: Implement R8G8UIMorph2-0/+2
- Used by The Walking Dead: The Final Season
2020-04-29vulkan: Remove unnecessary includesLioncash30-58/+3
Reduces some header churn and reduces rebuilds when some header internals change. While we're at it we can also resolve a missing include in buffer_cache.
2020-04-28vk_rasterizer: Skip index buffer setup when vertices are zeroReinUsesLisp1-0/+3
Xenoblade 2 invokes a draw call with zero vertices. This is likely due to indirect drawing (glDrawArraysIndirect). This causes a crash in the staging buffer pool when trying to create a buffer with a size of zero. To workaround this, skip index buffer setup entirely when the number of indices is zero.
2020-04-28{maxwell_3d,buffer_cache}: Implement memory barriers using 3D registersReinUsesLisp5-3/+34
Drop MemoryBarrier from the buffer cache and use Maxwell3D's register WaitForIdle. To implement this on OpenGL we just call glMemoryBarrier with the necessary bits. Vulkan lacks this synchronization primitive, so we set an event and immediately wait for it. This is not a pretty solution, but it's what Vulkan can do without submitting the current command buffer to the queue (which ends up being more expensive on the CPU).
2020-04-28maxwell_3d: Fix depth clamping registerReinUsesLisp3-3/+3
Using deko3d as reference: https://github.com/devkitPro/deko3d/blob/4e47ba0013552e592a86ab7a2510d1e7dadf236a/source/maxwell/gpu_3d_state.cpp#L42 We were using bits 3 and 4 to determine depth clamping, but these are the same both enabled and disabled: state->depthClampEnable ? 0x101A : 0x181D The same happens on Nvidia's OpenGL driver, where they do something like this (default capabilities, GL 4.5 compatibility): (state & DEPTH_CLAMP) != 0 ? 0x201a : 0x281c There's always a difference between the first bits in this register, but bit 11 is consistently disabled on both deko3d/NVN and OpenGL. This commit changes yuzu's behaviour to use bit 11 to determine depth clamping. - Fixes depth issues on Super Mario Odyssey's intro.
2020-04-27texture_cache: Reintroduce preserve_contents accuratelyReinUsesLisp1-2/+2
This reverts commit 94b0e2e5dae4e0bd0021ac2d8fe1ff904a93ee69. preserve_contents proved to be a meaningful optimization. This commit reintroduces it but properly implemented on OpenGL. We have to make sure the clear removes all the previous contents of the image. It's not currently implemented on Vulkan because we can do smart things there that's preferred to be introduced in a separate commit.
2020-04-26shader/memory_util: Deduplicate codeReinUsesLisp2-63/+14
Deduplicate code shared between vk_pipeline_cache and gl_shader_cache as well as shader decoder code. While we are at it, fix a bug in gl_shader_cache where compute shaders had an start offset of a stage shader.
2020-04-26shader/arithmetic_integer: Implement CC for IADDReinUsesLisp1-0/+11
2020-04-25vk_rasterizer: Pack texceptions and color formats on invalid formatsReinUsesLisp2-5/+19
Sometimes for unknown reasons NVN games can bind a render target format of 0. This may be a yuzu bug. With the commits before this the formats were specified without being "packed", assuming all formats and texceptions will be written like in the color_attachments vector. To address this issue, iterate all render targets and pack them as they are valid. This way they will match color_attachments. - Fixes validation errors and graphical issues on Breath of the Wild.
2020-04-24Fix -Werror=conversion error.Markus Wick1-1/+1
2020-04-23shader_ir: Turn classes into data structuresReinUsesLisp3-45/+44
2020-04-23vk_rasterizer: Fix framebuffer creation validation errorsReinUsesLisp1-2/+4
Framebuffer creation was ignoring the number of color attachments.
2020-04-23vk_pipeline_cache: Unify pipeline cache keys into a single operationReinUsesLisp5-47/+59
This allows us to call Common::CityHash and std::memcmp only once for GraphicsPipelineCacheKey. While we are at it, do the same for compute.
2020-04-23vk_renderpass_cache: Pack renderpass cache key to 12 bytesReinUsesLisp4-84/+59
2020-04-23vk_pipeline_cache: Fix unintentional memcpy into optionalReinUsesLisp1-2/+4
The intention behind this was to assign a float to from an uint32_t, but it was unintentionally being copied directly into the std::optional. Copy to a temporary and assign that temporary to std::optional. This can be replaced with std::bit_cast<float> once we are in C++20.
2020-04-22Async GPU: Correct flushing behavior to be similar to old async GPU behavior.Fernando Sahmkow1-0/+4
2020-04-22ShaderCache/PipelineCache: Cache null shaders.Fernando Sahmkow2-4/+15
2020-04-22Address Feedback.Fernando Sahmkow3-3/+3
2020-04-22vk_fence_manager: Initial implementationReinUsesLisp6-12/+219
2020-04-22OpenGL: Guarantee writes to Buffers.Fernando Sahmkow1-2/+0
2020-04-22GPU: Implement Flush Requests for Async mode.Fernando Sahmkow1-0/+4
2020-04-22FenceManager: Manage syncpoints and rename fences to semaphores.Fernando Sahmkow2-3/+16
2020-04-22Rasterizer: Document SignalFence & ReleaseFences and setup skeletons on Vulkan.Fernando Sahmkow2-0/+27
2020-04-22ThreadManager: Sync async reads on accurate gpu.Fernando Sahmkow2-0/+5
2020-04-22BufferCache: Implement OnCPUWrite and SyncGuestHostFernando Sahmkow1-2/+2
2020-04-22GPU: Refactor synchronization on Async GPUFernando Sahmkow2-0/+16
2020-04-22vk_memory_manager: Remove unified memory model flagReinUsesLisp5-35/+6
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-22vk_rasterizer: Add lazy default buffer maker and use it for empty buffersReinUsesLisp3-4/+40
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-22gl_rasterizer: Fix buffers without sizeReinUsesLisp1-3/+3
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. https://github.com/devkitPro/deko3d/blob/1d1930beea093b5a663419e93b0649719a3ca5da/source/maxwell/gpu_3d_vbo.cpp#L62-L63
2020-04-20Initialize quad_indexed_pass before uint8_passAmit Prakash Ambasta1-1/+1
Fixes Werror=reorder in gcc
2020-04-19renderer_vulkan: assume X11 if not Windows/macOS after bf1d66b7c074Jan Beich1-3/+3
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-19vulkan/wrapper: Sort physical devicesReinUsesLisp1-1/+20
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-19fixed_pipeline_state: Hash and compare the whole structureReinUsesLisp2-105/+9
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-19fixed_pipeline_state: Pack blending stateReinUsesLisp3-98/+227
Reduce FixedPipelineState's size to 364 bytes.
2020-04-19fixed_pipeline_state: Pack rasterizer stateReinUsesLisp4-163/+155
Reduce FixedPipelineState's size to 600 bytes.
2020-04-19fixed_pipeline_state: Pack depth stencil stateReinUsesLisp3-97/+140
Reduce FixedPipelineState's size to 632 bytes.
2020-04-19fixed_pipeline_state: Pack attribute stateReinUsesLisp5-100/+84
Reduce FixedPipelineState's size from 1384 to 664 bytes
2020-04-17vk_stream_buffer: Fix out of memory on boot on recent Nvidia driversReinUsesLisp2-33/+48
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-17vk_compute_pass: Implement indexed quadsReinUsesLisp5-12/+280
Implement indexed quads (GL_QUADS used with glDrawElements*) with a compute pass conversion. The compute shader converts from uint8/uint16/uint32 indices to uint32. The format is passed through push constants to avoid having different variants of the same shader. - Used by Fast RMX - Used by Xenoblade Chronicles 2 (it still has graphical due to synchronization issues on Vulkan)
2020-04-16buffer_cache: Return handles instead of pointer to handlesReinUsesLisp7-51/+42
The original idea of returning pointers is that handles can be moved. The problem is that the implementation didn't take that in mind and made everything harder to work with. This commit drops pointer to handles and returns the handles themselves. While it is still true that handles can be invalidated, this way we get an old handle instead of a dangling pointer. This problem can be solved in the future with sparse buffers.
2020-04-16video_core: Amend doxygen comment referencesLioncash1-1/+1
Fixes broken documentation references.
2020-04-15maxwell_to_vk: Add uint16 vertex formatsReinUsesLisp1-0/+8
2020-04-15maxwell_to_vk: Add missing breaksReinUsesLisp1-0/+2
Avoid invalid fallbacks.
2020-04-15vk_blit_screen: Initialize all members in VkPipelineViewportStateCreateInfoReinUsesLisp1-0/+2
When the dynamic state is specified, pViewports and pScissors are ignored, quoting the specification: pViewports is a pointer to an array of VkViewport structures, defining the viewport transforms. If the viewport state is dynamic, this member is ignored. That said, AMD's proprietary driver itself seem to read it regardless of what the specification says.
2020-04-14vk_rasterizer: Default to 1 viewports with a size of 0ReinUsesLisp1-3/+6
Silence validation layer errors.
2020-04-14renderer_vulkan: Integrate Nvidia Nsight Aftermath on WindowsReinUsesLisp8-19/+344
Adds optional support for Nsight Aftermath. It is enabled through ENABLE_NSIGHT_AFTERMATH in cmake. A path to the SDK has to be provided by the environment variable NSIGHT_AFTERMATH_SDK. Nsight Aftermath allows an application to generate "minidumps" of the GPU state when a device loss happens. By analysing these on Nsight we can know what a game was doing and why it triggered a device loss. The dump is generated inside %APPDATA%\yuzu\log\gpucrash and this directory is deleted every time a new instance is initialized with Nsight enabled. To enable it on yuzu there has a to be a driver and device capable of running Nsight Aftermath on Vulkan. That means only Turing based GPUs on the latest stable driver, beta drivers won't work for now. It is manually enabled in Configuration>Debug>Enable Graphics Debugging because when using all debugging capabilities there is a runtime cost.
2020-04-13renderer_vulkan: Remove Nvidia checkpointsReinUsesLisp4-34/+0
2020-04-13renderer_vulkan: Catch device losses in more placesReinUsesLisp3-21/+29
2020-04-11texture_cache: Remove preserve_contentsReinUsesLisp1-2/+2
preserve_contents was always true. We can't assume we don't have to preserve clears because scissored and color masked clears exist. This removes preserve_contents and assumes it as true at all times.
2020-04-11renderer_vulkan: Drop Vulkan-HppReinUsesLisp50-2271/+2881
2020-04-09VkRasterizer: Eliminate Legacy code.Fernando Sahmkow1-1/+0
2020-04-08Memory: Address Feedback.Fernando Sahmkow1-2/+2
2020-04-07yuzu: Drop SDL2 and Qt frontend Vulkan requirementsReinUsesLisp5-105/+238
Create Vulkan instances and surfaces from the Vulkan backend.
2020-04-07renderer_vulkan: Query device names from the backendReinUsesLisp3-0/+73
2020-04-06Shader/Pipeline Cache: Use VAddr instead of physical memory for addressing.Fernando Sahmkow3-26/+22
2020-04-06Query Cache: Use VAddr instead of physical memory for adressing.Fernando Sahmkow1-2/+2
2020-04-06Buffer Cache: Use vAddr instead of physical memory.Fernando Sahmkow3-8/+8
2020-04-06Texture Cache: Use vAddr instead of physical memory for caching.Fernando Sahmkow1-4/+3
2020-04-06GPU: Setup Flush/Invalidate to use VAddr instead of CacheAddrFernando Sahmkow2-13/+21
2020-04-06shader_decode: SULD.D implement bits64 and reverse shader ir init method to removed shader stage.namkazy1-1/+1
2020-04-06shader/memory: Implement RED.E.ADDReinUsesLisp1-25/+40
Implements a reduction operation. It's an atomic operation that doesn't return a value. This commit introduces another primitive because some shading languages might have a primitive for reduction operations.
2020-04-05clang-formatNguyen Dac Nam1-2/+1
2020-04-05add shader stage when init shader irnamkazy1-1/+2
2020-04-02shader_decompiler: Remove FragCoord.w hack and change IPA implementationReinUsesLisp1-10/+7
Credits go to gdkchan and Ryujinx. The pull request used for this can be found here: https://github.com/Ryujinx/Ryujinx/pull/1082 yuzu was already using the header for interpolation, but it was missing the FragCoord.w multiplication described in the linked pull request. This commit finally removes the FragCoord.w == 1.0f hack from the shader decompiler. While we are at it, this commit renames some enumerations to match Nvidia's documentation (linked below) and fixes component declaration order in the shader program header (z and w were swapped). https://github.com/NVIDIA/open-gpu-doc/blob/master/Shader-Program-Header/Shader-Program-Header.html
2020-04-01vk_device: Add missing ASTC queriesReinUsesLisp1-14/+29
2020-04-01video_core: Use native ASTC when availableReinUsesLisp2-19/+17
2020-04-01renderer_vulkan/wrapper: Add vkEnumerateInstanceExtensionProperties wrapperReinUsesLisp2-0/+17
2020-04-01renderer_vulkan/wrapper: Add command buffer handleReinUsesLisp1-0/+192
2020-04-01renderer_vulkan/wrapper: Add physical device handleReinUsesLisp2-0/+123
2020-04-01renderer_vulkan/wrapper: Add device handleReinUsesLisp2-0/+277
2020-04-01renderer_vulkan/wrapper: Add swapchain handleReinUsesLisp2-0/+15
2020-04-01renderer_vulkan/wrapper: Add fence handleReinUsesLisp1-0/+17
2020-04-01renderer_vulkan/wrapper: Add device memory handleReinUsesLisp1-0/+15
2020-04-01renderer_vulkan/wrapper: Add pool handlesReinUsesLisp2-0/+47
2020-04-01renderer_vulkan/wrapper: Add buffer and image handlesReinUsesLisp2-0/+24
2020-04-01renderer_vulkan/wrapper: Add queue handleReinUsesLisp2-0/+36
2020-04-01renderer_vulkan/wrapper: Add instance handleReinUsesLisp2-0/+87
2020-03-30vk_decompiler: add atomic op and handler function.Nguyen Dac Nam1-6/+25
2020-03-28renderer_vulkan/wrapper: Address feedbackReinUsesLisp1-3/+24
2020-03-27renderer_vulkan/wrapper: Add owning handlesReinUsesLisp1-0/+18
2020-03-27renderer_vulkan/wrapper: Add pool allocations owning templated classReinUsesLisp1-0/+81
2020-03-27renderer_vulkan/wrapper: Add owning handle templated classReinUsesLisp1-0/+144
2020-03-27renderer_vulkan/wrapper: Add destroy and free overload setReinUsesLisp2-0/+133
2020-03-27renderer_vulkan/wrapper: Add dispatch table and loadersReinUsesLisp2-0/+283
2020-03-27renderer_vulkan/wrapper: Add exception classReinUsesLisp2-0/+34
2020-03-27renderer_vulkan/wrapper: Add ToString function for VkResultReinUsesLisp2-0/+90
2020-03-27renderer_vulkan/wrapper: Add Vulakn wrapper and a span helperReinUsesLisp1-0/+83
The intention behind a Vulkan wrapper is to drop Vulkan-Hpp. The issues with Vulkan-Hpp are: - Regular breaks of the API. - Copy constructors that do the same as the aggregates (fixed recently) - External dynamic dispatch that is hard to remove - Alias KHR handles with non-KHR handles making it impossible to use smart handles on Vulkan 1.0 instances with extensions that were included on Vulkan 1.1. - Dynamic dispatchers silently change size depending on preprocessor definitions. Different files will have different dispatch definitions, generating all kinds of hard to debug memory issues. In other words, Vulkan-Hpp is not "production ready" for our needs and this wrapper aims to replace it without losing RAII and exception safety.
2020-03-27maxwell_to_vk: implement signedscaled vertex formatsDan1-0/+20
2020-03-25Frontend/GPU: Refactor context managementJames Rowe2-2/+3
Changes the GraphicsContext to be managed by the GPU core. This eliminates the need for the frontends to fool around with tricky MakeCurrent/DoneCurrent calls that are dependent on the settings (such as async gpu option). This also refactors out the need to use QWidget::fromWindowContainer as that caused issues with focus and input handling. Now we use a regular QWidget and just access the native windowHandle() directly. Another change is removing the debug tool setting in FrameMailbox. Instead of trying to block the frontend until a new frame is ready, the core will now take over presentation and draw directly to the window if the renderer detects that its hooked by NSight or RenderDoc Lastly, since it was in the way, I removed ScopeAcquireWindowContext and replaced it with a simple subclass in GraphicsContext that achieves the same result
2020-03-19vk_texture_cache: Silence misc warningsReinUsesLisp1-3/+3
2020-03-19vk_staging_buffer_pool: Silence unused constant warningReinUsesLisp1-1/+1
2020-03-19vk_rasterizer: Remove unused variableReinUsesLisp1-2/+0
2020-03-19vk_pipeline_cache: Remove unused variableReinUsesLisp1-1/+0
2020-03-19maxwell_to_vk: Sielence -Wswitch warningReinUsesLisp1-0/+2
2020-03-15maxwell_to_vk: Implement RG32 and RGB32 integer vertex formatsReinUsesLisp1-0/+4
2020-03-15vk_rasterizer: Implement layered clearsReinUsesLisp1-2/+2
2020-03-15vk_shader_decompiler: fix linux buildmakigumo1-1/+1
2020-03-15vk_rasterizer: Fix vertex range assertReinUsesLisp1-1/+1
End can be equal to start in CalculateVertexArraysSize. This is quite common when the vertex size is zero.
2020-03-15vk_rasterizer: Reimplement clears with vkCmdClearAttachmentsReinUsesLisp4-45/+53
2020-03-14DirtyFlags: relax need to set render_targets as dirty Fernando Sahmkow1-2/+0
The texture cache already takes care of setting a render target to dirty when invalidated.
2020-03-13vk/gl_shader_decompiler: Silence assertion on computeReinUsesLisp1-3/+6
2020-03-13vk_shader_decompiler: Fix default varying regressionReinUsesLisp1-2/+6
2020-03-13vk_shader_decompiler: Fix implicit type conversionRodrigo Locatti1-1/+1
Co-Authored-By: Mat M. <mathew1800@gmail.com>
2020-03-13vk_rasterizer: Implement transform feedback binding zeroReinUsesLisp2-0/+46
2020-03-13vk_shader_decompiler: Add XFB decorations to generic varyingsReinUsesLisp1-16/+89
2020-03-13vk_device: Enable VK_EXT_transform_feedback when availableReinUsesLisp2-7/+40
2020-03-13vk_device: Shrink formatless capability name sizeReinUsesLisp3-26/+23
2020-03-13vk_shader_decompiler: Use registry for specializationReinUsesLisp4-31/+37
2020-03-13fix formattingmakigumo1-1/+1
2020-03-13maxwell_to_vk: add vertex format eA2B10G10R10UnormPack32makigumo1-1/+3
2020-03-13video_core: Implement RGBA16_SNORMReinUsesLisp2-0/+2
Implement RGBA16_SNORM with the current API. Nothing special here.
2020-03-09video_core: Rename "const buffer locker" to "registry"ReinUsesLisp2-4/+4
2020-03-08vk_reasterizer: fix mistype on SetupGraphicsImagesNguyen Dac Nam1-1/+1
This should use Maxwell3D engine. Fixed some GPU error on Kirby and maybe other games.
2020-03-06vk_rasterizer: Support disabled uniform buffersReinUsesLisp2-1/+9
2020-03-06maxwell_to_vk: Remove Storage capability for A1B5G5R5UReinUsesLisp1-1/+1
2020-02-28dirty_flags: Deduplicate code between OpenGL and VulkanReinUsesLisp1-39/+2
2020-02-28vk_rasterizer: Pass Maxwell registers to dynamic updatesReinUsesLisp2-26/+21
2020-02-28state_tracker: Remove type traits with named structuresReinUsesLisp2-10/+12
2020-02-28vk_state_tracker: Implement dirty flags for stencil propertiesReinUsesLisp3-0/+21
2020-02-28vk_state_tracker: Implement dirty flags for depth boundsReinUsesLisp3-0/+14
2020-02-28vk_state_tracker: Implement dirty flags for blend constantsReinUsesLisp3-0/+14
2020-02-28vk_state_tracker: Implement dirty flags for depth biasReinUsesLisp3-0/+17
2020-02-28vk_state_tracker: Implement dirty flags for scissorsReinUsesLisp3-0/+14
2020-02-28vk_state_tracker: Initial implementationReinUsesLisp9-52/+196
Add support for render targets and viewports.
2020-02-28maxwell_3d: Flatten cull and front face registersReinUsesLisp4-21/+20
2020-02-28gl_rasterizer: Remove dirty flagsReinUsesLisp2-32/+1
2020-02-26vk_swapchain: Silence TOCTOU race conditionReinUsesLisp1-9/+12
It's possible that the window is resized from the moment we ask for its size to the moment a swapchain is created, causing validation issues. To workaround this Vulkan issue request the capabilities again just before creating the swapchain, making the race condition less likely.
2020-02-26frontend: qt: bootmanager: Vulkan: Restore support for VK backend.bunnei2-9/+14
2020-02-24vk_shader_decompiler: Implement indexed texturesReinUsesLisp6-54/+99
Implement accessing textures through an index. It uses the same interface as OpenGL, the main difference is that Vulkan bindings are forced to be arrayed (the binding index doesn't change for stacked textures in SPIR-V).
2020-02-24video_core: Implement more scaler attribute formatsReinUsesLisp2-4/+16
While changing this, fix assert in vk_shader_decompiler. We now know scaled formats are expected to be float in shaders attributes.
2020-02-21vk_device: remove left over from other branchNguyen Dac Nam1-1/+0
2020-02-20clang-formatNguyen Dac Nam1-1/+1
2020-02-20shader_decompiler: only add StorageImageReadWithoutFormat when availableNguyen Dac Nam1-1/+4
2020-02-19shader_decompiler: add check in case of device not support ShaderStorageImageReadWithoutFormatNguyen Dac Nam1-0/+4
2020-02-19vk_device: setup shaderStorageImageReadWithoutFormatNguyen Dac Nam1-0/+5
2020-02-19vk_device: add check for shaderStorageImageReadWithoutFormatNguyen Dac Nam1-0/+7
2020-02-19vk_shader: add Capability StorageImageReadWithoutFormatNguyen Dac Nam1-0/+1
2020-02-19vk_shader: Implement function ImageLoad (Used by Kirby Start Allies)Nguyen Dac Nam1-2/+6
Please enter the commit message for your changes. Lines starting
2020-02-18fixups mistake auto commit.Nguyen Dac Nam1-9/+0
2020-02-18Update code structureNguyen Dac Nam1-0/+7
Co-Authored-By: Mat M. <mathew1800@gmail.com>
2020-02-18add vertex UnsignedInt size RGBANguyen Dac Nam1-0/+2
2020-02-18add eBc2SrgbBlock to formatsNguyen Dac Nam1-0/+1
2020-02-18vulkan: add DXT23_SRGBNguyen Dac Nam1-1/+1
2020-02-18renderer_vulkan: Add the rest of case for TryConvertBorderColorNguyen Dac Nam1-3/+10
2020-02-16texture_cache: Implement layered framebuffer attachmentsReinUsesLisp3-10/+21
Layered framebuffer attachments is a feature that allows applications to write attach layered textures to a single attachment. What layer the fragments are written to is decided from the shader using gl_Layer.
2020-02-16vk_shader_decompiler: Implement Layer output attributeReinUsesLisp1-6/+30
SPIR-V's Layer is GLSL's gl_Layer. It lets the application choose from a shader stage (vertex, tessellation or geometry) which framebuffer layer write the output fragments to.
2020-02-15texture: Implement R32IReinUsesLisp2-0/+2
2020-02-14maxwell_3d: Unify draw methodsReinUsesLisp2-14/+1
Pass instanced state of a draw invocation as an argument instead of having two separate virtual methods.
2020-02-14vk_query_cache: Implement generic query cache on VulkanReinUsesLisp7-3/+283
2020-02-14vk_shader_decompiler: Fix vertex id and instance idReinUsesLisp1-4/+13
Vulkan's VertexIndex and InstanceIndex don't match with hardware. This is because Nvidia implements gl_VertexID and gl_InstanceID. The math that relates these is: gl_VertexIndex = gl_BaseVertex + gl_VertexID gl_InstanceIndex = gl_InstanceIndex + gl_InstanceID To emulate it using what Vulkan's SPIR-V offers (the *Index variants) this commit substracts gl_Base* from gl_*Index to obtain the OpenGL and hardware's equivalent.
2020-02-04vk_rasterizer: Use noexcept variants of std::bitsetReinUsesLisp1-4/+5
Removes bounds checking from "texceptions" instances.
2020-01-29yuzu: Implement Vulkan frontendReinUsesLisp1-0/+265
Adds a Qt and SDL2 frontend for Vulkan. It also finishes the missing bits on Vulkan initialization.
2020-01-29settings: Add settings for graphics backendReinUsesLisp1-2/+4
2020-01-26shader/memory: Implement ATOM.ADDReinUsesLisp1-33/+33
ATOM operates atomically on global memory. For now only add ATOM.ADD since that's what was found in commercial games. This asserts for ATOM.ADD.S32 (handling the others as unimplemented), although ATOM.ADD.U32 shouldn't be any different. This change forces us to change the default type on SPIR-V storage buffers from float to uint. We could also alias the buffers, but it's simpler for now to just use uint. While we are at it, abstract the code to avoid repetition.
2020-01-25Shader_IR: Address feedback.Fernando Sahmkow1-2/+3
2020-01-24Shader_IR: Correct Custom Variable assignment.Fernando Sahmkow1-0/+2
2020-01-24Shader_IR: Implement Injectable Custom Variables to the IR.Fernando Sahmkow1-0/+16
2020-01-24vk_shader_decompiler: Disable default values on unwritten render targetsReinUsesLisp3-19/+16
Some games like The Legend of Zelda: Breath of the Wild assign render targets without writing them from the fragment shader. This generates Vulkan validation errors, so silence these I previously introduced a commit to set "vec4(0, 0, 0, 1)" for these attachments. The problem is that this is not what games expect. This commit reverts that change.
2020-01-20vk_blit_screen: Address feedbackReinUsesLisp4-22/+25
2020-01-20vk_blit_screen: Initial implementationReinUsesLisp2-0/+743
This abstraction takes care of presenting accelerated and non-accelerated or "framebuffer" images to the Vulkan swapchain.
2020-01-19vk_shader_decompiler: Implement UAtomicAdd (ATOMS) on SPIR-VReinUsesLisp1-3/+11
Also updates sirit to include atomic instructions.
2020-01-18vk_graphics_pipeline: Set front facing properlyReinUsesLisp1-2/+1
Front face was being forced to a certain value when cull face is disabled. Set a default value on initialization and drop the forcefully set front facing value with culling disabled.
2020-01-18vk_rasterizer: Address feedbackReinUsesLisp2-25/+32
2020-01-17vk_rasterizer: Implement Vulkan's rasterizerReinUsesLisp2-1/+1385
This abstraction is Vulkan's equivalent to OpenGL's rasterizer. It takes care of joining all parts of the backend and rendering accordingly on demand.
2020-01-17renderer_vulkan: Add header as placeholderReinUsesLisp1-0/+72
2020-01-16vk_texture_cache: Address feedbackReinUsesLisp2-22/+8
2020-01-16shader/memory: Implement ATOMS.ADD.U32ReinUsesLisp1-0/+7
2020-01-16vk_texture_cache: Fix typo in commentaryRodrigo Locatti1-1/+1
Co-Authored-By: MysticExile <30736337+MysticExile@users.noreply.github.com>
2020-01-14vk_texture_cache: Implement generic texture cache on VulkanReinUsesLisp3-0/+729
It currently ignores PBO linearizations since these should be dropped as soon as possible on OpenGL.
2020-01-11vk_compute_pass: Address feedbackRodrigo Locatti1-0/+2
Comment hardcoded SPIR-V modules.
2020-01-10maxwell_to_vk: Implement GL_CLAMP hacking Nvidia's driverReinUsesLisp3-6/+11
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.
2020-01-08vk_compute_pass: Add compute passes to emulate missing Vulkan featuresReinUsesLisp2-0/+414
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.
2020-01-08vk_shader_util: Add helper to build SPIR-V shadersReinUsesLisp2-0/+51
2020-01-07vk_pipeline_cache: Initial implementationReinUsesLisp2-1/+460
Given a pipeline key, this cache returns a pipeline abstraction (for graphics or compute).
2020-01-07vk_graphics_pipeline: Initial implementationReinUsesLisp3-0/+393
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.
2020-01-07vk_compute_pipeline: Initial implementationReinUsesLisp3-0/+217
This abstraction represents a Vulkan compute pipeline.
2020-01-07vk_pipeline_cache: Add file and define descriptor update template fillerReinUsesLisp2-0/+65
This function allows us to share code between compute and graphics pipelines compilation.
2020-01-07fixed_pipeline_state: Add depth clampReinUsesLisp2-10/+18
2020-01-07vk_rasterizer: Add placeholderReinUsesLisp1-0/+13
2020-01-06vk_renderpass_cache: Initial implementationReinUsesLisp2-0/+197
The renderpass cache is used to avoid creating renderpasses on each draw. The hashed structure is not currently optimized.
2020-01-06vk_update_descriptor: Initial implementationReinUsesLisp2-0/+143
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.
2020-01-06vk_stream_buffer/vk_buffer_cache: Avoid halting and use generic cacheReinUsesLisp4-62/+340
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.
2020-01-06vk_memory_manager: Misc changesReinUsesLisp2-88/+142
* 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.
2020-01-06vk_buffer_cache: Temporarily remove buffer cacheReinUsesLisp2-226/+0
This is intended for a follow up commit to avoid circular dependencies.
2020-01-04Shader_IR: Address FeedbackFernando Sahmkow1-14/+4
2020-01-03Update src/video_core/renderer_vulkan/vk_descriptor_pool.cppRodrigo Locatti1-1/+1
Co-Authored-By: Mat M. <mathew1800@gmail.com>
2020-01-01vk_descriptor_pool: Initial implementationReinUsesLisp2-0/+145
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.
2019-12-30Shader_IR: add the ability to amend code in the shader ir.Fernando Sahmkow1-0/+18
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.
2019-12-30vk_image: Avoid unnecesary equalsRodrigo Locatti1-1/+1
2019-12-29vk_staging_buffer_pool: Initialize last epoch to zeroRodrigo Locatti1-1/+1
2019-12-25vk_staging_buffer_pool: Add a staging pool for temporary operationsReinUsesLisp2-0/+210
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.
2019-12-25vk_image: Add an image object abstractionReinUsesLisp2-0/+190
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.
2019-12-24fixed_pipeline_state: Define symetric operator!= and mark as noexceptReinUsesLisp2-40/+92
Marks as noexcept Hash, operator== and operator!= for consistency.
2019-12-23fixed_pipeline_state: Define structure and loadersReinUsesLisp2-0/+526
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.
2019-12-21vk_shader_decompiler: Use Visit instead of reimplementing itReinUsesLisp1-23/+1
ExprCondCode visit implements the generic Visit. Use this instead of that one. As an intended side effect this fixes unwritten memory usages in cases when a negation of a condition code is used.
2019-12-19vk_resource_manager: Add entry to VKFence to test its usageReinUsesLisp1-0/+8
2019-12-19vk_reosurce_manager: Add assert for releasing fencesReinUsesLisp1-0/+1
Notify the programmer when a request to release a fence is invalid because the fence is already free.
2019-12-19vk_resource_manager: Implement VKFenceWatch move constructorReinUsesLisp2-0/+32
This allows us to put VKFenceWatch inside a std::vector without storing it in heap. On move we have to signal the fences where the new protected resource is, adding some overhead.
2019-12-19vk_device: Add entry to catch device lossesReinUsesLisp3-1/+40
VK_NV_device_diagnostic_checkpoints allows us to push data to a Vulkan queue and then query it even after a device loss. This allows us to push the current pipeline object and see what was the call that killed the device.
2019-12-19vk_shader_decompiler: Fix full decompilationReinUsesLisp1-3/+5
When full decompilation was enabled, labels were not being inserted and instructions were misused. Fix these bugs.
2019-12-19vk_shader_decompiler: Skip NDC correction when it is nativeReinUsesLisp2-1/+2
Avoid changing gl_Position when the NDC used by the game is [0, 1] (Vulkan's native).
2019-12-19vk_shader_decompiler: Normalize output fragment attachmentsReinUsesLisp2-12/+12
Some games write from fragment shaders to an unexistant framebuffer attachment or they don't write to one when it exists in the framebuffer. Fix this by skipping writes or adding zeroes.
2019-12-19vk_device: Add query for RGBA8UintReinUsesLisp1-0/+1
2019-12-19vk_shader_decompiler: Update sirit and implement Texture AOFFIReinUsesLisp1-22/+30
2019-12-16renderer_vulkan/shader: Add helper GLSL shadersReinUsesLisp4-0/+122
These shaders are used to specify code that is not dynamically generated in the Vulkan backend. Instead of packing it inside the build system, it's manually built and copied to the C++ file to avoid adding unnecessary build time dependencies. quad_array should be dropped in the future since it can be emulated with a memory pool generated from the CPU.
2019-12-13maxwell_to_vk: Improve image format table and add more formatsReinUsesLisp2-89/+127
A1B5G5R5 uses A1R5G5B5. This is flipped with image view swizzles; flushing is still not properly implemented on Vulkan for this particular format.
2019-12-13maxwell_to_vk: Implement more vertex formatsReinUsesLisp1-7/+81
2019-12-13maxwell_to_vk: Implement more primitive topologiesReinUsesLisp2-2/+11
Add an extra argument to query device capabilities in the future. The intention behind this is to use native quads, quad strips, line loops and polygons if these are released for Vulkan.
2019-12-13maxwell_to_vk: Approach GL_CLAMP closer to the GL specReinUsesLisp3-9/+17
The OpenGL spec defines GL_CLAMP's formula similarly to CLAMP_TO_EDGE and CLAMP_TO_BORDER depending on the filter mode used. It doesn't exactly behave like this, but it's the closest we can get with what Vulkan offers without emulating it by injecting shader code.
2019-12-13maxwell_to_vk: Use VK_EXT_index_type_uint8 when availableReinUsesLisp2-4/+7
2019-12-13vk_scheduler: Delegate commands to a worker thread and state trackReinUsesLisp2-37/+311
Introduce a worker thread approach for delegating Vulkan work derived from dxvk's approach. https://github.com/doitsujin/dxvk Now that the scheduler is what handles all Vulkan work related to command streaming, store state tracking in itself. This way we can know when to reupload Vulkan dynamic state to the queue (since this one is invalidated between command buffers unlike NVN). We can also store the renderpass state and graphics pipeline bound to avoid redundant binds and renderpass begins/ends.
2019-12-10shader: Implement MEMBAR.GLReinUsesLisp1-0/+14
Implement using memoryBarrier in GLSL and OpMemoryBarrier on SPIR-V.
2019-12-10vk_shader_decompiler: Fix build issues on old gcc versionsReinUsesLisp1-2/+3
2019-12-10vk_shader_decompiler: Reduce YNegate's severityReinUsesLisp1-1/+1
2019-12-10shader_ir/other: Implement S2R InvocationIdReinUsesLisp1-0/+1
2019-12-10vk_shader_decompiler: Misc changesReinUsesLisp2-697/+1648
Update Sirit and its usage in vk_shader_decompiler. Highlights: - Implement tessellation shaders - Implement geometry shaders - Implement some missing features - Use native half float instructions when available.
2019-12-09vk_device: Misc changesReinUsesLisp2-117/+276
- Setup more features and requirements. - Improve logging for missing features. - Collect telemetry parameters. - Add queries for more image formats. - Query push constants limits. - Optionally enable some extensions.
2019-12-09externals: Update Vulkan-HeadersReinUsesLisp2-2/+14
2019-12-07vk_swapchain: Add support for swapping sRGBReinUsesLisp2-24/+31
We don't know until the game is running if it's using an sRGB color space or not. Add support for hot-swapping swapchain surface formats.
2019-11-27core/memory: Migrate over GetPointer()Lioncash1-3/+3
With all of the interfaces ready for migration, it's trivial to migrate over GetPointer().
2019-11-27core: Prepare various classes for memory read/write migrationLioncash2-2/+9
Amends a few interfaces to be able to handle the migration over to the new Memory class by passing the class by reference as a function parameter where necessary. Notably, within the filesystem services, this eliminates two ReadBlock() calls by using the helper functions of HLERequestContext to do that for us.
2019-11-23video_core: Unify ProgramType and ShaderStage into ShaderTypeReinUsesLisp4-22/+25
2019-11-14texture_cache: Drop abstracted ComponentTypeReinUsesLisp2-74/+71
Abstracted ComponentType was not being used in a meaningful way. This commit drops its usage. There is one place where it was being used to test compatibility between two cached surfaces, but this one is implied in the pixel format. Removing the component type test doesn't change the behaviour.
2019-11-14Shader_IR: Implement TXD instruction.Fernando Sahmkow1-0/+6
2019-11-14Shader_IR: Implement FLO instruction.Fernando Sahmkow1-0/+2
2019-11-08shader_ir/warp: Implement FSWZADDReinUsesLisp1-0/+6
2019-11-08gl_shader_decompiler: Reimplement shuffles with platform agnostic intrinsicsReinUsesLisp1-40/+3
2019-10-25Shader_IR: Implement Fast BRX and allow multi-branches in the CFG.Fernando Sahmkow1-0/+7
2019-10-18vk_shader_decompiler: Mark operator() function parameters as const referencesLioncash1-21/+23
These parameters aren't actually modified in any way, so they can be made const references.
2019-10-16vk_shader_decompiler: Resolve fallthrough within ExprDecompiler's ExprCondCode operator()Lioncash1-0/+3
This would previously result in NeverExecute and UnusedIndex being treated as regular predicates.
2019-10-05Shader_Ir: Address Feedback and clang format.Fernando Sahmkow1-25/+18
2019-10-05vk_shader_decompiler: Correct Branches inside conditionals.Fernando Sahmkow1-1/+11
2019-10-05vk_shader_decompiler: Clean code and be const correct.Fernando Sahmkow1-7/+5
2019-10-05vk_shader_compiler: Don't enclose branches with if(true) to avoid crashing AMDFernando Sahmkow1-16/+33
2019-10-05vk_shader_compiler: Correct SPIR-V AST DecompilingFernando Sahmkow1-4/+11
2019-10-05Shader_IR: allow else derivation to be optional.Fernando Sahmkow1-2/+4
2019-10-05vk_shader_compiler: Implement the decompiler in SPIR-VFernando Sahmkow1-22/+276
2019-09-22video_core: Implement RGBX16F PixelFormatFearlessTobi1-0/+1
2019-09-21gl_shader_decompiler: Use uint for images and fix SUATOMReinUsesLisp1-12/+0
In the process remove implementation of SUATOM.MIN and SUATOM.MAX as these require a distinction between U32 and S32. These have to be implemented with imageCompSwap loop.
2019-09-21shader/image: Implement SULD and remove irrelevant codeReinUsesLisp1-0/+7
* Implement SULD as float. * Remove conditional declaration of GL_ARB_shader_viewport_layer_array.
2019-09-17shader_ir/warp: Implement SHFLReinUsesLisp1-0/+50
2019-09-13vk_device: Add miscellaneous features and minor style changesReinUsesLisp3-111/+258
* Increase minimum Vulkan requirements * Require VK_EXT_vertex_attribute_divisor * Require depthClamp, samplerAnisotropy and largePoints features * Search and expose VK_KHR_uniform_buffer_standard_layout * Search and expose VK_EXT_index_type_uint8 * Search and expose native float16 arithmetics * Track current driver with VK_KHR_driver_properties * Query and expose SSBO alignment * Query more image formats * Improve logging overall * Minor style changes * Minor rephrasing of commentaries
2019-09-11shader/image: Implement SUATOM and fix SUSTReinUsesLisp1-0/+42
2019-08-21shader_ir: Implement VOTEReinUsesLisp1-0/+25
Implement VOTE using Nvidia's intrinsics. Documentation about these can be found here https://developer.nvidia.com/reading-between-threads-shader-intrinsics Instead of using portable ARB instructions I opted to use Nvidia intrinsics because these are the closest we have to how Tegra X1 hardware renders. To stub VOTE on non-Nvidia drivers (including nouveau) this commit simulates a GPU with a warp size of one, returning what is meaningful for the instruction being emulated: * anyThreadNV(value) -> value * allThreadsNV(value) -> value * allThreadsEqualNV(value) -> true ballotARB, also known as "uint64_t(activeThreadsNV())", emits VOTE.ANY Rd, PT, PT; on nouveau's compiler. This doesn't match exactly to Nvidia's code VOTE.ALL Rd, PT, PT; Which is emulated with activeThreadsNV() by this commit. In theory this shouldn't really matter since .ANY, .ALL and .EQ affect the predicates (set to PT on those cases) and not the registers.
2019-07-20Shader_Ir: Implement F16 Variants of F2F, F2I, I2F.Fernando Sahmkow1-0/+18
This commit takes care of implementing the F16 Variants of the conversion instructions and makes sure conversions are done.
2019-07-20shader/half_set_predicate: Fix HSETP2 implementationReinUsesLisp1-13/+4
2019-07-09shader_ir: Implement BRX & BRA.CCFernando Sahmkow1-0/+9
2019-07-08gl_shader_decompiler: Implement gl_ViewportIndex and gl_Layer in vertex shadersReinUsesLisp1-8/+6
This commit implements gl_ViewportIndex and gl_Layer in vertex and geometry shaders. In the case it's used in a vertex shader, it requires ARB_shader_viewport_layer_array. This extension is available on AMD and Nvidia devices (mesa and proprietary drivers), but not available on Intel on any platform. At the moment of writing this description I don't know if this is a hardware limitation or a driver limitation. In the case that ARB_shader_viewport_layer_array is not available, writes to these registers on a vertex shader are ignored, with the appropriate logging.
2019-07-07vk_sampler_cache: Remove unused includesLioncash1-3/+0
These are no longer used within this header, so they can be removed.
2019-07-07video_core: Add missing override specifiersLioncash1-2/+2
2019-07-07vk_scheduler: Drop execution context in favor of viewsReinUsesLisp6-50/+60
Instead of passing by copy an execution context through out the whole Vulkan call hierarchy, use a command buffer view and fence view approach. This internally dereferences the command buffer or fence forcing the user to be unable to use an outdated version of it on normal usage. It is still possible to keep store an outdated if it is casted to VKFence& or vk::CommandBuffer. While changing this file, add an extra parameter for Flush and Finish to allow releasing the fence from this calls.
2019-06-21shader: Decode SUST and implement backing image functionalityReinUsesLisp1-0/+7
2019-06-07shader: Split SSY and PBK stackReinUsesLisp1-12/+37
Hardware testing revealed that SSY and PBK push to a different stack, allowing code like this: SSY label1; PBK label2; SYNC; label1: PBK; label2: EXIT;
2019-06-06shader: Use shared_ptr to store nodes and move initialization to fileReinUsesLisp1-25/+25
Instead of having a vector of unique_ptr stored in a vector and returning star pointers to this, use shared_ptr. While changing initialization code, move it to a separate file when possible. This is a first step to allow code analysis and node generation beyond the ShaderIR class.
2019-05-30maxwell_to_gl: Use GL_CLAMP to emulate Clamp wrap modeReinUsesLisp1-1/+1
2019-05-26vk_device: Let formats array type be deducedReinUsesLisp1-33/+33
2019-05-26vk_shader_decompiler: Misc fixesReinUsesLisp2-45/+67
Fix missing OpSelectionMerge instruction. This caused devices loses on most hardware, Intel didn't care. Fix [-1;1] -> [0;1] depth conversions. Conditionally use VK_EXT_scalar_block_layout. This allows us to use non-std140 layouts on UBOs. Update external Vulkan headers.
2019-05-26vk_device: Enable features when available and misc changesReinUsesLisp2-43/+151
Keeps track of native ASTC support, VK_EXT_scalar_block_layout availability and SSBO range. Check for independentBlend and vertexPipelineStorageAndAtomics as a required feature. Always enable it. Use vk::to_string format to log Vulkan enums. Style changes.
2019-05-20shader: Implement S2R Tid{XYZ} and CtaId{XYZ}ReinUsesLisp1-0/+18
2019-05-10renderer_vulkan/vk_shader_decompiler: Remove unused variable from DeclareInternalFlags()Lioncash1-1/+0
2019-05-03shader: Remove unused AbufNode Ipa modeReinUsesLisp1-4/+3
2019-04-21Rasterizer Cache: Use a temporal storage for Surfaces loading/flushing.Fernando Sahmkow1-1/+0
This PR should heavily reduce memory usage since temporal buffers are no longer stored per Surface but instead managed by the Rasterizer Cache.
2019-04-20RasterizerCache Redesign: Flush Fernando Sahmkow1-2/+4
flushing is now responsability of children caches instead of the cache object. This change will allow the specific cache to pass extra parameters on flushing and will allow more flexibility.
2019-04-18video_core: Silent -Wswitch warningsReinUsesLisp1-4/+6
2019-04-16vk_shader_decompiler: Add missing operationsReinUsesLisp1-0/+7
2019-04-16shader_ir/decode: Fix half float pre-operations and remove MetaHalfArithmeticReinUsesLisp1-5/+7
Operations done before the main half float operation (like HAdd) were managing a packed value instead of the unpacked one. Adding an unpacked operation allows us to drop the per-operand MetaHalfArithmetic entry, simplifying the code overall.
2019-04-16shader_ir/decode: Implement half float saturationReinUsesLisp1-0/+6
2019-04-14shader_ir: Implement STG, keep track of global memory usage and flushReinUsesLisp1-6/+8
2019-04-10vk_shader_decompiler: Implement flow primitivesReinUsesLisp1-5/+82
2019-04-10vk_shader_decompiler: Implement most common texture primitivesReinUsesLisp1-8/+65
2019-04-10vk_shader_decompiler: Implement texture decompilation helper functionsReinUsesLisp1-0/+32
2019-04-10vk_shader_decompiler: Implement Assign and LogicalAssignReinUsesLisp1-2/+64
2019-04-10vk_shader_decompiler: Implement non-OperationCode visitsReinUsesLisp1-7/+129
2019-04-10vk_shader_decompiler: Implement OperationCode decompilation interfaceReinUsesLisp1-1/+411
2019-04-10vk_shader_decompiler: Implement VisitReinUsesLisp1-1/+50
2019-04-10vk_shader_decompiler: Implement labels tree and flowReinUsesLisp1-0/+71
2019-04-10vk_shader_decompiler: Implement declarationsReinUsesLisp1-3/+457
2019-04-10vk_shader_decompiler: Declare and stub interface for a SPIR-V decompilerReinUsesLisp2-0/+125
2019-04-06video_core/engines: Remove unnecessary inclusions where applicableLioncash1-0/+1
Replaces header inclusions with forward declarations where applicable and also removes unused headers within the cpp file. This reduces a few more dependencies on core/memory.h
2019-04-02video_core: Abstract vk_sampler_cache into a templated classReinUsesLisp2-58/+18
2019-03-29vk_swapchain: Implement a swapchain managerReinUsesLisp2-0/+302
2019-03-27video_core: Amend constructor initializer list order where applicableLioncash1-2/+2
Specifies the members in the same order that initialization would take place in. This also silences -Wreorder warnings.
2019-03-27video_core: Add missing override specifiersLioncash2-2/+2
Ensures that the signatures will always match with the base class. Also silences a few compilation warnings.
2019-03-21gpu: Move GPUVAddr definition to common_types.bunnei2-4/+2
2019-03-15gpu: Use host address for caching instead of guest address.bunnei2-17/+41
2019-03-13vk_sampler_cache: Use operator== instead of memcmpMat M1-1/+1
Co-Authored-By: ReinUsesLisp <reinuseslisp@airmail.cc>
2019-03-13vk_sampler_cache: Implement a sampler cacheReinUsesLisp2-0/+137
2019-03-06video_core/engines: Remove unnecessary includesLioncash1-1/+1
Removes a few unnecessary dependencies on core-related machinery, such as the core.h and memory.h, which reduces the amount of rebuilding necessary if those files change. This also uncovered some indirect dependencies within other source files. This also fixes those.
2019-03-04maxwell_to_vk: Initial implementationReinUsesLisp3-3/+551
2019-03-02vk_buffer_cache: Fix clang-formatReinUsesLisp1-3/+3
2019-03-01vk_buffer_cache: Implement a buffer cacheReinUsesLisp2-0/+203
This buffer cache is just like OpenGL's buffer cache with some minor style changes. It uses VKStreamBuffer.
2019-02-27vk_memory_manager: Reorder constructor initializer list in terms of member declaration orderLioncash1-1/+1
Reorders members in the order that they would actually be initialized in. Silences a -Wreorder warning.
2019-02-26vk_stream_buffer: Remove copy code pathReinUsesLisp2-53/+18
2019-02-24vk_stream_buffer: Implement a stream bufferReinUsesLisp2-0/+197
This manages two kinds of streaming buffers: one for unified memory models and one for dedicated GPUs. The first one skips the copy from the staging buffer to the real buffer, since it creates an unified buffer. This implementation waits for all fences to finish their operation before "invalidating". This is suboptimal since it should allocate another buffer or start searching from the beginning. There is room for improvement here. This could also handle AMD's "pinned" memory (a heap with 256 MiB) that seems to be designed for buffer streaming.
2019-02-24vk_resource_manager: Minor VKFenceWatch changesReinUsesLisp2-7/+7
2019-02-24vk_memory_manager: Fixup commit interval allocationReinUsesLisp1-2/+1
VKMemoryCommitImpl was using as the end of its interval "begin + end". That ended up wasting memory.
2019-02-22vk_scheduler: Implement a schedulerReinUsesLisp2-0/+129
The scheduler abstracts command buffer and fence management with an interface that's able to do OpenGL-like operations on Vulkan command buffers. It returns by value a command buffer and fence that have to be used for subsequent operations until Flush or Finish is executed, after that the current execution context (the pair of command buffers and fences) gets invalidated a new one must be fetched. Thankfully validation layers will quickly detect if this is skipped throwing an error due to modifications to a sent command buffer.
2019-02-19vk_memory_manager: Implement memory managerReinUsesLisp2-0/+340
A memory manager object handles the memory allocations for a device. It allocates chunks of Vulkan memory objects and then suballocates.
2019-02-14vk_resource_manager: Implement a command buffer pool with VKFencedPoolReinUsesLisp2-1/+59
2019-02-14vk_resource_manager: Add VKFencedPool interfaceReinUsesLisp2-0/+83
Handles a pool of resources protected by fences. Manages resource overflow allocating more resources. This class is intended to be used through inheritance.
2019-02-14vk_resource_manager: Implement VKResourceManager and fence allocatorReinUsesLisp2-0/+85
CommitFence iterates a pool of fences until one is found. If all fences are being used at the same time, allocate more.
2019-02-14vk_resource_manager: Implement VKFenceWatchReinUsesLisp2-0/+68
A fence watch is used to keep track of the usage of a fence and protect a resource or set of resources without having to inherit from their handlers.
2019-02-14vk_resource_manager: Implement VKFenceReinUsesLisp2-0/+131
Fences take ownership of objects, protecting them from GPU-side or driver-side concurrent access. They must be commited from the resource manager. Their usage flow is: commit the fence from the resource manager, protect resources with it and use them, send the fence to an execution queue and Wait for it if needed and then call Release. Used resources will automatically be signaled when they are free to be reused.
2019-02-14vk_resource_manager: Add VKResource interfaceReinUsesLisp2-0/+40
VKResource is an interface that gets signaled by a fence when it is free to be reused.
2019-02-13vk_device: Abstract device handling into a classReinUsesLisp2-0/+347
VKDevice contains all the data required to manage and initialize a physical device. Its intention is to be passed across Vulkan objects to query device-specific data (for example the logical device and the dispatch loader).
2019-02-12renderer_vulkan: Add declarations fileReinUsesLisp1-0/+45
This file is intended to be included instead of vulkan/vulkan.hpp. It includes declarations of unique handlers using a dynamic dispatcher instead of a static one (which would require linking to a Vulkan library).