Page MenuHome

GPU Matrix API: stick to a single 4x4 matrix stick for 2D and 3D
ClosedPublic

Authored by Dalai Felinto (dfelinto) on Apr 14 2017, 2:47 PM.

Details

Summary

This patch is made of three patches:

  • Use only 3d matrices
  • Removing Matrix 2D storage entirely
  • Removing gpuBegin/End functions

You can read a related discussion on:
https://lists.blender.org/pipermail/bf-committers/2017-April/048301.html

And if you build with core profile and this patch you get:

(the text glitch is an unrelated issue).

Diff Detail

Repository
rB Blender
Branch
temp-gpu-matrix-3d
Build Status
Buildable 566
Build 566: arc lint + arc unit

Event Timeline

Agreed, the fewer modes and states we need to keep track of the better.

This revision is now accepted and ready to land.Apr 14 2017, 3:19 PM
  • Fixup on "Use only 3d matrices"

This patch rejects a fundamental change I've been trying to make -- that 2D is different from 3D and deserves its own best implementation.

What I like about this patch:

  • it makes our matrix API closer to old familiar OpenGL
  • user code doesn't need to setup/teardown <-- best part
  • code is shorter

That's about it!

If my fellow devs prefer this unified matrix stack (focused on 3D) then let's use it. I can express these ideas about 2D graphics outside of Blender.

Tested on Mac, land it!

I do not know much about this API but ... using matrix3D like 2D does not seem very efficient :\

On the other hand, simplifying the code is always desirable

Landed on rBcb2c4bfb74ca7f385bbd8d7c3445a49a2d1b7b8d . Thanks everyone for the feedback and the positive attitude, really.