using System.Collections.Generic; namespace Ryujinx.Graphics.Shader.StructuredIr { class ShaderProperties { private readonly Dictionary _constantBuffers; private readonly Dictionary _storageBuffers; private readonly Dictionary _localMemories; private readonly Dictionary _sharedMemories; public IReadOnlyDictionary ConstantBuffers => _constantBuffers; public IReadOnlyDictionary StorageBuffers => _storageBuffers; public IReadOnlyDictionary LocalMemories => _localMemories; public IReadOnlyDictionary SharedMemories => _sharedMemories; public ShaderProperties() { _constantBuffers = new Dictionary(); _storageBuffers = new Dictionary(); _localMemories = new Dictionary(); _sharedMemories = new Dictionary(); } public void AddConstantBuffer(int binding, BufferDefinition definition) { _constantBuffers[binding] = definition; } public void AddStorageBuffer(int binding, BufferDefinition definition) { _storageBuffers[binding] = definition; } public int AddLocalMemory(MemoryDefinition definition) { int id = _localMemories.Count; _localMemories.Add(id, definition); return id; } public int AddSharedMemory(MemoryDefinition definition) { int id = _sharedMemories.Count; _sharedMemories.Add(id, definition); return id; } } }