Version: 2022.3
LanguageEnglish
  • C#

GraphicsBuffer.Target.Index

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

GraphicsBuffer can be used as an index buffer.

Allows a buffer to be used as an index buffer for Graphics.DrawProcedural and similar low level drawing APIs.

When you construct a GraphicsBuffer of this type, the value of stride must be either 2 (16-bit indices) or 4 (32-bit indices).

DirectX 11 does not allow Index buffers to also be Structured. For compute shader mesh data access with DirectX 11 compatibility, it is best to use Raw.

Additional resources: Graphics.RenderPrimitivesIndexed, Graphics.RenderPrimitivesIndexedIndirect, CommandBuffer.DrawProcedural, CommandBuffer.DrawProceduralIndirect, Mesh.indexBufferTarget, Mesh.GetIndexBuffer.