[Curiosity] Dont draw indexed with type unaligned pointer

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

[Curiosity] Dont draw indexed with type unaligned pointer

Post by devsh »

I just spent a few days playing with vertices and indices sitting in the same buffer, and I found out that glDrawElements does not work if you use an unaligned offset for the indices.

For example, you use 32BIT indices and the offset for the index list in the buffer is 10 (not 4byte aligned).

This results in:
Best Case: Nothing shows on screen
Worst Case: The driver and GPU freezes, goes into overdrive, the OS hangs, you brick the computer and need a hard reboot

This should really be mentioned in the OpenGL spec.
Post Reply