Commit Graph

  • 9af43c4f85 FSR 2.3.4/3.1.5 update may2025update Nico de Poel 2025-08-23 13:06:30 +0200
  • c822943546 Backported fixes for auto-exposure and new locks Nico de Poel 2025-05-11 12:38:02 +0200
  • 10de723158 Added settings and UI for the new advanced configuration features Nico de Poel 2025-05-09 20:49:40 +0200
  • 076155a916 Updated to FSR 3.1.4 and backported a couple of previous PPV2 fixes Nico de Poel 2025-05-09 20:20:42 +0200
  • b71f556a0b Updated gitignore to filter out some more stuff Nico de Poel 2025-05-09 19:57:05 +0200
  • 66e3842ebf Fixed jitter being weirdly inverted, though in Isonzo the opposite is required. Strange. fsr3.1 Nico de Poel 2025-04-04 14:39:24 +0200
  • a3f7914691 Prototype implementation of FSR 3.1 via a native plugin Nico de Poel 2025-04-03 19:01:46 +0200
  • f3fcfec801 Backported safety fixes from Isonzo pssr Nico de Poel 2025-04-02 19:53:49 +0200
  • 206d0dfd97 Merge branch 'armasr' into pssr Nico de Poel 2025-04-02 17:43:46 +0200
  • dad922c338 Swapped Luma and MotionVector outputs on the Reconstruct & Dilate pass, which fixes another apparent alignment issue on PS5 NGGC, causing the motion vectors to break occasionally when switching scaling ratios. armasr Nico de Poel 2025-04-01 13:48:57 +0200
  • f8483414f2 Fixed exposure instability for a few seconds after initialization on iOS Metal, and cleared out a shader compiler warning at run-time. Nico de Poel 2025-03-30 20:15:49 +0200
  • 1dc6216750 Simplified platform wave operation support check Nico de Poel 2025-03-27 20:38:20 +0100
  • fdf2125cfe Revert "Removed Xbox Series from the modern shaders, as it doesn't like Native16Bit at all and just falls back to legacy, and restored Native16Bit to all the modern shaders. Xbox Series will still use DXC and wave operations." Nico de Poel 2025-03-27 20:27:00 +0100
  • 99f28af11d Removed Xbox Series from the modern shaders, as it doesn't like Native16Bit at all and just falls back to legacy, and restored Native16Bit to all the modern shaders. Xbox Series will still use DXC and wave operations. Nico de Poel 2025-03-26 23:59:42 +0100
  • d7483c31c4 Added some commented-out debug pragmas to the compute shaders Nico de Poel 2025-03-26 22:29:11 +0100
  • 1222d236f5 Fixed dynamic resolution scaling: - Two instances of the same bug in ARM's code, where RenderSize was used instead of MaxRenderSize to calculate UVs - One instance of me previously fixing a bug in Isonzo that isn't a bug in the latest PPV2 code, oops Nico de Poel 2025-03-26 22:25:51 +0100
  • 133343b285 Added texture array support for inputs and outputs Nico de Poel 2025-03-26 16:22:14 +0100
  • 3ae6628a34 Added a few missing "in" keywords Nico de Poel 2025-03-26 15:46:10 +0100
  • 760003744f Added missing bits of temporal reactive implementation in the FP32 code path, and only bind the relevant inputs to the Accumulate shader based on the ASR mode. Fixes Balanced and Performance modes on Xbox One, which for some reason still seems to be running the FP32 code path, no matter what the FFXM_HALF keyword is set to. Nico de Poel 2025-03-25 20:55:17 +0100
  • cfae0072e9 Force enable FP16 shader code path, and redefine FFXM_HALF with a truthy value Nico de Poel 2025-03-25 20:16:57 +0100
  • 4a8f9455e6 Removed the old license text from the C# source files Nico de Poel 2025-03-25 18:45:27 +0100
  • 4c6a7b7309 Removed Native16Bit from the two compute shaders because Xbox Series does not like it. Seems fine for the fragment shader though, which is where it matters most. Nico de Poel 2025-03-25 18:39:29 +0100
  • facfd037d2 Added Legacy variants of the ASR shaders, without DXC, Native16Bit or wave operations. Separated them into an AsrShaderBundle that can be selected from at run-time based on the current graphics device. Nico de Poel 2025-03-25 18:38:54 +0100
  • 5faf6c2a56 Reworked ASR shaders for modern compilation on DX12, Vulkan, Metal, PS5 and Xbox Series: - Use DXC compiler - Enable native 16-bit - Use wave operations where supported Nico de Poel 2025-03-25 16:51:45 +0100
  • 89269073f7 Removed random write requirement from all render textures that aren't used as UAV (i.e. are used as fragment render targets). Sort of makes GLES3 work, and might provide an appreciable overall efficiency boost as well. Nico de Poel 2025-03-25 15:42:08 +0100
  • 1c599af0b6 Merge branch 'asr-console' into armasr Nico de Poel 2025-03-25 15:27:50 +0100
  • 3293533bf9 Minor: print the ASR variant to the log when creating the context, makes for easier readback of the log asr-console Nico de Poel 2025-03-25 14:57:04 +0100
  • 3912c66b0d Bind new locks to the accumulate shader as a regular SRV (read-only), and clear the locks buffer ahead of time instead of at the end of the accumulate shader. This simplifies the shader binding setup, as well as being "more correct" because we're using a temporary RT for the locks buffer, meaning it makes no sense to clear it for the next frame. Nico de Poel 2025-03-25 13:58:41 +0100
  • 16cf41493a Swapped the order of the render targets around for the depth clip pass. Fixes prepared input color being black in NGGC because... I don't know, probably an alignment issue of some sort? PS5 is being really stupid here. Nico de Poel 2025-03-25 13:11:33 +0100
  • 51e5a86112 Reverted dilated reactive masks format back to R8G8_UNorm, as that works correctly now Nico de Poel 2025-03-25 12:18:34 +0100
  • c52a40f706 Use implicit register binding when using UAVs in fragment shaders. Fixes remaining issues with reconstruct and accumulate passes on PS5 CGGC. Also disable writing to locks UAV at the end of Accumulate pass, as it doesn't actually do anything and it might cause issues with reading & writing to the same texture. Nico de Poel 2025-03-25 12:07:08 +0100
  • cc74a9cd2f Use implicit register binding for fragment shader random write targets. Fixes UAVs not binding properly on PS5. Nico de Poel 2025-03-25 11:00:30 +0100
  • 90490e8819 Temp disabled Native16Bit again, as it does cause compilation issues when building for standalone. Need to make a split between Modern and Legacy here. Nico de Poel 2025-03-25 10:47:06 +0100
  • 2f8a0ca595 Added output target pragmas for random write targets. Not sure if these are necessary but it's something to keep an eye on. Nico de Poel 2025-03-24 19:59:23 +0100
  • 9aee5758b6 Made some progress towards making ASR FP16 work on PS5: - Auto-gen reactive mask & Reconstruct previous depth & Depth Clip passes now verified correct and working - Changed dilated reactive masks texture format to R16G16_SFloat, which Agc seems to like better as an output format than R8G8_UNorm - Accumulate pass is the only real (big) problem left Nico de Poel 2025-03-24 19:36:25 +0100
  • bd18c12408 Updated PSSL target output format pragmas with what *should* be the correct values, though the PS5 still disagrees with this Nico de Poel 2025-03-24 18:40:07 +0100
  • 5f4d4b37ad Fixed a big derp in the PSSL type definitions, copy-pasted code still contained FFX_HALF instead of FFXM_HALF, which caused 16-bit types to be compiled as 32-bit, causing a bunch of duplicate function definitions. Nico de Poel 2025-03-24 17:18:30 +0100
  • 884ca84071 Moved unorm and globallycoherent definitions to the common cginc, rather than stuffing them somewhere in between all the types Nico de Poel 2025-03-24 16:43:32 +0100
  • e4ad05a414 Made PSSL pragmas only get included for PSSL to prevent compiler warnings, and require native 16-bit compilation for PSSL. Nico de Poel 2025-03-24 16:40:23 +0100
  • 1f7beb397f Merge branch 'armasr' into asr-console Nico de Poel 2025-03-24 16:28:20 +0100
  • 8d85253def Enabled Native16Bit requirement for Vulkan, which sets a precedent for other graphics APIs to use this as well Nico de Poel 2025-03-24 14:34:13 +0100
  • 090b9135e8 Reworked auto-exposure to use a double buffered render texture, which allows the smooth exposure transition logic to load a value that's guaranteed to be from the previous frame. Fixes artifacting and flickering issues caused by loading & storing to the same texture. Nico de Poel 2025-03-24 13:56:39 +0100
  • d088d440f5 Allow live switching between FP16 and FP32 Nico de Poel 2025-03-24 12:08:53 +0100
  • c0cf3de364 Temporarily disable FP16 altogether, which makes PSSL shader compilation a lot happier. Need to figure out how to make the FP16 utility function definitions work without the shader compiler complaining about duplicate declarations. Nico de Poel 2025-03-24 11:22:26 +0100
  • c4b59c7dc3 Bunch of fixes to make ASR Quality somewhat work on PS5, without reactive mask still: - Define macros for various VS/FS binding intrinsics - Use pragmas to set output formats for render targets that aren't normal RGBA - Added alpha channel to color output targets, so that they're 4-channel instead of 3 - Pass FSR2 constant buffer to reactive mask shader (may not matter) Nico de Poel 2025-03-23 22:38:28 +0100
  • 6824f1f652 Enable FP16 (FFXM_HALF keyword) usage by default Nico de Poel 2025-03-23 20:23:29 +0100
  • 4c93edccde Added type definitions for PSSL (PS4/5) and removed hard-coded FFMX_HALF defines. Let the multi-compile shaders and C# code control that. Nico de Poel 2025-03-23 20:23:07 +0100
  • 9ef2bfdef0 Reverted rework of accumulation parameter initialization function to what it originally was, but with a struct clear to zero. Nico de Poel 2025-03-23 18:56:02 +0100
  • 389faf3b65 Minor fixes (clearing auto-exposure to 1e8f achieves faster convergence but might cause issues with OpenGL on Nvidia, keep an eye on this!) Nico de Poel 2025-03-23 13:58:54 +0100
  • 4a0fc42c2a Fixed RCAS pass still using compute shader bindings Nico de Poel 2025-03-22 23:13:57 +0100
  • c92e35ff73 Added balanced and performance preset keywords to the depth clip and accumulate passes, which seem to be the only ones that use it. Makes the Balanced variant work. Performance variant still problematic. Nico de Poel 2025-03-22 23:09:28 +0100
  • 943d119706 Fixed a number of issues to make Quality variant work: - Removed "fix" to initialize params to 0, as that happens midway through the Accumulation process, resetting a lot of variables. Instead rewrote InitParams to take an inout parameter and clear the params first thing in the Accumulate function. - Bind first multi-render target as depth target, fixes RenderDoc errors about color/depth buffer size mismatch. - Ensure keywords that need a value are redefined using the correct value. - Removed obsolete auto-TCR constants struct. Nico de Poel 2025-03-22 23:02:44 +0100
  • c4df3d45aa Got UAV bindings in fragment shaders to work in what I think is the correct way Nico de Poel 2025-03-22 17:49:16 +0100
  • 82734c7606 Went over all the shader inputs and output and implemented them. Realized that some fragment shaders use UAVs with random write, is that even possible in Unity? Nico de Poel 2025-03-22 17:20:44 +0100
  • d71b061d16 Added new shader IDs and resource definitions Nico de Poel 2025-03-22 16:08:39 +0100
  • 20a930097e Added keywords for balanced/performance presets and GLES support Nico de Poel 2025-03-22 15:24:59 +0100
  • 3ef31fac65 Some cleanup and minor fixes Nico de Poel 2025-03-22 14:09:37 +0100
  • 2a88584eb2 Added a quick and dirty upscaler integration and fixed global keyword creation Nico de Poel 2025-03-22 13:12:38 +0100
  • ac0adc168b Added definition for quality preset variants Nico de Poel 2025-03-22 13:02:17 +0100
  • d320a76b89 Turned dispatch descriptions into structs, using in-parameters where applicable Nico de Poel 2025-03-22 12:55:29 +0100
  • a0eeda1e84 Updated fragment shader passes to provide their output render targets to the Blit function, including multi-render targets Nico de Poel 2025-03-22 12:43:53 +0100
  • d5bbadaa77 Made all the ASR shader keywords global and encapsulated all of the keyword management into a separate class, which will enable and disable keywords globally based on the initialization flags and dispatch parameters. Nico de Poel 2025-03-22 12:29:04 +0100
  • dd33e77b6f Reworked ASR passes to allow for blitting using fragment shaders, and got an idea of the problems yet to solve. Modified assets script and added it to the PPV2 resources. Some additional refactoring and bug fixing as well. Nico de Poel 2025-03-21 22:39:34 +0100
  • d7191b98e7 Applied a few more recent fixes from the FSR2 codebase Nico de Poel 2025-03-20 22:47:44 +0100
  • d3f60e2650 Added ASR runtime source files, as a copy of the FSR2 sources, with a bunch of renaming and stripped of some parts that we know we're not going to need. Nico de Poel 2025-03-20 22:10:54 +0100
  • c8eebd63ed Added multi-compile keywords for all fragment shaders, and added Metal workaround for texture atomics Nico de Poel 2025-03-19 22:04:40 +0100
  • a85e242d4c Added shaders for the two compute passes, plus a few minor fixes Nico de Poel 2025-03-19 21:49:42 +0100
  • d77922cc4b Backported fixes that we already know are going to be necessary for full Unity support: - Removed empty parantheses on GroupMemoryBarrier macro, which confuse the 2020.1 shader compiler - Added padding field to cbFSR2 to make it exactly 128 bytes in size, which gives correct buffer alignment on iOS Metal - Changed auto-exposure reset threshold value to 1e4f, as part of a fix for black screen flashes in OpenGL Core on Nvidia GPUs - Clamp luma to >= 0 in auto-exposure to fix artifacting in OpenGL Core on Nvidia GPUs - Removed #extension directives meant for GLSL, which cause shader compiler warnings in Unity Nico de Poel 2025-03-19 20:17:46 +0100
  • 1551a3ccf8 Added the remaining vertex/fragment shader passes and made the same modifications to get them to compile Nico de Poel 2025-03-19 20:04:23 +0100
  • c27195fb9a Defined a vertex/fragment shader for the accumulate pass, with initial modifications to make things compile as a proof of concept: - Removed vk::binding directives, as they are only meant for Vulkan and don't mean anything to Unity - Initialize inout struct as zero to stop Unity compiler complaints - Renamed vertex main function to VertMain to prevent duplicate main function declaration - Removed duplicate VertexOut struct declaration - Removed unused header includes in vertex shader code, preventing duplicate declarations - Fixed up a few relative header include paths Nico de Poel 2025-03-19 19:51:57 +0100
  • 66059cb742 Imported ARM ASR shader code for HLSL without any modifications Nico de Poel 2025-03-19 19:09:29 +0100
  • 299200cb9c Ported over jitter UV fixes from Snapdragon GitHub repo multi-scaler sgsr2_fs Nico de Poel 2025-01-20 19:12:45 +0100
  • 9971d85ce4 Changed output texture formats from half to float, fixes Metal shader compilation issues on iOS Nico de Poel 2025-01-20 18:44:38 +0100
  • 9f4b96ea25 Made integration more PPV2-like by using property sheets, material property blocks and the BlitFullScreenTriangle method. Nico de Poel 2024-12-28 14:46:20 +0100
  • df58df61d6 Reorganized shader code such that standard BiRP and PPV2 can share the same common code with only some light wrappers to implement the differences Nico de Poel 2024-12-28 14:29:34 +0100
  • 72df347315 Reworked 2-pass FS implementation to integrate more directly with the PPV2 framework, allowing for multi-target rendering using the fullscreen triangle blit, which eliminates the need for an extra blit at the end. Also fixed a bug where the scale factor was inverted, which caused FS upscaling output to be blurry. Nico de Poel 2024-12-25 15:40:55 +0100
  • cac783bebc Working SGSR2 2-pass FS implementation, bit dirty but good enough for testing. Nico de Poel 2024-12-24 16:44:03 +0100
  • 87237bbddc Initial conversion to HLSL Nico de Poel 2024-12-23 16:39:21 +0100
  • a0fa2c9e60 First import of GLSL fragment shaders plus some initial Unity shader setup Nico de Poel 2024-12-23 16:10:42 +0100
  • a56f0742b5 Further tweaked motion vector processing, now the camera motion vectors from Unity produce an exact match with the auto-generated motion from the clip-delta matrix, in both D3D, Vulkan and OpenGL. It also makes sense with regards to the flipped Y-coordinate in screen space now. The final result looks good now too. Nico de Poel 2024-12-22 16:30:50 +0100
  • 05989857c0 Added an untested and as of yet unused HDRP include file, just as an expression of what this file will look like for SRPs Nico de Poel 2024-12-22 13:42:14 +0100
  • d354d07d81 Added scaleRatio to unify the cbuffer definition for all shaders, including the fragment shader variant. Nico de Poel 2024-12-22 13:24:02 +0100
  • ed566a8beb Empirically determined the best setup for motion vectors in OpenGL, though it still doesn't make a whole lot of sense. Added opt-in debug symbols line to the upscale shaders to make analysis easier. Nico de Poel 2024-12-22 12:58:30 +0100
  • 4f8cf086bf More specifically, set NDC Y-coordinate to be up when the Unity graphics API has UV's starting at the top Nico de Poel 2024-12-21 21:12:57 +0100
  • 80a8532cb4 Cleaned up an unused argument Nico de Poel 2024-12-21 21:07:50 +0100
  • 5b203e7ef5 Set normalized device coordinates Y direction to be up, which is standard in Unity, and properly detect non-zero motion vector inputs. This *seems* to be the correct recipe. Nico de Poel 2024-12-21 21:01:13 +0100
  • 19b2969e58 Added macros to change nearest-depth and depth-clipping logic based on whether the Unity graphics API uses reversed Z or not Nico de Poel 2024-12-21 17:06:07 +0100
  • 8635b131f6 Renamed SGSR2 compute shader resources class, to allow an easier distinction between fragment and compute variants later on Nico de Poel 2024-12-21 16:53:26 +0100
  • 8d6036c91c Moved a bunch of common definitions and functions into a separate file Nico de Poel 2024-12-21 16:48:15 +0100
  • 0469bb921f Reverted use of CBUFFER_ macros, as it was breaking the shaders on Vulkan Nico de Poel 2024-12-21 16:37:09 +0100
  • 3285c552f4 Verified motion vector "decoding" against the auto-generated camera MVs based on the clip-space delta matrix, and made a small fix Nico de Poel 2024-12-21 15:32:52 +0100
  • c43c8d11f9 Reworked SGSR2 classes, moving more logic to the base class, and implemented clip-space delta matrix as well as the is-camera-still logic. Nico de Poel 2024-12-21 15:08:24 +0100
  • 9bf6a12c97 Minor optimization: use half float types wherever the original GLSL code uses mediump floats. Nico de Poel 2024-12-21 13:02:31 +0100
  • 7217b0fc32 Unity-fied all SGSR2 shaders by changing all texture declarations and accesses into TextureXR-style macros, with a shared BiRP definitions file. Nico de Poel 2024-12-21 12:51:23 +0100
  • 0f7baf0b52 Implemented 2-pass CS dispatch Nico de Poel 2024-12-20 23:40:04 +0100
  • d4c1d3f56e Made SGSR2 upscaler plugin abstract and split off 3-pass CS version into its own separate class Nico de Poel 2024-12-20 23:34:21 +0100
  • 14fa1bc7d2 Initial port of SGSR2 2-pass compute shaders to HLSL (untested) Nico de Poel 2024-12-20 23:16:06 +0100
  • 708e4308c5 Consolidated SGSR2 shaders into single .compute files as there's not much point in using includes, and grouped them together into a 3-pass folder. This will make it easier to add the other variants later. Nico de Poel 2024-12-20 22:01:37 +0100
  • 7a259062d8 Working SGSR2 3-pass: - Added padding field to fix buffer data misalignment issue - Simplified the translation of GLSL globalInvocationID to HLSL Nico de Poel 2024-12-20 18:22:15 +0100
  • 2afedcb836 Renamed FSR 2.2 to 2.3 because that's what it's called now apparently dec2024update Nico de Poel 2024-12-15 15:16:00 +0100