mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
0b42d0b6e72547f0d8b2fa4bdb3837aeb4901009
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]>
FreeSpace2 Source Code Project
Building
Before you do anything, make sure you have updated your git submodules, either by running git submodule update --init --recursive or by cloning the repository with the --recursive flag.
The main instructions for building can be found at our github wiki, on the Building page.
Releases
1
Release release_26_2_0
Latest
Languages
C++
75.7%
C
22%
CMake
1%
HTML
0.5%
Objective-C++
0.3%
Other
0.2%