Page MenuHome

DRW: Add DRW_gpu_wrapper.hh
ClosedPublic

Authored by Clément Foucault (fclem) on Jan 11 2022, 11:34 PM.

Details

Summary

This adds wrapper classes that make it easier to use GPU objects in C++.

Motivations:
  • Easier handling of GPU objects.
  • EEVEE rewrite already makes use of similar wrappers.
  • There is the ongoing effort to use more C++ in the codebase and lans to port more engines to it.
  • The shader code refactor will make use of many UBOs with shared struct declaration. This helps managing them.
  • Safer handling of TextureFromPool which can't be bound as normal texture (only texture ref) and can be better tracked in the future.
Considerations:
  • I chose the blender::draw namespace because blender::gpu already has private classes (i.e: gpu::Texture).
  • Theses are wrappers that manage a GPU object internally. They might be confused with actual Texture. However, the name TextureWrapper is a bit too much verbose in my opinion. I'm open to suggestion about better name.

Diff Detail

Repository
rB Blender

Event Timeline

Clément Foucault (fclem) requested review of this revision.Jan 11 2022, 11:34 PM
Clément Foucault (fclem) created this revision.
Clément Foucault (fclem) edited the summary of this revision. (Show Details)

Seems fine. Would suggest to move it eventually to gpu module as well. Perhaps inside a different namespace (blender::gpu::wrappers).

This revision is now accepted and ready to land.Jan 12 2022, 11:18 AM
This revision was automatically updated to reflect the committed changes.