diff options
author | Jeroen Bakker <jbakker> | 2022-08-23 15:26:01 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-08-23 15:35:39 +0300 |
commit | 37533cd6cb0fcd6e92906cfcec911330df27f52c (patch) | |
tree | ddbf044535261cba972bb32e5e945fdbd608ab76 /source/blender/nodes/shader | |
parent | 13b2716e1cf9447ebab2fcd4b157d6d232490334 (diff) |
ImBuf: Optimize GPU memory by using 1 component format for grayscale images
This is done by checking the number of bitplanes from the image buffer.
We assume that for float buffer to use the same bitplanes as it was a
byte buffer.
Then, the data of the image buffer is packed at the start of the `rect` or
`float_rect` before upload.
**Statistics - einar.v004.blend **
Note that not all grayscale textures have been stored as BW images so the
amount of memory that can be reduced would be more.
Without patch
```
104 Textures - 3294.99 MB (3294.47 MB over 32x32), 37 RTs - 192.52 MB.
Avg. tex dimension: 2201.88x1253.51 (2283.53x2202.13 over 32x32)
464 Buffers - 25.01 MB total 1.24 MB IBs 23.50 MB VBs.
3512.52 MB - Grand total GPU buffer + texture load
```
Patch applied
```
104 Textures - 2917.66 MB (2917.14 MB over 32x32), 39 RTs - 215.45 MB.
Avg. tex dimension: 2221.38x1252.75 (2323.28x2253.47 over 32x32)
467 Buffers - 25.01 MB total 1.24 MB IBs 23.51 MB VBs.
3158.13 MB - Grand total GPU buffer + texture load.
```
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15484
Diffstat (limited to 'source/blender/nodes/shader')
0 files changed, 0 insertions, 0 deletions