* Add workflow to perform automated checks for PRs
* Downgrade Microsoft.CodeAnalysis to 4.4.0
This is a workaround to fix issues with dotnet-format.
See:
- https://github.com/dotnet/format/issues/1805
- https://github.com/dotnet/format/issues/1800
* Adjust editorconfig to be more compatible with Ryujinx code-style
* Adjust .editorconfig line endings to match .gitattributes
* Disable 'prefer switch expression' rule
* Remove naming styles
These are the default rules, so we don't need to override them.
* Silence IDE0060 in .editorconfig
* Slightly adjust .editorconfig
* Add lost workflow changes
* Move .editorconfig comment to the top
* .editorconfig: private static readonly fields should be _lowerCamelCase
* .editorconfig: Remove alignment for declarations as well
* editorconfig: Add rule for local constants
* Disable CA1822 for HLE services
* Disable CA1822 for ViewModels
Bindings won't work with static members, but this issue is silently ignored.
* Run dotnet format for the whole solution
* Check result code of SDL_GetDisplayBounds
* Fix dotnet format style issues
* Add missing trailing commas
* Update Microsoft.CodeAnalysis.CSharp to 4.6.0
Skipping 4.5.0 since it breaks dotnet format
* Restore old default naming rules for dotnet format
* Add naming rule exception for CPU tests
* checks: Include all files before excluding paths
* Fix dotnet format issues
* Check dotnet format version
* checks: Run dotnet format with severity info again
* checks: Disable naming style rules until they won't crash the process anymore
* Remove unread private member
* checks: Attempt to run analyzers 3 times before giving up
* checks: Enable naming style rules again with the new retry logic
* dotnet format style --severity info
Some changes were manually reverted.
* Restore a few unused methods and variables
* Silence dotnet format IDE0060 warnings
* Silence dotnet format IDE0059 warnings
* Address or silence dotnet format CA2208 warnings
* Address most dotnet format whitespace warnings
* Apply dotnet format whitespace formatting
A few of them have been manually reverted and the corresponding warning was silenced
* Format if-blocks correctly
* Add comments to disabled warnings
* Simplify properties and array initialization, Use const when possible, Remove trailing commas
* Address IDE0251 warnings
* Silence IDE0060 in .editorconfig
* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"
This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.
* dotnet format whitespace after rebase
* First dotnet format pass
* Apply suggestions from code review
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Address review feedback
* Update src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs
Co-authored-by: Ac_K <Acoustik666@gmail.com>
---------
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Texture: Fix layout conversion when gobs in z is used with depth = 1
The size calculator methods deliberately reduce the gob size of textures if they are deemed too small for it. This is required to get correct sizes when iterating mip levels of a texture.
Rendering to a slice of a 3D texture can produce a 3D texture with depth 1, but a gob size matching a much larger texture. We _can't_ "correct" this gob size, as it is intended as a slice of a larger 3D texture. Ignoring it causes layout conversion to break on read and flush.
This caused an issue in Tears of the Kingdom where the compressed 3D texture used for the gloom would always break on OpenGL, and seemingly randomly break on Vulkan. In the first case, the data is forcibly flushed to decompress the BC4 texture on the CPU to upload it as 3D, which was broken due to the incorrect layout. In the second, the data may be randomly flushed if it falls out of the cache, but it will appear correct if it's able to form copy dependencies.
This change only allows gob sizes to be reduced once per mip level. For the purpose of aligned size, it can still be reduced infinitely as our texture cache isn't properly able to handle a view being _misaligned_.
The SizeCalculator has also been changed to reduce the size of rendered depth slices to only include the exact range a single depth slice will cover. (before, the size was way too small with gobs in z reduced to 1, and too large when using the correct value)
Gobs in Y logic remains untouched, we don't support Y slices of textures so it's fine as is.
This is probably worth testing in a few games as it also affects texture size and view logic.
* Improve wording
* Maybe a bit better