Files
fs2open.github.com/code
dustinspace217andDustinspace217 0b42d0b6e7 Vulkan: upload a mission's environment map as a cubemap (#7934)
Under Vulkan a mission's $Environment Map was never uploaded: the
irradiance and lighting passes only use ENVMAP when its texture slot
already has an image view, and nothing created one for a bitmap that was
only bm_load'ed. OpenGL uploads it the first time it binds it as a
cubemap.

Add VulkanTextureManager::ensureCubemapUploaded(), called from both
passes. It locks the map the way OpenGL does for TCACHE_TYPE_CUBEMAP.
The lock uploads through bm_data(), which now sends uncompressed DDS
cubemaps (bm_is_compressed() returns 0 for them; comp_type identifies
them) to uploadCubemap() as DXT ones already went. If the slot still
holds no cube after the lock, because the data was already resident, it
uploads it directly. A map that cannot be used is remembered by bitmap
signature (handles are reused across missions) and warned about once in
debug builds, and the irradiance pass is skipped instead of sampling a
non-cube view.

uploadCubemap() also assumed uncompressed cubemaps had one mip level and
read the six faces back to back. DDS stores face0[mip0..mipN],
face1[...], so faces 1-5 read the tail of face 0's mip chain. It now
uses the file's mip count, expands 24-bit data over the whole chain,
generates a chain for a one-level uncompressed cubemap as OpenGL does
(the lighting pass samples by roughness), copies mip 0 for every array
layer, cleans up the image when the staging map fails, and clears
isCubemap as soon as it retires the old image.

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:18:40 +01:00
..
2026-04-30 00:35:19 -04:00
2026-07-20 23:04:56 -04:00
2026-11-02 22:40:54 -05:00
2026-07-23 15:52:27 +02:00
2018-07-15 19:37:24 +02:00
2026-07-23 15:52:27 +02:00
2026-07-23 15:52:27 +02:00
2025-08-18 11:59:22 -04:00
2026-09-12 03:57:27 +00:00
2026-05-12 11:31:20 -04:00
2026-05-28 14:43:48 +09:00
2026-04-30 00:35:19 -04:00
2026-11-02 22:40:54 -05:00
2026-09-08 10:48:13 -04:00
2026-07-20 23:04:56 -04:00
2026-11-04 01:16:41 -05:00
2026-07-23 15:52:27 +02:00
2026-07-23 15:52:27 +02:00
2026-11-04 01:16:41 -05:00
2026-11-04 01:16:41 -05:00
2026-07-23 15:52:27 +02:00