Skip to content

Commit 7080bc2

Browse files
Northfearslouken
authored andcommitted
Fallback to SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE if CDRAM texture allocation fails
1 parent 512355d commit 7080bc2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/render/vitagxm/SDL_render_vita_gxm_tools.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,18 @@ create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, Sc
10271027
&texture->data_UID
10281028
);
10291029

1030+
/* Try SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE in case we're out of VRAM */
1031+
if (!texture_data) {
1032+
SDL_LogWarn(SDL_LOG_CATEGORY_RENDER, "CDRAM texture allocation failed\n");
1033+
texture_data = mem_gpu_alloc(
1034+
SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE,
1035+
tex_size,
1036+
SCE_GXM_TEXTURE_ALIGNMENT,
1037+
SCE_GXM_MEMORY_ATTRIB_READ | SCE_GXM_MEMORY_ATTRIB_WRITE,
1038+
&texture->data_UID
1039+
);
1040+
}
1041+
10301042
if (!texture_data) {
10311043
free(texture);
10321044
return NULL;

0 commit comments

Comments
 (0)