Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetCounterValue(uint)

Sets counter value of append/consume buffer.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public void SetCounterValue(uint counterValue)

Parameters

counterValue

Value of the append/consume counter.

Remarks

Append/consume and counter buffers (see ComputeBufferType.Append, ComputeBufferType.Counter) keep track of the number of elements in them with a special counter variable. SetCounterValue explicitly sets the counter value.
This can be used to reset the counter or to set it to a specific value.
Note: SetCounterValue can not be called while the buffer is bound via Graphics.SetRandomWriteTarget.