1

ID3D11DeviceContext::DrawIndexed() has a parameter StartIndexLocation, which adds a value to each Index when drawing.

What happens if I use 16 bit Indices ?

The highest value 16 bit can represent is 65535. What If my Draw Call has 10000 vertices and I use a StartIndexLocation of 65000 ? Will it invoke UB?

Acorn
  • 24,970
  • 5
  • 40
  • 69
Raildex
  • 3,406
  • 1
  • 18
  • 42
  • 2
    But the parameters are 32 bit UINT, so your 16 bit values will be promoted to 32 bit before addition happens – mateeeeeee Mar 03 '22 at 10:05

1 Answers1

1

StartIndexLocation is not a byte-position, but an Index position. Cross reference DirectX Index Buffer -> Start of Index Buffer

So the maximum StartIndexLocation is not related to the stride of the Index Buffer.

PhillipH
  • 6,182
  • 1
  • 15
  • 25