* vulkan: Enforce Vulkan 1.2+ at instance API level and 1.1+ at device level
This ensure we don't end up trying to initialize with anything currently incompatible.
* Address riperiperi's comment
I was forcing some types of texture to partially update when investigating performance with games that stream in data, and noticed that partially loading texture data was really broken on both backends.
Fixes Vulkan texture set by getting the correct expected size for the texture. Fixes partial upload on both backends for both Texture 2D Array and Cubemap using the wrong offset and uploading to the first layer/level for a handle. 3D might also be affected.
This might fix textures randomly having incorrect data in games that render to it - jumbled in the case of OpenGL, and outdated/black in the case of Vulkan. This case typically happens in UE4 games.
* Log shader compile errors with Warning level
These are infrequent enough that I think it's worth dumping any errors into the log. They also keep causing graphical glitches, and the only indication that anything went wrong is a debug log that is never enabled.
* Add maximum length for shader log
* Replace unicorn bindings with Nuget package
* Use nameof for ValueSource args
* Remove redundant code from test projects
* Fix wrong values for EmuStart()
Add notes to address this later again
* Improve formatting
* Fix formatting/alignment issues
The AutoFlushCounter would flush command buffers on any attachment change (write mask or bindings change) if there was a pending query. This is to get query results as soon as possible for draw skips, but it's assuming that a full occlusion query _pass_ happened, that we want to flush it's data before getting onto draws, rather than the queries being randomly interspersed throughout a pass that also draws.
Xenoblade 2 repeatedly switches between performing a samples passed query and outputting to a render target on each draw, and flips the write mask to do so. Flushing the command buffer every 2 draws isn't ideal, so it's best that we only do this if the pattern matches the large block style of occlusion query.
This change makes this flush only happen after a few consecutive query reports. "Consecutive" is interrupted by attachment changes or command buffer flush.
This doesn't really solve the issue where it resets more queries than it uses, it just stops the game doing it as often. I'm not sure of the best way to do that. The cost of resetting could probably be reduced by using query pools with more than one element and resetting in bulk.
* Handle mismatching texture size with copy dependencies
* Create copy and render textures with the minimum possible size
* Only align width for comparisons, assume that height is always exact
* Fix IsExactMatch size check
* Allow sampler and copy textures to match textures with larger width
* Delete texture ChangeSize related code
* Move AdjustSize to TextureInfo and give it a better name, adjust usages
* Fix GetMinimumWidthInGob when minimumWidth > width
* Only update render targets that are actually cleared for clear
Avoids creating textures with incorrect sizes
* Delete UpdateRenderTargetState method that is not needed anymore
Clears now only ever sets the render targets that will be cleared rather than all of them
* Support safe blit on non-2D textures (except multisample)
* Change safe blit with different levels and layers to match CmdBlitImage path
* Remove now unused variables
* Multisample safe blit support
* Initial Apple Hypervisor based CPU emulation implementation
* Add UseHypervisor Setting
* Add basic MacOS support to Avalonia
* Fix initialization
* Fix GTK build
* Fix/silence warnings
* Change exceptions to asserts on HvAddressSpaceRange
* Replace DllImport with LibraryImport
* Fix LibraryImport
* Remove unneeded usings
* Revert outdated change
* Set DiskCacheLoadState when using hypervisor too
* Fix HvExecutionContext PC value
* Address PR feedback
* Use existing entitlements.xml file on distribution folder
---------
Co-authored-by: riperiperi <rhy3756547@hotmail.com>
* Create bug_report.yml
* Update bug_report.yml
* Update bug_report.yml
* Create feature_request.yml
* Update feature_request.yml
* Update feature_request.yml
* Update feature_request.yml
* Update feature_request.yml
* a
* Update missing_cpu_instruction.yml
* Update missing_cpu_instruction.yml
* Update missing_cpu_instruction.yml
* Update missing_cpu_instruction.yml
* b
* addressed some of the feedback
* forget the label
* added missing text inputs
* formatting changes
* dropdown menu
added dropdown menu for os, idk if we will keep this
* addressed feedback
addressed the long overdue feedback, sorry about that
* added markdowns
everything should be addressed now i hope
* game version optional
made game version optional after further feedback
* feature request checkbox
* Relax Vulkan requirements
* Fix MaxColorAttachmentIndex
* Fix ColorBlendAttachmentStateCount value mismatch for background pipelines
* Change query capability check to check for pipeline statistics query rather than geometry shader support
* Reset queries on same command buffer
Vulkan seems to complain when the queries are reset on another command buffer. No idea why, the spec really could be written better in this regard. This fixes complaints, and hopefully any implementations that care extensively about them.
This change _guesses_ how many queries need to be reset and resets as many as possible at the same time to avoid splitting render passes. If it resets too many queries, we didn't waste too much time - if it runs out of resets it will batch reset 10 more.
The number of queries reset is the maximum number of queries in the last 3 frames. This has been worked into the AutoFlushCounter so that it only resets up to 32 if it is yet to force a command buffer submission in this attachment.
This is only done for samples passed queries right now, as they have by far the most resets.
* Address Feedback
* Allow setting texture data from 1x to fix some textures resetting randomly
Expected targets:
- Deltarune 1+2
- Crash Team Racing
- Those new pokemon games idk
* Allow scaling of MSAA textures, propagate scale on copy.
* Fix Rebase
Oops
* Automatic disable
* A bit more aggressive
* Without the debug log
* Actually decrement the score when writing.
The only guarantee of the occlusion query type in Vulkan is that it will be zero when no samples pass, and non-zero when any samples pass. Of course, most GPUs implement this by just placing the # of samples in the result and calling it a day. However, this lax restriction means that GPUs could just report a boolean (1/0) or report a value after one is recorded, but before all samples have been counted.
MoltenVK falls in the first category - by default it only reports 1/0 for occlusion queries. Thankfully, there is a feature and flag that you can use to force compatible drivers to provide a "precise" query result, that being the real # of samples passed.
Should fix ink collision in Splatoon 2/3 on MoltenVK.