You copied the Doc URL to your clipboard.

Attribute layout

For Bifrost and above architecture, vertices are shaded using an Index Driven Vertex Shading (IDVS) flow.

Prerequisites

You must understand the following concepts:

  • Vertices.
  • Vertex buffers.

IDVS vertex shading order

The order in which vertices are shaded using the IDVS are as follows:

  1. Positions.
  2. Varyings of vertices of primitives which have survived culling.

Good buffer layout maximizes the benefit of this geometry pipeline.

How to optimize the attribute layout

Try using the following optimization steps:

  • Use a dedicated, tightly packed, vertex buffer for position data.
  • Use a second dedicated vertex buffer for non-position data, if any exists.
  • Remove unused attributes for specific uses to optimize the meshes. For example: Generating a tightly packed buffer consisting of only position-related attributes for shadow mapping.

Attribute layout steps to avoid

Arm recommends that you:

  • Do not use one buffer per attribute as this wastes bandwidth by fetching data for culled vertices when they share a cache line with visible vertices.
  • Do not pad interleaved vertex buffer strides up to the power-of-two. Mali hardware does not require it, and doing so increases memory bandwidth.

The negative impacts of an inefficient attribute layout

Here are two potential problems that your application can experience:

  • Increased memory bandwidth due to redundant data fetches.
  • Increased pressure on caches which cause loss of performance.