bopti: fix bug in non-zero stride renders

Forgot to take into account the number of layers in the input
stride. Anything after the first line would be pretty much
garbage.
This commit is contained in:
lephe 2019-08-06 16:17:25 +02:00
parent 2e17b77e56
commit ab0fa06a1d
1 changed files with 3 additions and 2 deletions

View File

@ -153,6 +153,7 @@ void bopti_render(image_t const *img, struct rbox *rbox, uint32_t *v1,
/* Number of layers per profile */
int layer_count[] = { 1, 2, 2, 3 };
int layers = layer_count[img->profile];
/* For each pair of consecutive VRAM elements involved, create a mask
from the intersection of the standard vram mask with the shift-mask
@ -180,7 +181,7 @@ void bopti_render(image_t const *img, struct rbox *rbox, uint32_t *v1,
/* Interwoven layer data. Skip left columns that are not rendered */
const uint32_t *layer = (void *)img->data;
layer += rbox->top * img_columns * layer_count[img->profile];
layer += rbox->top * img_columns * layers;
layer += rbox->left * layer_count[img->profile];
/* Number of grid columns */
@ -196,7 +197,7 @@ void bopti_render(image_t const *img, struct rbox *rbox, uint32_t *v1,
.masks = masks + 2 * left_origin,
.real_start = (left_origin > 0),
.vram_stride = 4 - columns,
.data_stride = (img_columns - columns) << 2,
.data_stride = ((img_columns - columns) << 2) * layers,
.gray = (v2 != NULL),
.asm_void = bopti_asm,
};