Page MenuHome

GPUViewport: Use GPUBatch for viewport drawing
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Apr 7 2020, 9:51 AM.

Details

Summary

When drawing the viewport to the screen the draw calls were not batched.
This resulted in measurable slowdown on Windows Intel 10th gen
platforms.

This patch would cache the last draw calls per viewport. Our API does
support partial redrawing of the viewport, but that isn't used anywhere.

This patch does not include stereoscopy rendering. This still uses the
imm approach and would still be slow on certain hardware.

Diff Detail

Repository
rB Blender

Event Timeline

source/blender/gpu/intern/gpu_viewport.c
77

format and attr_id could be stored globally.

To be honnest I think just using the model matrix for this kind of stuff would be better but, if I remember correctly, OCIO implementation (and UV image editor to be precise) is getting in the way for this.

So your approach is ok but I would leave a comment that the end goal would be to draw without having a dedicated batch.

source/blender/gpu/intern/gpu_viewport.c
71

why would it be specific to CM? I would use one batch for all.

118

dont use plural here

681

use copy_v2_fl2

Jeroen Bakker (jbakker) marked 3 inline comments as done.

Solved comments from code review

This revision is now accepted and ready to land.Apr 9 2020, 4:48 PM
This revision is now accepted and ready to land.Apr 14 2020, 9:05 AM
Jeroen Bakker (jbakker) requested review of this revision.Apr 14 2020, 9:05 AM
  • GPUViewport: Use GPUBatch for viewport drawing
  • Fix crash when binding colormanagement shader.
This revision is now accepted and ready to land.Apr 14 2020, 9:18 PM