Nico de Poel
47cba76dee
Made all RenderTargetView fields non-nullable, and introduced a special Empty value for optional fields.
This removes the need for a lot of HasValue checks, especially since all fields will eventually get a value anyway, making those checks rather redundant. This also makes it clearer that all SRVs will get bound with a valid input texture, even if the input is optional.
2 years ago
Nico de Poel
e8d12c201e
- Reworked input/output resource management using a new RenderTargetView struct, which encompasses all relevant data required to bind textures from various sources.
This eliminates the need for resource binding code outside of the core FSR2 classes, and makes the public API more strict and consistent, but also more flexible. In addition, it removes the need for the slightly awkward input/output resource debug checks.
- Changed prebaked RCAS configurations into an array, as there is no need for a dynamically sized list here.
2 years ago
Nico de Poel
7c41364109
Set constant buffer data as part of the command buffers, instead of immediately.
3 years ago
Nico de Poel
9668b132e7
Clear initial exposure value with zero. Seems to work fine for all tested platforms, and eliminates the black screen flashes on Metal without requiring any platform-specific hacks.
3 years ago
Nico de Poel
c65cab824e
Clear auto-exposure texture using zeroes on Metal. Should fix black screen flashes on accumulation reset, when auto-exposure is enabled.
3 years ago
Nico de Poel
e577240354
Reset atomic counter on any kind of reset, not just on first execution. Fixes black screen on Metal when doing a history reset.
3 years ago
Nico de Poel
8c43881c8d
Added zero check to make undo mipmap bias offset an idempotent operation
3 years ago
Nico de Poel
9911642947
Refactored undo mipmap bias callback such that the RP integration does not need to maintain any bias offset state. Added NaN/Infinity check to the standard apply mipmap bias callback implementation.
3 years ago
Nico de Poel
bc3192fc40
Made undoing of mipmap bias a distinct separate callback, so that it can be overridden by client apps.
3 years ago
Nico de Poel
9e53cf52f8
Skip textures that don't have mipmaps and thus don't have any use for a mipmap bias
3 years ago
Nico de Poel
b3bc46fcb7
Moved management of aliasable resources to the Fsr2Resources class and gave the methods more logical names.
3 years ago
Nico de Poel
3f17ca1fe2
Revert "Create temporary resources at actual render size, further reducing VRAM usage when dynamic resolution is in effect."
This reverts commit a2c1211d98 .
3 years ago
Nico de Poel
45ce81610d
Restored compatibility with Unity versions older than 2021.2, which didn't have the LocalKeyword struct yet.
3 years ago
Nico de Poel
a2c1211d98
Create temporary resources at actual render size, further reducing VRAM usage when dynamic resolution is in effect.
3 years ago
Nico de Poel
cf316ebf4f
Comment that the atomic counter shouldn't be aliasable
3 years ago
Nico de Poel
63d6fd3203
Changed atomic counter from a temporary RT to a permanent one, and set it to 0 only on the first frame. Potential fix for auto-exposure on MacOS.
3 years ago
Nico de Poel
47c2560476
Consolidated accumulate and accumulate+sharpen pipelines into a single pipeline, with the sharpening option being changed into a local keyword that can be enabled or disabled on-the-fly.
This removes the need for an additional copy of the accumulate shader, which saves a considerable amount of memory.
3 years ago
Nico de Poel
53e8164f0e
Clear the atomic counter used by the luminance pyramid pass. This fixes auto-exposure being broken and causing a black screen on some platforms (Xbox, OpenGL).
3 years ago
Nico de Poel
501b1b0638
Added workaround for HDRP using texture arrays for its camera buffers on some platforms
3 years ago
Nico de Poel
ef20869c48
Added support for experimental auto-TCR generation pass
3 years ago
Nico de Poel
a2d670d0f8
Added a dummy field to the main FSR2 constant buffer, to make it exactly 128 bytes long. This fixes a data alignment issue on iOS Metal.
3 years ago
Nico de Poel
9f887a5c3c
Check shader after loading it, throw an exception with a message on failure. This is better than having a random nullref happen, if the shaders cannot be loaded for whatever reason.
3 years ago
Nico de Poel
38cc3a83fd
Don't validate input/output resources on reset, so the application has a way to prevent error messages when re-enabling a camera.
In this situation, the previous frame won't have bound the required resources, leading to those errors. Now, if the application calls Reset() after re-enabling the camera, the error messages won't show.
3 years ago
Nico de Poel
47d40fb71d
More accurate representation of where SystemInfo.computeSubGroupSize is available
3 years ago
Nico de Poel
bfa9d5196a
Made Callbacks into a property and just use rounding to int for dealing with floating point inaccuracies.
3 years ago
Nico de Poel
73fa30927b
Got rid of the global callbacks thing and made callbacks a local field of the Fsr2ImageEffect script.
This way different applications of FSR2 within the same game can have different callbacks applied to them.
For example: a camera for rendering a 3D UI image to a render texture can have callbacks to apply mipmap bias only to the assets being drawn for the UI.
3 years ago
Nico de Poel
f6da12c854
Brought back Ultra Quality mode (1.2x) scale, likely for good this time.
It gets you about the same performance as native without AA, it has precedent in other games, it gives us nice symmetry with Ultra Performance mode, and it means the QualityMode enum is 0-based now.
3 years ago
Nico de Poel
e0027ed77a
Added MIT license header to every source file, similar to the FFX FSR2 codebase
3 years ago
Nico de Poel
1cc0de7c89
Moved Shader ID constants to a separate class file
3 years ago
Nico de Poel
1ff980bea9
Changing my mind yet again about directory names
3 years ago