From d80d6bc92081e3b291d2f0f37214ce99da495140 Mon Sep 17 00:00:00 2001 From: Dustinspace217 Date: Sat, 17 Oct 2026 00:26:32 -0700 Subject: [PATCH] Pass each streamed EFF frame's own bit depth to gr_update_texture generic_render_eff_stream told the renderer every streamed EFF frame was 32 bpp. Frames from uncompressed 24-bit DDS, JPG or 24-bit TGA files keep 3 bytes per pixel after locking. OpenGL takes the depth from the texture and was unaffected, but Vulkan trusted the 32 and copied 4 bytes per pixel: the animation was drawn as garbage and the copy read past the end of the frame's buffer. HUD-colored animations still pass 8. --- code/graphics/generic.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/graphics/generic.cpp b/code/graphics/generic.cpp index aae13a8a0d0..776b5c35556 100644 --- a/code/graphics/generic.cpp +++ b/code/graphics/generic.cpp @@ -376,8 +376,10 @@ void generic_render_eff_stream(generic_anim *ga) if(bm_reload(ga->eff.next_frame, frame_name) == ga->eff.next_frame) { bitmap* next_frame_bmp = bm_lock(ga->eff.next_frame, bpp, (bpp==8)?BMP_AABITMAP:BMP_TEX_NONCOMP, true); + // the frame's data keeps its own depth (24-bit DDS, JPG, TGA), which renderers need to read it + const int frame_bpp = (bpp == 8) ? bpp : next_frame_bmp->bpp; if(next_frame_bmp->data) - gr_update_texture(ga->bitmap_id, bpp, (ubyte*)next_frame_bmp->data, ga->width, ga->height); + gr_update_texture(ga->bitmap_id, frame_bpp, (ubyte*)next_frame_bmp->data, ga->width, ga->height); bm_unlock(ga->eff.next_frame); bm_unload(ga->eff.next_frame, 0, true); if (ga->current_frame == ga->num_frames-1)