Ryujinx/Ryujinx.Graphics.Gpu/Shader
riperiperi 9ac66336a2
GPU: Use lazy checks for specialization state (#4004)
* GPU: Use lazy checks for specialization state

This PR adds a new class, the SpecializationStateUpdater, that allows elements of specialization state to be updated individually, and signal the state is checked when it changes between draws, instead of building and checking it on every draw. This also avoids building spec state when

Most state updates have been moved behind the shader state update, so that their specialization state updates make it in before shaders are fetched.

Downside: Fields in GpuChannelGraphicsState are no longer readonly. To counteract copies that might be caused this I pass it as `ref` when possible, though maybe `in` would be better? Not really sure about the quirks of `in` and the difference probably won't show on a benchmark.

The result is around 2 extra FPS on SMO in the usual spot. Not much right now, but it will remove costs when we're doing more expensive specialization checks, such as fragment output type specialization for macos. It may also help more on other games with more draws.

* Address Feedback

* Oops
2022-12-04 18:41:17 +01:00
..
DiskCache Remove shader dependency on SPV_KHR_shader_ballot and SPV_KHR_subgroup_vote extensions (#3943) 2022-11-30 18:24:15 -03:00
HashTable infra: Migrate to .NET 7 (#3795) 2022-11-09 20:22:43 +01:00
CachedShaderBindings.cs GPU: Swap bindings array instead of copying (#4003) 2022-12-04 18:18:40 +01:00
CachedShaderProgram.cs GPU: Swap bindings array instead of copying (#4003) 2022-12-04 18:18:40 +01:00
CachedShaderStage.cs New shader cache implementation (#3194) 2022-04-10 10:49:44 -03:00
ComputeShaderCacheHashTable.cs GPU: Eliminate CB0 accesses when storage buffer accesses are resolved (#3847) 2022-11-17 18:47:41 +01:00
GpuAccessor.cs GPU: Eliminate CB0 accesses when storage buffer accesses are resolved (#3847) 2022-11-17 18:47:41 +01:00
GpuAccessorBase.cs Move gl_Layer from vertex to geometry if GPU does not support it on vertex (#3866) 2022-11-18 23:27:54 -03:00
GpuAccessorState.cs New shader cache implementation (#3194) 2022-04-10 10:49:44 -03:00
GpuChannelComputeState.cs GPU: Eliminate CB0 accesses when storage buffer accesses are resolved (#3847) 2022-11-17 18:47:41 +01:00
GpuChannelGraphicsState.cs GPU: Use lazy checks for specialization state (#4004) 2022-12-04 18:41:17 +01:00
GpuChannelPoolState.cs GPU: Use lazy checks for specialization state (#4004) 2022-12-04 18:41:17 +01:00
ResourceCounts.cs New shader cache implementation (#3194) 2022-04-10 10:49:44 -03:00
ShaderAddresses.cs New shader cache implementation (#3194) 2022-04-10 10:49:44 -03:00
ShaderCache.cs GPU: Use lazy checks for specialization state (#4004) 2022-12-04 18:41:17 +01:00
ShaderCacheHashTable.cs GPU: Use lazy checks for specialization state (#4004) 2022-12-04 18:41:17 +01:00
ShaderCacheState.cs Fix inconsistencies in progress reporting (#2129) 2021-03-22 19:40:07 +01:00
ShaderCodeAccessor.cs New shader cache implementation (#3194) 2022-04-10 10:49:44 -03:00
ShaderDumper.cs Removed unused usings. (#3593) 2022-08-18 18:04:54 +02:00
ShaderDumpPaths.cs Make sure attributes used on subsequent shader stages are initialized (#2538) 2021-08-11 22:27:00 +02:00
ShaderSpecializationList.cs GPU: Use lazy checks for specialization state (#4004) 2022-12-04 18:41:17 +01:00
ShaderSpecializationState.cs GPU: Use lazy checks for specialization state (#4004) 2022-12-04 18:41:17 +01:00
TransformFeedbackDescriptor.cs Rename ToSpan to AsSpan (#3556) 2022-08-11 18:07:37 -03:00