Cubemaps loaded in separate thread cause the visual glicth on QFusion engine

Hello there. I’m tester of Warsow game, it uses QFusion engine, which is availiable at github. Our main Developer have introduced asynchronous texture loader feature. Everything seems fine, except one thing, it causes visual glitches on cubemaps. Here is few sreenshots with what I’ve got and what should be:

I’ve tested a few machines with Nvidia gfx card installed:

  1. Kubuntu 14.04, Home PC, Intel Core i5-2320 4x cores @ 3.00 GHz, 8 GB RAM, GeForce GTX 650.
  2. Kubuntu 14.04, Lenovo B590 Laptop, Intel Core i3-2348M 2x cores @ 2,3, 4 GB RAM, GeForce 610M.

Glitch exists since 304.121 (legacy) till 340.17 (latest beta) drvier versions. 304.117 doesn’t have it. AMD/Intel gfx cards don’t have it too.

Steps to reproduce:

  1. Download and unpack latest Warsow version.
  2. Start the game by using “warsow” file in the “warsow_15” folder.
  3. Open game console by using “~” and type “r_multithreading 1”, press Enter, then type “vid_restart” and press Enter again. (Since there is a glicth, this asynchronous texture loader feature isn’t turned on by default)
  4. Start a game by using “New game” - “Local game” - “Start a game”. Or by using game console: “map wdm5”.
  5. Find any armor/ammo boxes.

Notes:

  1. Windows 7’s drivers don’t have that glicth
  2. Glitch looks differently after every “vid_restart” (restarting graphics).
  3. Glitch goes away after changing map until the next game start.
  4. Glitch goes away until the next game start if cg_forceTeamPlayerTeamBeta is “1” and some player’s models are loaded. Here is a video: http://www.youtube.com/watch?v=D16x5-MAd9g

P.S. nvidia-bug-report.log.gz file

Another texture (or 0) must be bound to the loaded texture’s target after the loading, and as far as I know, that’s the standard behavior. I added glBindTexture(GL_TEXTURE_CUBE_MAP, 0) after the loading, and the issue is gone.