Commit graph

114 commits

Author SHA1 Message Date
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
ReinUsesLisp
7cb6fd8090 Fixup HasColor for depth/stencil values (#379) 2018-08-30 13:14:45 -03:00
HorrorTroll
27023e7afc Add R32_G32 texture format (#383) 2018-08-27 11:18:21 -03:00
ReinUsesLisp
43c4e7c78d Use mirrored texture wraps when available (#361) 2018-08-25 16:39:08 -03:00
ReinUsesLisp
a42ab2e40c Implement vertex instancing (#381) 2018-08-25 01:16:58 -03:00
ReinUsesLisp
624e813cd3 Implement multiple rendertarget attachments and depth writting (#375)
* Add depth writting

* Implement multiple attachments

* Address feedback
2018-08-23 02:07:23 -03:00
ReinUsesLisp
1cd7aaf504 Avoid querying and setting texture bindings in hot code (#376) 2018-08-23 01:54:32 -03:00
ReinUsesLisp
afc44850be Avoid gpr overwritting on Ld_C instruction (#371)
* Avoid gpr overwritting on LD_C instruction

* Address feedback

* Ignore invalid registers
2018-08-20 23:31:10 -03:00
ReinUsesLisp
afdeee2b86 Use signed and unsigned vertex types (#370) 2018-08-20 16:02:38 -03:00
ReinUsesLisp
726de8c46a Rendertarget attachments, texture and image changes (#358)
* Add multiple color outputs for fragment shaders

* Add registers and gal enums

* Use textures for framebuffers and split color and zeta framebuffers

* Abstract texture and framebuffer targets as an image

* Share images between framebuffers and textures

* Unstub formats

* Add some formats

* Disable multiple attachments

* Cache framebuffer attachments

* Handle format types

* Add some rendertarget formats

* Code cleanup

* Fixup half float types

* Address feedback

* Disable multiple attachments in shaders

* Add A4B4G4R4 image format

* Add reversed section for image enums
2018-08-19 22:25:26 -03:00
gdkchan
521751795a
Code style fixes and nits on the HLE project (#355)
* Some style fixes and nits on ITimeZoneService

* Remove some unneeded usings

* Remove the Ryujinx.HLE.OsHle.Handles namespace

* Remove hbmenu automatic load on process exit

* Rename Ns to Device, rename Os to System, rename SystemState to State

* Move Exceptions and Utilities out of OsHle

* Rename OsHle to HOS

* Rename OsHle folder to HOS

* IManagerDisplayService and ISystemDisplayService style fixes

* BsdError shouldn't be public

* Add a empty new line before using static

* Remove unused file

* Some style fixes on NPDM

* Exit gracefully when the application is closed

* Code style fixes on IGeneralService

* Add 0x prefix on values printed as hex

* Small improvements on finalization code

* Move ProcessId and ThreadId out of AThreadState

* Rename VFs to FileSystem

* FsAccessHeader shouldn't be public. Also fix file names casing

* More case changes on NPDM

* Remove unused files

* Move using to the correct place on NPDM

* Use properties on KernelAccessControlMmio

* Address PR feedback
2018-08-16 20:47:36 -03:00
ReinUsesLisp
6e1a6c5b2b Implement PointCoord and PointSize shader attributes (#353)
* Implement PointCoord and PointSize shader attributes

* Address feedback
2018-08-16 02:26:03 -03:00
gdkchan
c393cdf8e3
More flexible memory manager (#307)
* Keep track mapped buffers with fixed offsets

* Started rewriting the memory manager

* Initial support for MapPhysicalMemory and UnmapPhysicalMemory, other tweaks

* MapPhysicalMemory/UnmapPhysicalMemory support, other tweaks

* Rebased

* Optimize the map/unmap physical memory svcs

* Integrate shared font support

* Fix address space reserve alignment

* Some fixes related to gpu memory mapping

* Some cleanup

* Only try uploading const buffers that are really used

* Check if memory region is contiguous

* Rebased

* Add missing count increment on IsRegionModified

* Check for reads/writes outside of the address space, optimize translation with a tail call
2018-08-15 15:59:51 -03:00
gdkchan
4f499b6845
Fix FMUL and TEXS shader instructions (#347) 2018-08-13 19:46:36 -03:00
gdkchan
09593ae6d8
Add partial support to the TEX.B shader instruction (#342)
* Add partial support to the TEX.B shader instruction, fix for mixed indexed and non-indexed drawing

* Better exception
2018-08-13 18:22:09 -03:00
ReinUsesLisp
25dd5f4238 Low level graphics API prerequisites (#319)
* Add GalPipelineState and IGalPipeline

* Separate UploadVertex call

* Add ConstBuffer cache

* Move Vertex Assembly into GalPipelineState

* Move Uniform binds to GalPipelineState

* Move framebuffer flip into a buffer

* Rebase

* Fix regression

* Move clear values from VertexEndGl to ClearBuffers

* Rename obscure names O->Old S->New
2018-08-10 01:09:40 -03:00
Darabat
827752ec07 Changing shader decompiler to avoid vec2 and vec3 types, which were causing specific crashes. (#332)
* Changing shader decompiler to avoid vec2 and vec3 types, which were causing specific crashes.

* aligning code

* step back

* Redoing changes

* Redoing changes

* Redoing changes and avoiding concatenations

* redoing changes
2018-08-06 22:26:19 -03:00
gdkchan
fa70629fab
Fix for integer vertex attributes and iset bf flag (#323) 2018-08-03 13:54:34 -03:00
greggameplayer
ce96a45685 Implement A2B10G10R10 TextureFormat (#248)
* add A2B10G10R10 TextureFormat

* return correct PixelFormat & PixelType

* return correct texture size

* return correct Bytes Per Pixel
2018-07-29 01:41:02 -03:00
ReinUsesLisp
51605fafc0 Avoid calling buffer binding when shader didn't change (#295) 2018-07-26 13:49:29 -03:00
ReinUsesLisp
1344a47c77 Blit framebuffer without shaders (#229)
* Blit framebuffer without shaders

* De-hardcode native size values

* Adapt to dehardcoded framebuffers and address feedback

* Remove framebuffer rebinding
2018-07-23 16:21:05 +02:00
ReinUsesLisp
5fe0bc584b Send data to OpenGL host without client-side copies (#285)
* Directly send host address to buffer data

* Cleanup OGLShader

* Directly copy vertex and index data too

* Revert shader bind "cache"

* Address feedback
2018-07-19 16:02:51 -03:00