diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2021-06-23 20:51:41 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-24 01:51:41 +0200 |
| commit | a10b2c5ff26886e9ffc6f19e3f0fe9505a503b2f (patch) | |
| tree | 006d013c300fb56c94c5563c2c1409a189f794b2 /Ryujinx.Graphics.Gpu/Engine/Compute.cs | |
| parent | 12a7a2ead812d46deb9d978b6758731157be1cbc (diff) | |
Initial support for GPU channels (#2372)
* Ground work for separate GPU channels
* Rename TextureManager to TextureCache
* Decouple texture bindings management from the texture cache
* Rename BufferManager to BufferCache
* Decouple buffer bindings management from the buffer cache
* More comments and proper disposal
* PR feedback
* Force host state update on channel switch
* Typo
* PR feedback
* Missing using
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Compute.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Engine/Compute.cs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Compute.cs b/Ryujinx.Graphics.Gpu/Engine/Compute.cs index be317a7f..a7f6ec06 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Compute.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Compute.cs @@ -40,7 +40,7 @@ namespace Ryujinx.Graphics.Gpu.Engine ulong gpuVa = (uint)qmd.ConstantBufferAddrLower(index) | (ulong)qmd.ConstantBufferAddrUpper(index) << 32; ulong size = (ulong)qmd.ConstantBufferSize(index); - BufferManager.SetComputeUniformBuffer(index, gpuVa, size); + state.Channel.BufferManager.SetComputeUniformBuffer(index, gpuVa, size); } ShaderBundle cs = ShaderCache.GetComputeShader( @@ -57,9 +57,9 @@ namespace Ryujinx.Graphics.Gpu.Engine var samplerPool = state.Get<PoolState>(MethodOffset.SamplerPoolState); var texturePool = state.Get<PoolState>(MethodOffset.TexturePoolState); - TextureManager.SetComputeSamplerPool(samplerPool.Address.Pack(), samplerPool.MaximumId, qmd.SamplerIndex); - TextureManager.SetComputeTexturePool(texturePool.Address.Pack(), texturePool.MaximumId); - TextureManager.SetComputeTextureBufferIndex(state.Get<int>(MethodOffset.TextureBufferIndex)); + state.Channel.TextureManager.SetComputeSamplerPool(samplerPool.Address.Pack(), samplerPool.MaximumId, qmd.SamplerIndex); + state.Channel.TextureManager.SetComputeTexturePool(texturePool.Address.Pack(), texturePool.MaximumId); + state.Channel.TextureManager.SetComputeTextureBufferIndex(state.Get<int>(MethodOffset.TextureBufferIndex)); ShaderProgramInfo info = cs.Shaders[0].Info; @@ -76,7 +76,7 @@ namespace Ryujinx.Graphics.Gpu.Engine continue; } - ulong cbDescAddress = BufferManager.GetComputeUniformBufferAddress(0); + ulong cbDescAddress = state.Channel.BufferManager.GetComputeUniformBufferAddress(0); int cbDescOffset = 0x260 + (cb.Slot - 8) * 0x10; @@ -84,14 +84,14 @@ namespace Ryujinx.Graphics.Gpu.Engine SbDescriptor cbDescriptor = _context.PhysicalMemory.Read<SbDescriptor>(cbDescAddress); - BufferManager.SetComputeUniformBuffer(cb.Slot, cbDescriptor.PackAddress(), (uint)cbDescriptor.Size); + state.Channel.BufferManager.SetComputeUniformBuffer(cb.Slot, cbDescriptor.PackAddress(), (uint)cbDescriptor.Size); } for (int index = 0; index < info.SBuffers.Count; index++) { BufferDescriptor sb = info.SBuffers[index]; - ulong sbDescAddress = BufferManager.GetComputeUniformBufferAddress(0); + ulong sbDescAddress = state.Channel.BufferManager.GetComputeUniformBufferAddress(0); int sbDescOffset = 0x310 + sb.Slot * 0x10; @@ -99,11 +99,11 @@ namespace Ryujinx.Graphics.Gpu.Engine SbDescriptor sbDescriptor = _context.PhysicalMemory.Read<SbDescriptor>(sbDescAddress); - BufferManager.SetComputeStorageBuffer(sb.Slot, sbDescriptor.PackAddress(), (uint)sbDescriptor.Size, sb.Flags); + state.Channel.BufferManager.SetComputeStorageBuffer(sb.Slot, sbDescriptor.PackAddress(), (uint)sbDescriptor.Size, sb.Flags); } - BufferManager.SetComputeStorageBufferBindings(info.SBuffers); - BufferManager.SetComputeUniformBufferBindings(info.CBuffers); + state.Channel.BufferManager.SetComputeStorageBufferBindings(info.SBuffers); + state.Channel.BufferManager.SetComputeUniformBufferBindings(info.CBuffers); var textureBindings = new TextureBindingInfo[info.Textures.Count]; @@ -121,7 +121,7 @@ namespace Ryujinx.Graphics.Gpu.Engine descriptor.Flags); } - TextureManager.SetComputeTextures(textureBindings); + state.Channel.TextureManager.SetComputeTextures(textureBindings); var imageBindings = new TextureBindingInfo[info.Images.Count]; @@ -141,10 +141,10 @@ namespace Ryujinx.Graphics.Gpu.Engine descriptor.Flags); } - TextureManager.SetComputeImages(imageBindings); + state.Channel.TextureManager.SetComputeImages(imageBindings); - TextureManager.CommitComputeBindings(); - BufferManager.CommitComputeBindings(); + state.Channel.TextureManager.CommitComputeBindings(); + state.Channel.BufferManager.CommitComputeBindings(); _context.Renderer.Pipeline.DispatchCompute( qmd.CtaRasterWidth, |
