Page MenuHome

Optimization: Double uniform names buffer size
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on May 21 2019, 4:16 PM.

Details

Summary

Adding a constant yields quadratic time complexity which can
have quite a big impact on some scenes.

I used the file from T64901 for testing.

In the test file, the time it took to execute wm_draw_update
changed from 0.60s to 0.51s.

Maybe there is another bug, that caused the buffer to get
very large in the first place though. Not sure if that is
expected to happen. In any case, it would be good to get
rid of this quadratic behavior.

Diff Detail

Repository
rB Blender

Event Timeline

source/blender/draw/intern/draw_manager_data.c
145

I think we have to ensure that it increases the buffer size by at least len?

source/blender/draw/intern/draw_manager_data.c
145

Not sure if there are other limitations that make uniform names always small than 64. However, I agree. Will update the patch.

  • ensure new buffer always has at least len unused bytes

Forgot the * 2? Otherwise looks good.

Forgot the * 2? Otherwise looks good.

No, I'm adding the length to itself, which is the equivalent to *2.

This revision is now accepted and ready to land.May 21 2019, 4:53 PM
This revision was automatically updated to reflect the committed changes.

This name buffer is meant to be used only once. Then the uniforms should already be in the shader interface. If the buffer keeps being used there is a problem.