Commit edf38ba
authored
headless_renderer example overallocates Buffer. (#24005)
# Objective
headless_renderer example over allocates the Buffer
`RenderDevice::align_copy_bytes_per_row` takes bytes per row, the
example is passing pixels - then multiplying the padded result by bytes
per pixel.
So it allocates 8192 bytes per row instead of 7680.
## Solution
Multiply pixels per row by bytes per pixel and pass that to
`align_copy_bytes_per_row`
## Testing
- Did you test these changes? If so, how?
Ran the example with various pixel widths.
The over allocation doesn't affect the rendered output because the other
call to `align_copy_bytes_per_row` in `update` is correct, so we
properly extract the image from the padded buffer.1 parent 8d88f59 commit edf38ba
1 file changed
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | | - | |
294 | | - | |
| 292 | + | |
295 | 293 | | |
296 | 294 | | |
297 | 295 | | |
| |||
0 commit comments