Commit Graph

1550 Commits

Author SHA1 Message Date
lynxnb
ee8c055641 Make GpuDriverInstallResult PascalCase 2022-11-23 19:49:42 +05:30
Billy Laws
7f1667de82 Avoid using trapping for frequently trapped shaders
Fall back to hashing for every shader access as that ends up being faster than applying traps for every execution.
2022-11-19 12:49:05 +00:00
Billy Laws
06095918a9 Introduce per-channel sequence number for invalidation tracking
For cases like shaders, which may be uploaded through I2M (which no longer causes an execution) we need a way to cause an invalidation on all writes
2022-11-19 12:49:05 +00:00
Billy Laws
97e3f7fd34 Increase max swapchain image count 2022-11-19 12:49:05 +00:00
Billy Laws
c49119f5ef Fixup depth bounds register arguments 2022-11-19 12:49:05 +00:00
Billy Laws
db3c5c33c4 Clamp depth bounds into 0-1 range 2022-11-19 12:49:05 +00:00
Billy Laws
e1bbd521d9 Fix potential circular queue submission race
If a producer thread was waiting for the queue to have free space and the consumer thread hadn't yet acquired the production mutex a deadlock could occur
2022-11-19 12:49:05 +00:00
Billy Laws
13baf2312f Add a workaround for sampling BGRA textures with a swizzle 2022-11-19 12:49:05 +00:00
Billy Laws
13a96c5aba Implement a helper shader for partial clears
These are not natively supported by Vulkan, so use a helper shader and colorWriteMask for the same behaviour.
2022-11-19 12:49:05 +00:00
Billy Laws
ac0e225114 Use vkCmdBlit for texture copies when formats dont match 2022-11-19 12:49:05 +00:00
Billy Laws
c8fc8f84ec Fallback to RGBA888 for unsupported swapchain formats as opposed to swizzle 2022-11-19 12:49:05 +00:00
Billy Laws
e0bc0d3a97 Avoid megabuffering buffers larger than the chunk size 2022-11-19 12:49:05 +00:00
Billy Laws
b6f49884b3 Use lower_bound to speedup texture hostMapping lookup 2022-11-19 12:49:05 +00:00
Billy Laws
e7fda28ac6 Skip over textures in cache which have been replaced with a layer/mip match 2022-11-19 12:49:05 +00:00
Billy Laws
88cc696c7f Only use 2D array depth targets when depth > 1 2022-11-19 12:49:05 +00:00
Billy Laws
7fed971b2d Take firstIndex into account when calculating index (quad) buffer size
Without this we would miss any elements beyond indexCount in the index buffer and they would be filled with random garbage causing vertex bombs
2022-11-19 12:49:05 +00:00
Billy Laws
1f9de17e98 Begin command buffers asynchronously in command executor
vkBeginCommandBuffer can take quite some time on adreno, move it to the cycle waiter thread where it won't block GPFIFO.
2022-11-19 12:49:05 +00:00
Billy Laws
4b3e906c22 Update cached buffer execution number when megabuffering 2022-11-19 12:49:05 +00:00
Billy Laws
3ae1e78544 Match mip layers and array layers in texture manager 2022-11-19 12:49:05 +00:00
Billy Laws
d502adb309 Avoid WRW hazard in subpass deps 2022-11-19 12:49:05 +00:00
Billy Laws
e9313cc291 Use view layer count over texture for attachments 2022-11-19 12:49:05 +00:00
Billy Laws
e65ca52d91 Avoid potential buffer copy race 2022-11-19 12:49:05 +00:00
Dima
720cfaafb6 Stub caps:su 2022-11-18 15:35:03 +00:00
Dima
74afca4aab Stub caps:u 2022-11-18 15:35:03 +00:00
Dima
27ff1ae19b Stub caps:c 2022-11-18 15:35:03 +00:00
Dima
ffb0546609 Stub caps:a 2022-11-18 15:35:03 +00:00
Dima
1c8736cb56 Stub IsLargeResourceAvailable 2022-11-18 12:52:25 +00:00
Dima
dcd9e4ff61 Stub SetIdleTimeDetectionExtension, SetAlbumImageTakenNotificationEnabled 2022-11-18 12:52:25 +00:00
Dima
60843269de Stub GetBlockedUserListIds and UpdateUserPresence 2022-11-18 12:52:25 +00:00
Dima
2cdfc7640c Stub GetPreviousProgramIndex 2022-11-18 12:52:25 +00:00
Dima
360306eb61 Stub GetAddOnContentListChangedEventWithProcessId 2022-11-18 12:52:25 +00:00
Dima
3d475ca122 Stub GetAccountId 2022-11-18 12:52:25 +00:00
Dima
0b452fe36b Stub GetFriendList 2022-11-18 12:52:25 +00:00
Dima
cc37d2231d Stub CheckFreeCommunicationPermission and IsFreeCommunicationAvailable 2022-11-18 12:52:25 +00:00
Dima
ec81c97fa9 Stub TryPopFromFriendInvitationStorageChannel 2022-11-18 12:52:25 +00:00
Dima
413f162cf2 Stub some account functions 2022-11-18 12:52:25 +00:00
lynxnb
b209ae8e90 Account for stick flat area when retrieving axes value from a MotionEvent 2022-11-17 21:54:15 +01:00
lynxnb
c966220bab Zero-initialize axes history instead of using null values
Use zero initialization for axes history instead of using null values. Fixes the first axis event after launching a game being completely ignored.
2022-11-17 21:54:15 +01:00
lynxnb
3a657c44cc Don't ignore HAT axes input events
Capture HAT axes events ourselves instead of relying on the android framework to turn them into KeyCodes. Fixes handling of DPAD button presses on most controllers.
2022-11-17 21:54:15 +01:00
lynxnb
f1ec771944 Fix inverted axis polarity
In the case of axis value being zero, polarity would favor one side of the stick resulting in invalid values. Fix that by taking into account axis history when calculating polarity.
2022-11-17 21:54:15 +01:00
lynxnb
675e8dbb2e Move input handling code to a dedicated class 2022-11-17 21:54:15 +01:00
lybxlpsv
18861d73a3 Set systemUiVisibility during onResume for A11 2022-11-17 14:04:57 +01:00
Dima
262ee28611 Stub some bsd functions
Co-authored-by: Lunar-Pixel <83507264+Lunar-Pixel@users.noreply.github.com>
2022-11-15 16:24:33 +00:00
Dima
9afa8b881e Stub nsd:u/nsd:a and sfdnsres services 2022-11-15 16:24:33 +00:00
Billy Laws
01e27bd2dd Implement ldr:ro LoadModule 2022-11-15 16:23:40 +00:00
Billy Laws
e571066409 Stub ldr:ro IRoInterface
Some games initialise this service on startup however don't actually use it. Add a simple stub to allow such games to boot.
2022-11-15 16:23:40 +00:00
Billy Laws
1fc2641746 Stub the web applet 2022-11-13 11:37:18 +00:00
Billy Laws
021f82ef08 Stub ListOpenContextStoredUsers 2022-11-13 11:35:40 +00:00
Billy Laws
e7bab27d85 Fixup nvdrv channel private memory allocation
This was incorrectly allocated in words, rather than bytes, meaning that guest allocations could overwrite the private memory and break inline syncpt operations
2022-11-13 11:35:40 +00:00
Billy Laws
8b523fa1f0 Avoid inline syncpt increments sending OOB GpEntries
In cases where no wfi is required, the space where the WFI commands would go needs to be zeroed out to avoid the GPU reading uninitialised memory.
2022-11-13 11:35:40 +00:00
Billy Laws
cd0b2636e5 Prevent truncation of big page start in GetVaRegions 2022-11-13 11:35:40 +00:00
Billy Laws
f650f32bf0 Avoid duplicating NvDrv buffer unmap code 2022-11-13 11:35:40 +00:00
Billy Laws
001064b7bf Fix GraphicsBufferProducer recreation
We need to use a shared_ptr to ensure that the present callback doesn't do any UAFs, also unlocks the GBP during presentation as if the queue is full a deadlock could a rise where the present callback wouldn't be able to run due to the (waiting) DequeueBuffer thread holding the lock.
2022-11-13 11:35:40 +00:00
Billy Laws
29e89a3950 Fix crashes when opening non-existent directories 2022-11-13 11:35:40 +00:00
Billy Laws
ec139b3027 Fixup CancelBuffer fence handling 2022-11-13 11:35:40 +00:00
Billy Laws
7f24c7b857 Store KMemory object ptrs in memory class to avoid linear-time unmap
This is quite a horrible solution but fixing it properly would require a whole rewrite of how we handle memory.
2022-11-13 11:35:15 +00:00
lynxnb
cc71e7b56c Run emulation in a separate process
Exiting from emulation has always been a big issue for Skyline, with guest and host threads that would keep running in the background unless the app was manually killed. Running emulation in a separate process allows us to kill it when we are done, avoiding the need for complex exiting management code.
2022-11-11 11:49:33 +00:00
lynxnb
281562ccdb Fix FABs ripple effect in OnScreenEditActivity 2022-11-09 23:07:23 +05:30
lynxnb
56f6f8a362 Reword the unsupported gpu drivers message
The old message was being misinterpreted as if the device's gpu was not supported by the emulator. Reword that message to explicitly mention custom drivers.
2022-11-09 23:07:23 +05:30
lynxnb
e2a5da1d67 Fix AppDialog layout
* Add a drag indicator at the top
* Fix flex layout wrapping when buttons didn't fit on a single line
* Fix BottomSheetDialog peek height too small on landscape orientation
* General cleanup of the layout
2022-11-09 23:07:23 +05:30
lynxnb
4146261069 Create a unified style for section titles 2022-11-09 23:07:23 +05:30
lynxnb
86364a84a2 Allow content to be drawn behind the navigation bar 2022-11-09 23:07:23 +05:30
lynxnb
6a6e89f070 Make BottomSheetDialog go fullscreen when fully expanded 2022-11-09 23:07:23 +05:30
lynxnb
f93d3b78d3 Add a drag indicator element at the top of LicenceDialog
A new `DragIndicatorView` had been introduced, which draws a small drag handle element. When used inside a `BottomSheetDialog`, this view will add a callback for hiding the indicator when the dialog is fully expanded.
2022-11-09 23:07:23 +05:30
lynxnb
6848e69638 Improve design consistency across the app
Game images, buttons and dialogs now have a consistent corner radius, across all game list layouts.
2022-11-09 23:07:23 +05:30
lynxnb
f63fdf26c9 Partially revert 'Make all Dialogs use @color/backgroundColor as the background color'
This partially reverts commit 36a1f2a2ec.
2022-11-09 23:07:23 +05:30
lynxnb
dec04db647 AppListItem misc tweaks
* Restore text marquee on all layouts
* Text size and color tweaks
* List layout image has round corners
* Clean up unneeded attributes
2022-11-09 23:07:23 +05:30
lynxnb
5c76a57e6e Use NestedScrollView for licence dialogs and minor layout tweaks 2022-11-09 23:07:23 +05:30
Billy Laws
388245789f Restructure ConditionalVariableSignal to avoid potential deadlock
Since InsertThread can block for paused threads, we need to ensure we unlock syncWaiterMutex when calling it.
2022-11-09 23:02:26 +05:30
PixelyIon
f4a8328cef Implement Symbol Hooking
Symbol hooking is required for HLE implementations of certain features in the future such as `nvdec` and for more in-depth debugging of games as we can inspect them on a SDK function level which allows us to debug issues far more easily.
2022-11-07 23:56:22 +05:30
PixelyIon
8892eb08e6 Fix MoveRegister to clear when value is 0
The register wouldn't be cleared with a `MOVZ` when a value was zero due to the condition for writing an instruction requiring the `offsetValue` to be non-zero.
2022-11-07 23:56:22 +05:30
Billy Laws
f7ab3abb86 Allow load balancing when waiting on condvars 2022-11-06 20:47:26 +00:00
german77
b6e2fb894c service: bcat: Stub CreateDeliveryCacheStorageService 2022-11-06 20:39:41 +00:00
Billy Laws
80b65d5094 Update XDR names 2022-11-03 22:53:01 +00:00
Billy Laws
026bb04386 Impl some more texture formats 2022-11-02 17:46:07 +00:00
Billy Laws
133f08ed14 Stash new register value before executing deferred draws/updates
Since the register writes technically happen after the draw, issues can occur if they happen before: e.g. skyrim updates ctSelect and disables all RTs after a draw, but this would happen before it previously and crash the driver.
2022-11-02 17:46:07 +00:00
Billy Laws
c50852e546 Implement the draw(...)BeginEnd Maxwell3D draw registers
Used by guest Vulkan games and nouveau.
2022-11-02 17:46:07 +00:00
Billy Laws
270ef3e0d2 Implement GPFIFO semaphore acquire operations 2022-11-02 17:46:07 +00:00
Billy Laws
2ce146e28f Don't crash on the Grp0SetSubDevMask TertOp
Used by Vulkan games to set the SLI mask, not applicable to the switch.
2022-11-02 17:46:07 +00:00
Billy Laws
1d83dadefb Drop size restruction bypass for frequently synced buffers
In cases where large buffers are updated every draw this could seriously increase memory usage beyond 3GB in the megabuffer.
2022-11-02 17:46:07 +00:00
Billy Laws
1088ed514c Introduce texture usage system to ensure RPs are split when necessary
Vulkan doesn't allow sampling a texture and using it as an RT in the same RP, by tracking the texture usage status and splitting RPs when this occurs we can avoid such potential sync errors.
2022-11-02 17:46:07 +00:00
Billy Laws
2dd4698441 Adjust texture matching hacks 2022-11-02 17:46:07 +00:00
Billy Laws
4f5c9047ef Add some additional texture formats used by Vulkan games 2022-11-02 17:46:07 +00:00
Billy Laws
6a830dfac5 Use shader-compiler side {S,U}Scaled format emulation 2022-11-02 17:46:07 +00:00
Billy Laws
579fd04117 Fixup ReadTextureType shader compiler callback 2022-11-02 17:46:07 +00:00
Billy Laws
b04d18eba5 Add support for split mappings to I2M uploads
Used by Super Mario Sunshine and other Vulkan games.
2022-11-02 17:46:07 +00:00
Billy Laws
db5e208379 Clear images even when aspects mismatch 2022-11-02 17:46:07 +00:00
Billy Laws
3c8df327f1 Fixup subpass barriers and flags 2022-11-02 17:46:07 +00:00
Billy Laws
5ab80901c6 Drop some debug code 2022-11-02 17:46:07 +00:00
Billy Laws
4de89c8839 GPU NEW MARGEBAC 2022-11-02 17:46:07 +00:00
Billy Laws
7670c83405 Ensure textures are clean before paging them out 2022-11-02 17:46:07 +00:00
Billy Laws
1a2351386d Add u64 iova ctor 2022-11-02 17:46:07 +00:00
Billy Laws
93d43e0115 Fully fill in swizzle component mappings
Avoids the rest being default initialised to identity, which would break the intended effect of them.
2022-11-02 17:46:07 +00:00
Billy Laws
37ff0ab814 Add buffer manager support for accelerated copies
These will be sequenced on the GPU/CPU depending on what's optimal and avoid any serialisation
2022-11-02 17:46:07 +00:00
Billy Laws
cac287d9fd Implement accelerated uploads/copies through buffer manager
Previously, both I2M uploads and DMA copies would force GPU serialisation if they happened to hit a trap or were used to copy GPU dirty buffers. By using the buffer manager to implement them on the host GPU we can avoid such slowdowns entiely.
2022-11-02 17:46:07 +00:00
Billy Laws
c5ec484d9a Avoid redundantly passing executor in ctors when it's already in ChannelCtx 2022-11-02 17:46:07 +00:00
Billy Laws
463394ba72 Pass correct size for XFB buffers 2022-11-02 17:46:07 +00:00
Billy Laws
bd976676f4 Fix SNorm vertex formats 2022-11-02 17:46:07 +00:00
Billy Laws
b74098570f Zero-out unused XFB varyings before passing to hades 2022-11-02 17:46:07 +00:00
Billy Laws
22f3ba6b93 Mark XFB buffers as GPU dirty 2022-11-02 17:46:07 +00:00