Page MenuHome

DRW: Move buffer & temp textures & framebuffer management to DrawManager
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Jul 19 2021, 7:47 PM.

Details

Summary

This is a necessary step for EEVEE's new arch. This moves more data
to the draw manager. This makes it easier to have the render or draw
engines manage their own data.

This makes more sense and cleans-up what the GPUViewport holds

Also rewrites the Texture pool manager to be in C++.

This also move the DefaultFramebuffer/TextureList and the engine related
data to a new DRWViewData struct. This struct manages the per view
(as in stereo view) engine data.

There is a bit of cleanup in the way the draw manager is setup.
We now use a temporary DRWData instead of creating a dummy viewport.

Diff Detail

Repository
rB Blender
Branch
draw-viewport-data
Build Status
Buildable 17540
Build 17540: arc lint + arc unit

Event Timeline

Clément Foucault (fclem) requested review of this revision.Jul 19 2021, 7:47 PM
Clément Foucault (fclem) created this revision.

Overall the changes seems fine and would move the data containers close to the code that is responsible for it (what of course is a good thing). I still want to perform stress testing.

source/blender/draw/intern/DRW_render.h
141

if index is managed by the draw manager we could wrap the DrawEngineType during registration with additional runtime data.
The index could be set during registration and stored in the wrapper. But that just hides it from here.

source/blender/draw/intern/draw_manager.c
116

Cleanup would be to use a struct to combine both globals. Can be done after this patch landed in master.

410

consider malloc if all items are set.

source/blender/draw/intern/draw_manager.h
541–544

would do this as part of this patch.

I did a test run and the change seems fine. We just need to go over the small clean ups.

As discussed last week I will continue with this patch.

  • Cleanup: Remove compiler warning and fix some comments
  • Merge branch 'master' into draw-viewport-data
  • Merge branch 'master' into draw-viewport-data
  • DRW: Fix implicit convertion warning on MSVC
  • Fix incorrect merge: missing function DRW_view_get_active.
  • Move index from DrawEngineType to DRWRegisteredDrawEngine.
  • Wrapped related global vars into struct.
source/blender/draw/intern/DRW_render.h
141

The index is constant during a blender session. We could add a wrapper around the
engine type when the engines are registered in DRW_engine_register

typedef struct DRWRegisteredEngine {
  DrawEngineType *draw_engine;
  int index;
} DRWRegisteredEngine;
source/blender/draw/intern/draw_manager.c
410

ubolen isn't set. So ignore comment.

Clément Foucault (fclem) added inline comments.
source/blender/draw/intern/draw_view_data.cc
55

Same here. I don't know if that's a new codestyle practice these days.

source/blender/draw/intern/draw_view_data.h
61

This comment is obsolete. DRW_engines does not exists anymore.

105

Maybe put the comment above the function?

This revision is now accepted and ready to land.Oct 4 2021, 5:07 PM
Jeroen Bakker (jbakker) marked 3 inline comments as done.
  • Merge branch 'master' into draw-viewport-data
  • Updated incorrect comments.