mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 13:20:43 +00:00
Merge pull request #593 from tobiasjakobi/master
video_lima: alignment changes
This commit is contained in:
commit
4672afd5ce
@ -289,12 +289,12 @@ static const void *make_contiguous(limare_data_t *pdata,
|
|||||||
|
|
||||||
/* Enlarge our buffer, if it is currently too small. */
|
/* Enlarge our buffer, if it is currently too small. */
|
||||||
if (pdata->buffer_size < full_pitch * height) {
|
if (pdata->buffer_size < full_pitch * height) {
|
||||||
const unsigned aligned_size = align_common(full_pitch * height, 4);
|
const unsigned aligned_size = align_common(full_pitch * height, 16);
|
||||||
|
|
||||||
free(pdata->buffer);
|
free(pdata->buffer);
|
||||||
pdata->buffer = NULL;
|
pdata->buffer = NULL;
|
||||||
|
|
||||||
posix_memalign(&pdata->buffer, 4, aligned_size);
|
posix_memalign(&pdata->buffer, 16, aligned_size);
|
||||||
if (pdata->buffer == NULL) {
|
if (pdata->buffer == NULL) {
|
||||||
RARCH_ERR("video_lima: failed to allocate buffer to make pixel data contiguous\n");
|
RARCH_ERR("video_lima: failed to allocate buffer to make pixel data contiguous\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -507,12 +507,12 @@ static void lima_render_msg(lima_video_t *vid, const char *msg) {
|
|||||||
req_size = lima->font_width * lima->font_height * 2;
|
req_size = lima->font_width * lima->font_height * 2;
|
||||||
|
|
||||||
if (lima->buffer_size < req_size) {
|
if (lima->buffer_size < req_size) {
|
||||||
const unsigned aligned_size = align_common(req_size, 4);
|
const unsigned aligned_size = align_common(req_size, 16);
|
||||||
|
|
||||||
free(lima->buffer);
|
free(lima->buffer);
|
||||||
lima->buffer = NULL;
|
lima->buffer = NULL;
|
||||||
|
|
||||||
posix_memalign(&lima->buffer, 4, aligned_size);
|
posix_memalign(&lima->buffer, 16, aligned_size);
|
||||||
if (lima->buffer == NULL) {
|
if (lima->buffer == NULL) {
|
||||||
RARCH_ERR("video_lima: failed to allocate buffer to render fonts\n");
|
RARCH_ERR("video_lima: failed to allocate buffer to render fonts\n");
|
||||||
return;
|
return;
|
||||||
@ -597,8 +597,8 @@ static void *lima_gfx_init(const video_info_t *video, const input_driver_t **inp
|
|||||||
|
|
||||||
lima->screen_aspect = get_screen_aspect(lima->state);
|
lima->screen_aspect = get_screen_aspect(lima->state);
|
||||||
|
|
||||||
lima->font_height = 360;
|
lima->font_height = 368;
|
||||||
lima->font_width = align_common((unsigned)(lima->screen_aspect * (float)lima->font_height), 4);
|
lima->font_width = align_common((unsigned)(lima->screen_aspect * (float)lima->font_height), 16);
|
||||||
|
|
||||||
lima->upload_format = video->rgb32 ?
|
lima->upload_format = video->rgb32 ?
|
||||||
LIMA_TEXEL_FORMAT_RGBA_8888 : LIMA_TEXEL_FORMAT_BGR_565;
|
LIMA_TEXEL_FORMAT_RGBA_8888 : LIMA_TEXEL_FORMAT_BGR_565;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user