Fusion.Drivers.Graphics.GraphicsDevice.SetCSRWBuffer C# (CSharp) Method

SetCSRWBuffer() public method

public SetCSRWBuffer ( int register, StructuredBuffer buffer, int initialCount = -1 ) : void
register int
buffer StructuredBuffer
initialCount int An array of append and consume buffer offsets. /// A value of -1 indicates to keep the current offset. /// Any other values set the hidden counter for that appendable and consumable UAV.
return void
		public void SetCSRWBuffer ( int register, StructuredBuffer buffer, int initialCount = -1 ) 
		{ 
			if (register>8) {
				throw new GraphicsException("Could not bind RW buffer at register " + register.ToString() + " (max 8)");
			}

			lock (deviceContext) {
				DeviceContext.ComputeShader.SetUnorderedAccessView( register, buffer==null?null:buffer.UAV, initialCount ); 
			}
		}