From 05cf72e22f054bdc97b53987f09ed3c494de82d9 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 10 Oct 2024 19:48:50 +0200 Subject: [PATCH] dxgsg9: Fix texture clear color not working for 3D textures --- panda/src/dxgsg9/dxTextureContext9.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/panda/src/dxgsg9/dxTextureContext9.cxx b/panda/src/dxgsg9/dxTextureContext9.cxx index d8cf04d89c..8d7411da09 100644 --- a/panda/src/dxgsg9/dxTextureContext9.cxx +++ b/panda/src/dxgsg9/dxTextureContext9.cxx @@ -2197,6 +2197,11 @@ fill_d3d_volume_texture_pixels(DXScreenData &scrn) { image_compression = Texture::CM_off; } + if (image.is_null() && tex->has_clear_color()) { + // Make an image, filled with the texture's clear color. + image = get_texture()->make_ram_image(); + } + if (image.is_null()) { // The texture doesn't have an image to load. That's ok; it might be a // texture we've rendered to by frame buffer operations or something.