Commit graph

78 commits

Author SHA1 Message Date
riperiperi
90605c9a15 Implement Zero-Configuration Resolution Scaling (#1365)
* Initial implementation of Render Target Scaling

Works with most games I have. No GUI option right now, it is hardcoded.

Missing handling for texelFetch operation.

* Realtime Configuration, refactoring.

* texelFetch scaling on fragment shader (WIP)

* Improve Shader-Side changes.

* Fix potential crash when no color/depth bound

* Workaround random uses of textures in compute.

This was blacklisting textures in a few games despite causing no bugs. Will eventually add full support so this doesn't break anything.

* Fix scales oscillating when changing between non-native scales.

* Scaled textures on compute, cleanup, lazier uniform update.

* Cleanup.

* Fix stupidity

* Address Thog Feedback.

* Cover most of GDK's feedback (two comments remain)

* Fix bad rename

* Move IsDepthStencil to FormatExtensions, add docs.

* Fix default config, square texture detection.

* Three final fixes:

- Nearest copy when texture is integer format.
- Texture2D -> Texture3D copy correctly blacklists the texture before trying an unscaled copy (caused driver error)
- Discount small textures.

* Remove scale threshold.

Not needed right now - we'll see if we run into problems.

* All CPU modification blacklists scale.

* Fix comment.
2020-07-07 04:41:07 +02:00
gdkchan
435ab6a552 Refactor shader GPU state and memory access (#1203)
* Refactor shader GPU state and memory access

* Fix NVDEC project build

* Address PR feedback and add missing XML comments
2020-05-06 11:02:28 +10:00
gdkchan
28c45cfc71 Implement a new physical memory manager and replace DeviceMemory (#856)
* Implement a new physical memory manager and replace DeviceMemory

* Proper generic constraints

* Fix debug build

* Add memory tests

* New CPU memory manager and general code cleanup

* Remove host memory management from CPU project, use Ryujinx.Memory instead

* Fix tests

* Document exceptions on MemoryBlock

* Fix leak on unix memory allocation

* Proper disposal of some objects on tests

* Fix JitCache not being set as initialized

* GetRef without checks for 8-bits and 16-bits CAS

* Add MemoryBlock destructor

* Throw in separate method to improve codegen

* Address PR feedback

* QueryModified improvements

* Fix memory write tracking not marking all pages as modified in some cases

* Simplify MarkRegionAsModified

* Remove XML doc for ghost param

* Add back optimization to avoid useless buffer updates

* Add Ryujinx.Cpu project, move MemoryManager there and remove MemoryBlockWrapper

* Some nits

* Do not perform address translation when size is 0

* Address PR feedback and format NativeInterface class

* Remove ghost parameter description

* Update Ryujinx.Cpu to .NET Core 3.1

* Address PR feedback

* Fix build

* Return a well defined value for GetPhysicalAddress with invalid VA, and do not return unmapped ranges as modified

* Typo
2020-05-04 08:54:50 +10:00
gdkchan
7c3d540700 Fix texture level offset/size calculation when sparse tile width is > 1 (#1142)
* Fix texture level offset/size calculation when sparse tile width is > 1

* Sparse tile width affects layer size alignment aswell
2020-04-25 23:40:20 +10:00
gdkchan
a21f7a7dc2 Implement texture buffers (#1152)
* Implement texture buffers

* Throw NotSupportedException where appropriate
2020-04-25 23:02:18 +10:00
gdkchan
07a00e4d88 Support partial invalidation on texture access (#1000)
* Support partial invalidation on texture access

* Fix typo

* PR feedback

* Fix modified size clamping
2020-03-20 14:17:11 +11:00
riperiperi
878dfe4cda Only enumerate cached textures that are modified when flushing. (#918)
* Only enumarate cached textures that are modified when flushing, rather than all of them.

* Remove locking.

* Add missing clear.

* Remove texture from modified list when data is disposed.

In case the game does not call either flush method at any point.

* Add ReferenceEqualityComparer from jD for the HashSet
2020-02-07 08:49:26 +11:00
gdkchan
13aea6d726 Add a GetSpan method to the memory manager and use it on GPU (#877) 2020-01-13 10:27:50 +11:00
gdkchan
30a909265a Fix some spelling mistakes
Thanks to LDj3SNuD for spotting these
2020-01-09 02:13:00 +01:00
gdkchan
bc38064351 Address PR feedback 2020-01-09 02:13:00 +01:00
gdkchan
987e78245e More code cleanup 2020-01-09 02:13:00 +01:00
gdkchan
d7fb450216 GPU resource disposal 2020-01-09 02:13:00 +01:00
gdkchan
f5ce09c126 Change GPU errors to debug and reduce log messages 2020-01-09 02:13:00 +01:00
gdkchan
7cad07ecba Fix typos pointed out by LDj3SNuD 2020-01-09 02:13:00 +01:00
gdkchan
b73695ce3e Add XML documentation to Ryujinx.Graphics.Gpu.Image 2020-01-09 02:13:00 +01:00
gdkchan
d42edddefd Some code cleanup 2020-01-09 02:13:00 +01:00
gdkchan
155c2ee2fe Add basic error logging to the GPU 2020-01-09 02:13:00 +01:00
Alex Barney
7c4256a713 ASTC optimizations (#845)
* ASTC optimizations

* Move code to Ryujinx.Common

* Support 3D textures

* Address feedback

* Remove ASTC logging

* Use stackalloc instead of a Buffer20 struct

* Code style and cleanup

* Respond to feedback

* Rearrange public/private property ordering
2020-01-09 02:13:00 +01:00
gdkchan
8e777be7b4 Initialize GPU physical memory accessor from KProcess, to allow homebrew that never maps anything on the GPU to work 2020-01-09 02:13:00 +01:00
gdkchan
6df062b81a Support 3D ASTC textures (using 2D blocks) 2020-01-09 02:13:00 +01:00
gdkchan
5c2f6cc0b7 Initial support for the guest OpenGL driver (NVIDIA and Nouveau) 2020-01-09 02:13:00 +01:00
gdk
8c26739c58 Improved and simplified window texture presentation 2020-01-09 02:13:00 +01:00
gdk
2a487b2afe Do not throw for invalid ASTC compressed textures 2020-01-09 02:13:00 +01:00
gdk
5fb601a2fe Support copy of slices to 3D textures, remove old 3D render target layered render support, do not delete textures with existing views created from them 2020-01-09 02:13:00 +01:00
gdk
ce10d3c6ff Add shader support for the round mode on the F2F instruction, support mipmaps on ASTC compressed textures 2020-01-09 02:13:00 +01:00
gdk
0c7c38df0f Add per-source type memory change tracking, simplified state change tracking, other fixes 2020-01-09 02:13:00 +01:00
gdk
c9abf08686 Initial support for image stores, support texture sample on compute 2020-01-09 02:13:00 +01:00
gdk
fb2200c09b Initial work 2020-01-09 02:13:00 +01:00