public static SharpDX.Direct3D11.ResourceUsage Convert(Graphics.ResourceUsage usage) { SharpDX.Direct3D11.ResourceUsage f; if (!resourceUsages.TryGetValue(usage, out f)) { throw new NotSupportedException("Buffer usage not supported."); } return(f); }
public static CpuAccessFlags ConvertToAccessFlag(Graphics.ResourceUsage usage) { CpuAccessFlags accessFlag; if (!accessFlags.TryGetValue(usage, out accessFlag)) { throw new NotImplementedException(); } return(accessFlag); }
public IConstantBuffer CreateConstantBuffer(string name, Graphics.ResourceUsage usage) { if (name == null) { throw new ArgumentNullException("name"); } int size; if (!constantBufferSizes.TryGetValue(name, out size)) { throw new ArgumentException("Constant buffer not bound to shader.", "name"); } return(graphicsDevice.Factory.CreateConstantBuffer(size, usage)); }
public IConstantBuffer CreateConstantBuffer(Graphics.ResourceUsage usage) { return(CreateConstantBuffer("$Globals", usage)); }