Commit graph

135 commits

Author SHA1 Message Date
gdkchan a694420d11
Implement speculative translation on the CPU (#515)
* Implement speculative translation on the cpu, and change the way how branches to unknown or untranslated addresses works

* Port t0opt changes and other cleanups

* Change namespace from translation related classes to ChocolArm64.Translation, other minor tweaks

* Fix typo

* Translate higher quality code for indirect jumps aswell, and on some cases that were missed when lower quality (tier 0) code was available

* Remove debug print

* Remove direct argument passing optimization, and enable tail calls for BR instructions

* Call delegates directly with Callvirt rather than calling Execute, do not emit calls for tier 0 code

* Remove unused property

* Rename argument on ArmSubroutine delegate
2019-02-04 18:26:05 -03:00
BaronKiko f5b4f6ccc4 Scissor test fix (#563)
* Handle negative viewport coordinates

* Disable scissor before framebuffer blit

* Comment to explain scissor disable will be reenabled if needed

* Comma and spelling mistake
2019-01-31 22:37:07 -03:00
gdkchan e10ff17e2d
Initial support for shader half float instructions (#507) 2019-01-31 09:43:24 -03:00
BaronKiko 3731d0ce84 SNK 40th Anniversary Out of Bounds Fix (#557)
* Check vertex array is enabled before reading constant attribute to avoid out of bounds exception

* Removed new line
2019-01-18 16:31:25 -02:00
BaronKiko 0cd5ba03fe Scissor test implementation. Partially stubbed until geometry shaders… (#556)
* Scissor test implementation. Partially stubbed until geometry shaders are fixed

* Apply to all viewports when geometry shaders are disabled.

* Also apply enable cap to all viewports when geometry shaders are disabled

* Added fixme as per suggestion

Co-Authored-By: BaronKiko <BaronKiko@users.noreply.github.com>

* Apparently no alignment needed here.

* Comment on new line

* Correct height calculation
2019-01-13 23:26:42 +02:00
Thomas Guillemard b4d91402c6 Some improvements for nvnflinger (#555)
* Initial fixes for last release of libnx

For now, the framebuffer aren't okay but it will not crash/

* Improve code reaadability in NvFlinger parsing

* Make surfaces access more userfriendly

* Add ColorFormat

* Fix code style in ColorFormat.cs

* Add multiple framebuffer support in nvnflinger

This fix libnx console rendering

* Move ReadStruct/WriteStruct to Ryujinx.Common

* fix the last nit

* Fix inverted color for R5G6B5

Also add some other format that libnx might uses.

* Remove hardcoded BlockHeight in nvflinger
2019-01-05 22:26:16 +01:00
BaronKiko cf147f1e49 Quad to triangle optimization (#552)
* Fix minor bug with ordering leading to incorrect ordering

* Converts quads and quadstrips to triangle

* A new line for emmaus

* Refactor to remove Ib from quadhelper methods

* 20 extra brackets...
2019-01-01 15:08:15 -02:00
HorrorTroll 5d14040e66 Add RG16 Sint (#517) 2018-12-27 13:05:54 +02:00
gdkchan 1fd1ec5664
Do not attempt to read unused attribute, fix attributes count (#520) 2018-12-26 17:29:50 -02:00
Thomas Guillemard 33e7c89822 Move MaxUboSize definition (#530)
* Move MaxUboSize definition

This fix a crash on Ryujinx.ShaderTools caused by the absence of an
OpenGL context.

* Use a constant for the value in ShaderTools

* Address comments
2018-12-17 22:32:12 -02:00
Roderick Sieben 2e143365eb Optimized memory modified check (#538)
* Optimized memory modified check

This was initially in some cases more expensive than plainly sending the data. Now it should have way better performance.

* Small refactoring

* renamed InvalidAccessEventArgs
* Renamed PtPageBits

* Removed ValueRange(set)

They are currently unused and won't be likely to be used in the near future
2018-12-11 23:48:54 -02:00
gdkchan c86aacde76
NVDEC implementation using FFmpeg (#443)
* Initial nvdec implementation using FFmpeg

* Fix swapped channels on the video decoder and the G8R8 texture format

* Fix texture samplers not being set properly (regression)

* Rebased

* Remove unused code introduced on the rebase

* Add support for RGBA8 output format on the video image composer

* Correct spacing

* Some fixes for rebase and other tweaks

* Allow size mismatch on frame copy

* Get rid of GetHostAddress calls on VDec
2018-12-03 00:38:47 -02:00
gdkchan 59964f667c
Add support for bigger UBOs, fix sRGB regression, small improvement t… (#503)
* Add support for bigger UBOs, fix sRGB regression, small improvement to the 2D copy engine

* Break into multiple lines

* Read fractions for source/step values on the 2d copy engine aswell

* Use fixed point math for more speed

* Fix reinterpret when texture sizes are different
2018-11-28 21:09:44 -02:00
gdkchan 00579927e4
Better process implementation (#491)
* Initial implementation of KProcess

* Some improvements to the memory manager, implement back guest stack trace printing

* Better GetInfo implementation, improve checking in some places with information from process capabilities

* Allow the cpu to read/write from the correct memory locations for accesses crossing a page boundary

* Change long -> ulong for address/size on memory related methods to avoid unnecessary casts

* Attempt at implementing ldr:ro with new KProcess

* Allow BSS with size 0 on ldr:ro

* Add checking for memory block slab heap usage, return errors if full, exit gracefully

* Use KMemoryBlockSize const from KMemoryManager

* Allow all methods to read from non-contiguous locations

* Fix for TransactParcelAuto

* Address PR feedback, additionally fix some small issues related to the KIP loader and implement SVCs GetProcessId, GetProcessList, GetSystemInfo, CreatePort and ManageNamedPort

* Fix wrong check for source pages count from page list on MapPhysicalMemory

* Fix some issues with UnloadNro on ldr:ro
2018-11-28 20:18:09 -02:00
HorrorTroll e7fe7d7247 Add RGBA16 Unorm (#513) 2018-11-23 12:21:45 -02:00
jduncanator 76e2d48eee GPU: Allow depth textures to be loaded (#511)
Allow depth textures to be loaded when their component types do not match.
2018-11-21 04:27:33 -02:00
HorrorTroll 0f5efe050f Add BGRA8 Srgb (#505) 2018-11-19 02:07:09 -02:00
gdkchan b7613dd4b8 Enable SRGB framebuffers by default (#502) 2018-11-17 05:10:51 +01:00
gdkchan d2bb458b51 Improved GPU command lists decoding (#499)
* Better implementation of the DMA pusher, misc fixes

* Remove some debug code

* Correct RGBX8 format

* Add support for linked Texture Sampler Control

* Attempt to fix upside down screen issue
2018-11-17 05:01:31 +01:00
gdkchan 85ffd76016 Force cache to remove entries when memory usage exceeds a given threshold (#492) 2018-11-14 23:22:02 +01:00
gdkchan 453543fb88 Initialize blend registers with default values (#497) 2018-11-14 22:50:31 +01:00
Ac_K 437962a65d Add BGR5A1 Image Format (#495)
* Add `BGR5A1` to ImageUtils.cs

Add `BGR5A1` Image Format.

* Add BGR5A1 to OGLEnumConverter.cs
2018-11-11 02:27:06 -02:00
Ac_K fdd5767887 Update ImageUtils.cs (#494)
Fix `GalImageFormat.D32S8` definition.
2018-11-09 16:41:40 -02:00
gdkchan 44c1cf3fe5
Implment common and independent blend properly (fixes #458) (#485)
* Implment common and independent blend properly

* Nits
2018-11-01 01:22:24 -03:00
Alex Barney 9cb57fb4bb Adjust naming conventions for Ryujinx and ChocolArm64 projects (#484)
* Change naming convention for Ryujinx project

* Change naming convention for ChocolArm64 project

* Fix NaN

* Remove unneeded this. from Ryujinx project

* Adjust naming from new PRs

* Name changes based on feedback

* How did this get removed?

* Rebasing fix

* Change FP enum case

* Remove prefix from ChocolArm64 classes - Part 1

* Remove prefix from ChocolArm64 classes - Part 2

* Fix alignment from last commit's renaming

* Rename namespaces

* Rename stragglers

* Fix alignment

* Rename OpCode class

* Missed a few

* Adjust alignment
2018-10-30 22:43:02 -03:00
gdkchan 5a87e58183 Fix regression caused by wrong time delta calculation on cache deletion methods 2018-10-30 11:42:27 -03:00
jduncanator c1b7340023 Timing: Optimize Timestamp Aquisition (#479)
* Timing: Optimize Timestamp Aquisition

Currently, we make use of Environment.TickCount in a number of places. This has some downsides, mainly being that the TickCount is a signed 32-bit integer, and has an effective limit of ~25 days before overflowing and wrapping around. Due to the signed-ness of the value, this also caused issues with negative numbers. This resolves these issues by using a 64-bit tick count obtained from Performance Counters (via the Stopwatch class). This has a beneficial side effect of being significantly more accurate than the TickCount.

* Timing: Rename ElapsedTicks to ElapsedMilliseconds and expose TicksPerX

* Timing: Some style changes

* Timing: Align static variable initialization
2018-10-28 19:31:13 -03:00
gdkchan 111d14f74a Crop instead of resizing on 2d engine texture copies (#482)
* Crop instead of resizing on 2d engine texture copies

* Remove unused local
2018-10-27 18:46:17 +00:00
gdkchan f0a49a1c94
Fix Color Mask values (#473)
* Fix color mask common, set default value on first color mask register

* Missing check

* Better exception messages

* Address PR feedback

* Add fixme as per review feedback
2018-10-25 18:30:09 -03:00
gdkchan 9ace6b9285
Fix for render target and a shader compilation issue (#471)
* Fix render target using possibly deleted or wrong handles

* Fix basic blocks with only a KIL instruction on the shader translator

* Formatting fix
2018-10-23 17:59:52 -03:00
gdkchan 044b84b078
Add depth range support on the GPU (#472)
* Add depth range support on the GPU

* Address PR feedback
2018-10-23 16:04:08 -03:00
gdkchan 0e1e094b7a
Improve texture tables (#457)
* Improve texture tables

* More renaming and other tweaks

* Minor tweaks
2018-10-17 18:02:23 -03:00
ReinUsesLisp b3a4662be1 Move logging to Ryujinx.Common and make it a static class (#413) 2018-10-17 14:15:50 -03:00
HorrorTroll 76330b10b4 Add G8R8Unorm, G8R8Snorm, B8G8R8A8, D24_S8 Uint, R8Uint, R32Uint (#426)
* Implement B5G6R5Unorm & BGR5A1Unorm

* Fix R8G8 Unorm to G8R8 Unorm

* Added back R8G8 Unorm

* Fix G8R8Unorm, add R8G8B8A8

* Add D24_S8 Uint

* Add R8Uint & R32Uint

* Another fixed

* Reverting back

* R8G8B8A8 change to B8G8R8A8

* Add G8R8 Snorm
2018-10-14 18:23:23 -03:00
HorrorTroll b0cfe2fb1f Add RG16Unorm & R16Uint (#456)
* Implement B5G6R5Unorm & BGR5A1Unorm

* Add RG16Unorm, R16Uint
2018-10-14 18:20:10 -03:00
gdkchan 72317d7777
Add support for saturation on some shader instructions, fix ReadTexture alignment and add ColorMask support (#451)
* Add support for saturation on some shader instructions, fix ReadTexture alignment

* Add ColorMask support, other tweaks
2018-10-13 23:54:14 -03:00
gdkchan aa1cd849cf Quads, QuadStrip, const attributes and half-float attributes support (#447)
* Quads, QuadStrip and const attributes support

* Add support for half float attributes and fix texture pitch alignment

* Throw when an unsupported float type is used as const attribute aswell
2018-10-13 01:37:01 +00:00
ReinUsesLisp 2562ca6c3f Fix multiple rendertargets (#427)
* Simplify render target bindings

* Implement multiple viewports

* Pack glViewportIndexed calls into a single glViewportArray

* Use ARB_viewport_array when available

* Cache framebuffer attachments

* Use get accessors in OGLExtension

* Address feedback
2018-09-26 00:55:30 +02:00
ReinUsesLisp 47a62e826f Implement DepthWriteMask and add R16G16 (#425) 2018-09-19 22:02:11 -03:00
ReinUsesLisp bed13f2022 General improvements for GpuResourceManager (#421)
* General improvements to GpuResourceManager

* Address feedback

* Address feedback
2018-09-19 18:26:49 -03:00
ReinUsesLisp e04221b293 Fixup SSY (#424) 2018-09-19 17:11:05 -03:00
gdkchan 33e2810ef3
Fix d32s8 format on OGLEnumConverter (#420) 2018-09-18 13:27:12 -03:00
gdkchan d4187aaa9d
Allow "reinterpretation" of framebuffer/zeta formats (#418)
* (Re)Implement format reinterpretation, other changes

* Implement writeback to guest memory, some refactoring

* More refactoring, implement reinterpretation the old way again

* Clean up

* Some fixes on M2MF (old Dma engine), added partial support for P2MF, fix conditional ssy, add Z24S8 zeta format, other fixes

* nit: Formatting

* Address PR feedback
2018-09-18 01:30:35 -03:00
HorrorTroll 8a78a703f2 Implement B5G6R5Unorm, BGR5A1Unorm, RGBA32Uint, R16Unorm and Z16 texture format. Fix BC6H_UF16 from Unorm to Sfloat (#417)
* Implement B5G6R5Unorm & BGR5A1Unorm

* Implement RGBA32Uint

* Implement R16Unorm & Z16 texture format

* Fix BC6H_UF16 from Unorm to Sfloat
2018-09-17 02:24:55 +02:00
ReinUsesLisp e5917f8968 Fixup image error message and add G8R8 to size query (#410) 2018-09-11 12:48:13 -03:00
ReinUsesLisp ce1d5be212 Move GPU emulation from Ryujinx.HLE to Ryujinx.Graphics and misc changes (#402)
* Move GPU LLE emulation from HLE to Graphics

* Graphics: Move Gal/Texture to Texture

* Remove Engines/ directory and namespace

* Use tables for image formats

* Abstract OpCode decoding

* Simplify image table

* Do not leak Read* symbols in TextureReader

* Fixups

* Rename IGalFrameBuffer -> IGalRenderTarget

* Remove MaxBpp hardcoded value

* Change yet again texture data and add G8R8 flipping

* Rename GalFrameBufferFormat to GalSurfaceFormat

* Unident EnsureSetup in ImageHandler

* Add IsCompressed

* Address some feedback
2018-09-08 14:51:50 -03:00
gdkchan b549daed03
Fix exception throw message for unimpl texture formats (#398) 2018-09-01 18:51:51 -03:00
ReinUsesLisp e72fd3f7a7 Shaders: Handle Ipa PASS argument as needed in Fragment Shaders (#392) 2018-09-01 18:44:19 -03:00
HorrorTroll bf28d8f1aa Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format (#377)
* Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format

* Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format

* Revert "Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format"

This reverts commit aea5c9db3a.

* Conflicts fix

* Wrong fix

* E

* e
2018-09-01 18:25:49 -03:00
ReinUsesLisp 42dc925c3d Implement SSY/SYNC shader instructions (#382)
* Use a program counter to control shaders' flow

* Cleanup

* Implement SSY/SYNC

* Address feedback

* Fixup commentary

* Fixup Ssy instruction
2018-08-31 13:14:04 -03:00