halflife
halflife copied to clipboard
[CS] [CZ] [Goldsrc] "GL_Upload16:" Game crash
I tested it in both beta and out-of-beta CS and CZ.. It's about a custom model, but the behavior it's giving is so weird that I wanted to report it..
So let's say your download this model:
v_awp (no po2 support).zip
It's an awp model port from CSGO with some UV chopping for higher-res look. Textures are mostly not in PO2 but they're all under the 512p cap.
So you add this to _custom folder and launch the game. Load any map you want and when the loading screen hits "Precaching resources" the game crashes with this message appearing:

However, if you installed this version of the model which is the same previous model but with PO2 texture size: v_awp (with po2 support).zip The game loads correctly without issues in-game.
PC Specs generated by speccy: -Operating System: Windows 7 Professional 32-bit SP1
-CPU: Intel Mobile Core 2 Duo T5870 @ 2.00GHZ Merom 65nm Technology Caches L1 Data Cache Size 2 x 32 KBytes L1 Instructions Cache Size 2 x 32 KBytes L2 Unified Cache Size 2048 KBytes
-RAM: 3.00GB Dual-Channel DDR2 @ 398MHz (6-6-6-18) -Motherboard: Dell Inc. 047MWF (Microprocessor)
-Graphics: Generic PnP Monitor (1366x768@60Hz) Intel Mobile Intel 4 Series Express Chipset Family (Dell)- VRAM: 1326MB
-Storage: 232GB Western Digital WDC WD2500BEVT-75ZCT2 ATA Device (SATA)
Some of the textures used by the model are > 128 pixels wide or tall so NPOT rescaling is ignored either way, and GL_Upload16 has a fatal error test for sizes that aren't multiples of 8.
The code originates from this Quake code: https://github.com/id-Software/Quake/blob/bf4ac424ce754894ac8f1dae6a3981954bc9852d/WinQuake/gl_draw.c#L1211-L1212
As you can see when looking at the rest of the function there is code to successfully upload such a texture if it is alpha tested, so maybe reworking the code to always use that path could solve this problem. Converting it to RGBA32 isn't exactly expensive anymore, and eliminating a fatal error is always nice.
Thanks for help! Now i fix my texture :)