onox / orka

The OpenGL 4.6 Rendering Kernel in Ada 2022
https://orka-engine.netlify.com/
Apache License 2.0
61 stars 2 forks source link

Remove vertex formats #60

Closed onox closed 4 years ago

onox commented 4 years ago

Remove package Orka.Rendering.Vertex_Formats. Defining input layouts with VAOs provide no better performance than programmatic vertex pulling on AMD and recent Nvidia GPUs. Only on Intel they provide slightly better performance when the rendering is bounded by the vertex shader.

With VAOs, there are 3 things that need to match each other:

  1. The vertex data itself
  2. The vertex format of the VAO
  3. The attributes in the vertex shader

Without VAOs, only the attributes need to be pulled correctly from the vertex data .

Because the core profile of OpenGL always requires a VAO to be bound, create and bind 1 VAO after making the context current.