Commit Graph
100 Commits
Author SHA1 Message Date
gdkchanandGitHub bb8a920b63 Do not dirty memory tracking region handles if they are partially unmapped (#2536) 2021-08-11 21:50:33 +02:00
gdkchanandGitHub 0f6ec446ea Replace BGRA and scale uniforms with a uniform block (#2496)
* Replace BGRA and scale uniforms with a uniform block

* Setting the data again on program change is no longer needed

* Optimize and resolve some warnings

* Avoid redundant support buffer updates

* Some optimizations to BindBuffers (now inlined)

* Unify render scale arrays
2021-08-11 21:33:43 +02:00
gdkchanandGitHub d9d18439f6 Use a new approach for shader BRX targets (#2532)
* Use a new approach for shader BRX targets

* Make shader cache actually work

* Improve the shader pattern matching a bit

* Extend LDC search to predecessor blocks, catches more cases

* Nit

* Only save the amount of constant buffer data actually used. Avoids crashes on partially mapped buffers

* Ignore Rd on predicate instructions, as they do not have a Rd register (catches more cases)
2021-08-11 20:59:42 +02:00
gdkchanandGitHub ff5df5d8a1 Support non-contiguous copies on I2M and DMA engines (#2473)
* Support non-contiguous copies on I2M and DMA engines

* Vector copy should start aligned on I2M

* Nits

* Zero extend the offset
2021-08-04 22:20:58 +02:00
gdkchanandGitHub a27986c311 Make audio disposal thread safe on all 3 backends (#2527)
* Make audio disposal thread safe on all 3 backends

* Make OpenAL more consistent with the other backends

* Remove Window.Cursor = null, and change dummy TValue to byte
2021-08-04 15:28:33 -03:00
gdkchanandGitHub bb6fab2009 Ensure that DMA copy target textures are kept alive or flushed (#2478) 2021-07-14 14:48:57 -03:00
gdkchanandGitHub 96a070a9a7 Do not require texture and sampler pools being initialized (#2476) 2021-07-14 14:27:22 -03:00
gdkchanandGitHub 9d688e37d6 Close transfer memory properly on nvservices (#2477) 2021-07-14 14:09:00 -03:00
gdkchanandGitHub 04dce402ac Implement a fast path for I2M transfers (#2467) 2021-07-12 16:48:57 -03:00
gdkchanandGitHub 9b08abc644 Fix shader compilation on shaders that uses rectangle textures (#2471) 2021-07-12 16:20:33 -03:00
gdkchanandGitHub 40b21cc3c4 Separate GPU engines (part 2/2) (#2440)
* 3D engine now uses DeviceState too, plus new state modification tracking

* Remove old methods code

* Remove GpuState and friends

* Optimize DeviceState, force inline some functions

* This change was not supposed to go in

* Proper channel initialization

* Optimize state read/write methods even more

* Fix debug build

* Do not dirty state if the write is redundant

* The YControl register should dirty either the viewport or front face state too, to update the host origin

* Avoid redundant vertex buffer updates

* Move state and get rid of the Ryujinx.Graphics.Gpu.State namespace

* Comments and nits

* Fix rebase

* PR feedback

* Move changed = false to improve codegen

* PR feedback

* Carry RyuJIT a bit more
2021-07-11 17:20:40 -03:00
gdkchanandGitHub b5190f1681 Fix virtual memory allocation being out of range (#2464) 2021-07-11 16:24:31 -03:00
gdkchanandGitHub b1a9d17cf8 Fix GetWritableRegion write-back (#2456) 2021-07-10 21:50:10 +02:00
gdkchanandGitHub 59900d7f00 Unscale textureSize when resolution scaling is used (#2441)
* Unscale textureSize when resolution scaling is used

* Fix textureSize on compute

* Flag texture size as needing res scale values too
2021-07-09 00:09:07 -03:00
gdkchanandGitHub b02719cf41 Flush UBO updates more frequently (#2407) 2021-07-07 21:20:52 -03:00
gdkchanandGitHub 8b44eb1c98 Separate GPU engines and make state follow official docs (part 1/2) (#2422)
* Use DeviceState for compute and i2m

* Migrate 2D class, more comments

* Migrate DMA copy engine

* Remove now unused code

* Replace GpuState by GpuAccessorState on GpuAcessor, since compute no longer has a GpuState

* More comments

* Add logging (disabled)

* Add back i2m on 3D engine
2021-07-07 20:56:06 -03:00
gdkchanandGitHub d125fce3e8 Allow shader language and target API to be specified on the shader translator (#2402) 2021-07-06 21:20:06 +02:00
gdkchanandGitHub fbb4019ed5 Initial support for separate GPU address spaces (#2394)
* Make GPU memory manager a member of GPU channel

* Move physical memory instance to the memory manager, and the caches to the physical memory

* PR feedback
2021-06-29 19:32:02 +02:00
gdkchanandGitHub fefd4619a5 Add support for custom line widths (#2406) 2021-06-25 20:11:54 -03:00
gdkchanandGitHub 493648df31 Fix default value for unwritten shader outputs (#2412)
* Fix shader default output values

* Shader cache version bump
2021-06-25 19:56:03 -03:00
gdkchanandGitHub ed2f5ede0f Fix texture sampling with depth compare and LOD level or bias (#2404)
* Fix texture sampling with depth compare and LOD level or bias

* Shader cache version bump

* nit: Sorting
2021-06-25 00:54:50 +02:00
gdkchanandGitHub a10b2c5ff2 Initial support for GPU channels (#2372)
* Ground work for separate GPU channels

* Rename TextureManager to TextureCache

* Decouple texture bindings management from the texture cache

* Rename BufferManager to BufferCache

* Decouple buffer bindings management from the buffer cache

* More comments and proper disposal

* PR feedback

* Force host state update on channel switch

* Typo

* PR feedback

* Missing using
2021-06-24 01:51:41 +02:00
gdkchanandGitHub aea7a6631c Reduce number of dlls on distribution with single file publish (#2211)
* Enable single file publish

* Set DebugType to embedded on build scripts
2021-06-24 00:40:19 +02:00
gdkchanandGitHub c71ae9c85c Fix shader texture LOD query (#2397) 2021-06-23 23:31:14 +02:00
gdkchanandGitHub ab9d4b862d Implement VORN (register) Arm32 instruction (#2396) 2021-06-23 23:21:23 +02:00
gdkchanandGitHub 49edf14a3e Pass all inputs when geometry shader passthrough is enabled (#2362)
* Pass all inputs when geometry shader passthrough is enabled

* Shader cache version bump
2021-06-23 23:04:59 +02:00
gdkchanandGitHub 65fee49e8a Fix separate bindless sampler at offset 0 (#2360) 2021-06-20 20:48:12 +02:00
gdkchanandGitHub 02e2e561ac Support bindless textures with separate constant buffers for texture and sampler (#2339) 2021-06-09 00:42:25 +02:00
gdkchanandGitHub 3b90adcd1d Fix shaders with mixed PBK and SSY addresses on the stack (#2329)
* Fix shaders with mixed PBK and SSY addresses on the stack

* Address PR feedback and nits
2021-06-03 01:41:53 +02:00
gdkchanandGitHub b84ba43406 Fix texture blit off-by-one errors (#2335) 2021-06-03 01:30:48 +02:00
gdkchanandGitHub 79b3243f54 Do not attempt to normalize SNORM image buffers on shaders (#2317)
* Do not attempt to normalize SNORM image buffers on shaders

* Shader cache version bump
2021-05-31 21:59:23 +02:00
gdkchanandGitHub 91fdaea39b Fix guest stack trace inexistent function names (#2326) 2021-05-30 20:53:02 +02:00
gdkchanandGitHub f6fcef483f Fix inverted low/high mask value on GetThreadCoreMask32 syscall (#2325) 2021-05-30 20:44:59 +02:00
gdkchanandGitHub fb65f392d1 Improve accuracy of reciprocal step instructions (#2305)
* Improve accuracy of reciprocal step instructions

* Fix small mistake on RECPE rounding, nits, PTC version bump
2021-05-24 20:20:07 +10:00
gdkchanandGitHub 3fd6b55f04 Fix value of constant vertex attributes (#2307) 2021-05-24 17:38:38 +10:00
gdkchanandGitHub e9c15d32cb Use a different method for out of bounds blit (#2302)
* Use a different method for out of bounds blit

* This is not needed
2021-05-22 01:26:49 +02:00
gdkchanandGitHub a03bbef4d6 Add another Depth32F texture format (#2304) 2021-05-22 01:15:08 +02:00
gdkchanandGitHub f0add129e2 Fix non-independent blend state not being updated (#2303)
* Fix non-independent blend state not being updated

* Actually, this is not needed
2021-05-22 01:08:00 +02:00
gdkchanandGitHub 12533e5c9d Fix buffer and texture uses not being propagated for vertex A/B shaders (#2300)
* Fix buffer and texture uses not being propagated for vertex A/B shaders

* Shader cache version bump
2021-05-20 21:43:23 +02:00
gdkchanandGitHub b34c0a47b4 Fix constant buffer array size when indexing is used and other buffer descriptor and resolution scale regressions (#2298)
* Fix constant buffer array size when indexing is used

* Change default QueryConstantBufferUse value

* Fix more regressions

* Ensure proper order
2021-05-20 15:12:15 -03:00
gdkchanandGitHub 49745cfa37 Move shader resource descriptor creation out of the backend (#2290)
* Move shader resource descriptor creation out of the backend

* Remove now unused code, and other nits

* Shader cache version bump

* Nits

* Set format for bindless image load/store

* Fix buffer write flag
2021-05-19 23:15:26 +02:00
gdkchanandGitHub e318022b89 Fold constant offsets and group constant addresses (#2285)
* Fold constant offsets and group constant addresses

* PPTC version bump
2021-05-13 21:26:57 +02:00
gdkchanandGitHub a8022ca3a1 Fix race in SM initialization (#2280) 2021-05-12 00:57:21 +02:00
gdkchanandGitHub ebdbaa6db0 Fix a specific core migration bug on the scheduler (#2271) 2021-05-11 13:18:50 -03:00
gdkchanandGitHub 0e9823d7e6 Fix shader buffer write flag on atomic instructions (#2261)
* Fix shader buffer write flag on atomic instructions

* Shader cache version bump
2021-05-01 20:46:21 +02:00
gdkchanandGitHub 20d2347971 Fix GetClockSnapshot not writing steady clock timepoint (#2249) 2021-04-26 23:56:14 +02:00
gdkchanandGitHub 992133e9ca Fix IsRegionInUse check on NV memory allocator (#2243) 2021-04-25 02:13:58 +02:00
gdkchanandGitHub 4770cfa920 Only enable clip distance if written to on shader (#2217)
* Only enable clip distance if written to on shader

* Signal InstanceId use through FeatureFlags

* Shader cache version bump
2021-04-20 12:33:54 +02:00
gdkchanandGitHub 40e276c9b5 Improve shader global memory to storage pass (#2200)
* Improve shader global memory to storage pass

* Formatting and more comments

* Shader cache version bump
2021-04-18 12:31:39 +02:00
gdkchanandGitHub 001005b3d5 Fix sub-image copies on intel GPUs (#2198) 2021-04-13 03:09:42 +02:00
gdkchanandGitHub d43a56726c (CPU) Fix CRC32 instruction when constant values are used as input (#2183) 2021-04-07 23:43:08 +02:00
gdkchanandGitHub 874540bb5c Allow DRAM size to be increased from 4GB to 6GB (#2174)
* Allow DRAM size to be increased from 4GB to 6GB

* Add option on the UI
2021-04-04 14:06:59 +02:00
gdkchanandGitHub f665e1b409 Hold reference for render targets in use (#2156) 2021-04-02 16:33:39 +02:00
gdkchanandGitHub 524fe3bea4 Implement shader HelperThreadNV (#2163)
* Implement shader HelperThreadNV

* Bump shader cache version

* Use gl_HelperInvocation since its supported across all vendors

* Nit
2021-04-02 21:50:35 +11:00
gdkchanandGitHub a0b4799f19 Fix ZN flags set for shader instructions using RZ.CC dest (#2147)
* Fix ZN flags set for shader instructions using RZ.CC dest

* Shader cache version bump and nits
2021-03-27 22:59:05 +01:00
gdkchanandGitHub 5ab5b0e709 Close ILibraryAppletAccessor handles on disposal (#2094) 2021-03-10 21:36:38 +01:00
gdkchanandGitHub 9d82d27df2 Fix memory tracking performance regression (#2026)
* Fix memory tracking performance regression

* Set PTC version
2021-02-17 09:16:20 +11:00
715b605e95 Validate CPU virtual addresses on access (#1987)
* Enable PTE null checks again

* Do address validation on EmitPtPointerLoad, and make it branchless

* PTC version increment

* Mask of pointer tag for exclusive access

* Move mask to the correct place

Co-authored-by: LDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com>
2021-02-16 19:04:19 +01:00
gdkchanandGitHub c465d771dd Enable multithreaded VP9 decoding (#2009)
* Enable multithreaded VP9 decoding

* Limit the number of threads used for video decoding
2021-02-11 01:54:42 +01:00
gdkchanandGitHub 5ea7d77981 Fix inter-process data copy on non-contiguous physical regions (#1988) 2021-02-08 10:54:49 +11:00
gdkchanandGitHub 4047477866 Simplify handling of shader vertex A (#1999)
* Simplify handling of shader vertex A

* Theres no transformation feedback, its transform

* Merge TextureHandlesForCache
2021-02-08 10:42:17 +11:00
gdkchanandGitHub ee28ccebf4 Disable partial JIT invalidation on unmap (#1991) 2021-02-08 10:25:14 +11:00
gdkchanandGitHub 7016d95eb1 Implement ETC2 (RGB) texture format (#2000)
* Implement ETC2 format

* Fix component counts for compressed formats
2021-02-08 10:23:56 +11:00
gdkchanandGitHub 67033ed8e0 Do not flush multisample textures (#1973) 2021-02-01 08:30:16 +01:00
gdkchanandGitHub 053dcfdb05 Use multiple dest operands for shader call instructions (#1975)
* Use multiple dest operands for shader call instructions

* Passing opNode is no longer needed
2021-02-01 11:13:38 +11:00
gdkchanandGitHub f93089a64f Implement geometry shader passthrough (#1961)
* Implement geometry shader passthrough

* Cache version change
2021-01-29 14:38:51 +11:00
gdkchanandGitHub 4b7c7dab9e Support multiple destination operands on shader IR and shuffle predicates (#1964)
* Support multiple destination operands on shader IR and shuffle predicates

* Cache version change
2021-01-28 10:59:47 +11:00
gdkchanandGitHub dcce407071 Lower precision of estimate instruction results to match Arm behavior (#1943)
* Lower precision of estimate instruction results to match Arm behavior

* PTC version update

* Nits
2021-01-28 10:23:00 +11:00
gdkchanandGitHub 98d0240ce6 Support shader F32 to Bool reinterpretation (#1969) 2021-01-27 09:19:30 +01:00
gdkchanandGitHub a8e9dd2f83 Fix regression on shader atomic SSBO operations (#1967)
* Fix regression on shader atomic SSBO operations

* Update comment
2021-01-27 11:26:23 +11:00
gdkchanandGitHub caf049ed15 Avoid some redundant GL calls (#1958) 2021-01-27 08:44:07 +11:00
gdkchanandGitHub d6bd0470fb Fix conditional rendering without queries (#1965) 2021-01-27 08:42:12 +11:00
gdkchanandGitHub 9551bfdeeb Fix compute shader code dumping (#1960) 2021-01-26 18:27:18 +01:00
gdkchanandGitHub e453ba69f4 Add support for shader atomic min/max (S32) (#1948) 2021-01-26 17:38:33 +11:00
gdkchanandGitHub f94acdb4ef Allow out of bounds storage buffer access by aligning their sizes (#1870)
* Allow out of bounds storage buffer access by aligning their sizes

* Use correct size

* Fix typo and comment on the reason for the change
2021-01-25 09:22:19 +11:00
gdkchanandGitHub f565b0e5a6 Match texture if the physical range is the same (#1934)
* Match texture if the physical range is the same

* XML docs and comments
2021-01-23 13:38:00 +01:00
gdkchanandGitHub 6a95a3b01a Fix alignment on CreateTransferMemoryStorage (#1937) 2021-01-19 21:48:27 -03:00
gdkchanandGitHub b8353f5639 Enable parallel ASTC decoding by default (#1930) 2021-01-19 14:19:52 +11:00
gdkchanandGitHub 03aab63e03 Fix out of range exception when a invalid base lod is used (#1931) 2021-01-19 14:04:38 +11:00
gdkchanandGitHub 734747ae58 Reduce temporary copy/fill buffer size (#1926) 2021-01-19 13:31:15 +11:00
gdkchanandGitHub c4f56c5704 Support for resources on non-contiguous GPU memory regions (#1905)
* Support for resources on non-contiguous GPU memory regions

* Implement MultiRange physical addresses, only used with a single range for now

* Actually use non-contiguous ranges

* GetPhysicalRegions fixes

* Documentation and remove Address property from TextureInfo

* Finish implementing GetWritableRegion

* Fix typo
2021-01-17 19:44:34 +01:00
gdkchanandGitHub 3bad321d2b Fix mipmap base level being ignored for sampled textures and images (#1911)
* Fix mipmap base level being ignored for sampled textures and images

* Fix layer size and max level for textures

* Missing XML doc + reorder comments
2021-01-15 19:14:00 +01:00
gdkchanandGitHub 5be6ec6364 Fix shader LOP3 predicate write condition (#1910)
* Fix LOP3 predicate write condition

* Bump shader cache version
2021-01-14 01:07:50 +01:00
gdkchanandGitHub 36c6e67df2 Implement shader CC mode for ISCADD, X mode for ISETP and fix STL/STS/STG with RZ (#1901)
* Implement shader CC mode for ISCADD, X mode for ISETP and fix STS/STG with RZ

* Fix STG too and bump shader cache version

* Fix wrong name

* Fix Carry being inverted on comparison
2021-01-13 08:52:13 +11:00
gdkchanandGitHub df820a72de Implement clear buffer (fast path) (#1902)
* Implement clear buffer (fast path)

* Remove blank line
2021-01-13 08:50:54 +11:00
gdkchanandGitHub 6ed19c1488 Fix compute reserved constant buffer updates (#1892) 2021-01-10 21:02:58 +01:00
gdkchanandGitHub 8e0a421264 Fix remap when handle is 0 (#1882)
* Nvservices cleanup and attempt to fix remap

* Unmap if remap handle is 0

* Remove mapped pool add from Remap
2021-01-10 10:11:31 +11:00
gdkchanandGitHub b9200dd734 Support conditional on BRK and SYNC shader instructions (#1878)
* Support conditional on BRK and SYNC shader instructions

* Add TODO comment and bump cache version
2021-01-08 22:55:55 -03:00
gdkchanandGitHub 532b8cad13 Update KAddressArbiter implementation to 11.x kernel (#1851)
* Update KAddressArbiter implementation to 11.x kernel

* InsertSortedByPriority is no longer needed
2021-01-01 14:59:26 -03:00
gdkchanandGitHub f5d64b4d68 Terminate application before services (#1812)
* Terminate application before services

* Use flags instead of title ID
2020-12-17 01:44:06 +01:00
61634dd415 Clear JIT cache on exit (#1518)
* Initial cache memory allocator implementation

* Get rid of CallFlag

* Perform cache cleanup on exit

* Basic cache invalidation

* Thats not how conditionals works in C# it seems

* Set PTC version to PR number

* Address PR feedback

* Update InstEmitFlowHelper.cs

* Flag clear on address is no longer needed

* Do not include exit block in function size calculation

* Dispose jump table

* For future use

* InternalVersion = 1519 (force retest).

Co-authored-by: LDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com>
2020-12-16 17:07:42 -03:00
gdkchanandGitHub 47ba81c661 Fix pre-allocator shift instruction copy on a specific case (#1752)
* Fix pre-allocator shift instruction copy on a specific case

* Fix to make shift use int rather than long for constants
2020-12-14 17:56:07 -03:00
gdkchanandGitHub c8bb3cc50e Fix register read after write on STREX implementation (#1801)
* Fix register read after write on STREX implementation

* PTC version update
2020-12-13 12:19:38 -03:00
gdkchanandGitHub 19d18662ea Correct type of executable sizes (#1802) 2020-12-13 08:30:27 +01:00
gdkchanandGitHub ef157bbe26 Remove inexistent buffer from GetNintendoAccountUserResourceCacheForApplication (#1809) 2020-12-12 22:10:12 +11:00
gdkchanandGitHub 74aa7b20be Rewrite size for fixed size buffers (#1808) 2020-12-12 14:06:20 +11:00
gdkchanandGitHub 48278905d1 Rewrite scheduler context switch code (#1786)
* Rewrite scheduler context switch code

* Fix race in UnmapIpcRestorePermission

* Fix thread exit issue that could leave the scheduler in a invalid state

* Change context switch method to not wait on guest thread, remove spin wait, use SignalAndWait to pass control

* Remove multi-core setting (it is always on now)

* Re-enable assert

* Remove multicore from default config and schema

* Fix race in KTimeManager
2020-12-09 19:20:05 -03:00
gdkchanandGitHub 1b053d2222 Close audio WorkBuffer transfer memory handle (#1770) 2020-12-02 21:58:20 +01:00
gdkchanandGitHub f7617cae12 Create a single guest process per IPC message processor (#1769) 2020-12-02 13:14:44 +01:00
cf6cd71488 IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458)
* IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel

* Fix for applet transfer memory + some nits

* Keep handles if possible to avoid server handle table exhaustion

* Fix IPC ZeroFill bug

* am: Correctly implement CreateManagedDisplayLayer and implement CreateManagedDisplaySeparableLayer

CreateManagedDisplaySeparableLayer is requires since 10.x+ when appletResourceUserId != 0

* Make it exit properly

* Make ServiceNotImplementedException show the full message again

* Allow yielding execution to avoid starving other threads

* Only wait if active

* Merge IVirtualMemoryManager and IAddressSpaceManager

* Fix Ro loading data from the wrong process

Co-authored-by: Thog <me@thog.eu>
2020-12-02 00:23:43 +01:00