mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
[vulkan] Don't lose other sky cube faces
Because LoadImage uses Hunk_TempAlloc, the face images need to be copied individually. Really, what's neeeded is to be able to load the image data into a pre-allocated buffer (ideally, the staging buffer for vulkan, but that's for later).
This commit is contained in:
parent
40aa629ef8
commit
52168da93e
1 changed files with 7 additions and 1 deletions
|
@ -1630,12 +1630,18 @@ Vulkan_LoadSkys (const char *sky, vulkan_ctx_t *ctx)
|
|||
continue;
|
||||
}
|
||||
}
|
||||
sides[i] = tex;
|
||||
//FIXME find a better way (also, assumes data and struct together)
|
||||
sides[i] = malloc (ImageSize (tex, 1));
|
||||
memcpy (sides[i], tex, ImageSize (tex, 1));
|
||||
sides[i]->data = (byte *)(sides[i] + 1);
|
||||
Sys_MaskPrintf (SYS_vulkan, "Loaded %s\n", name);
|
||||
}
|
||||
if (!failed) {
|
||||
bctx->skybox_tex = Vulkan_LoadEnvSides (ctx, sides, sky);
|
||||
}
|
||||
for (i = 0; i < 6; i++) {
|
||||
free (sides[i]);
|
||||
}
|
||||
}
|
||||
if (bctx->skybox_tex) {
|
||||
Sys_MaskPrintf (SYS_vulkan, "Skybox %s loaded\n", sky);
|
||||
|
|
Loading…
Reference in a new issue