X Tutup
Skip to content

Fix warning spam in Compatibility when using depth texture#111234

Merged
clayjohn merged 1 commit intogodotengine:masterfrom
Kaleb-Reid:compat-fix-depth-scaling
Oct 6, 2025
Merged

Fix warning spam in Compatibility when using depth texture#111234
clayjohn merged 1 commit intogodotengine:masterfrom
Kaleb-Reid:compat-fix-depth-scaling

Conversation

@Kaleb-Reid
Copy link
Contributor

@Kaleb-Reid Kaleb-Reid commented Oct 3, 2025

Using the depth texture in Compatibility at the same time as 3d scaling causes a warning spam. The depth texture still seems to work though, it must be getting set up again elsewhere.

Whether 3d scaling is on or off changes the code path for setting up the buffers:

if (rb->get_scaling_3d_mode() == RS::VIEWPORT_SCALING_3D_MODE_OFF) {
texture_storage->check_backbuffer(rt, scene_state.used_screen_texture, scene_state.used_depth_texture); // note, badly names, this just allocates!
size = rt->size;
backbuffer_fbo = rt->backbuffer_fbo;
backbuffer = rt->backbuffer;
backbuffer_depth = rt->backbuffer_depth;
} else {
rb->check_backbuffer(scene_state.used_screen_texture, scene_state.used_depth_texture);
size = rb->get_internal_size();
backbuffer_fbo = rb->get_backbuffer_fbo();
backbuffer = rb->get_backbuffer();
backbuffer_depth = rb->get_backbuffer_depth();
}
This pr just copies the same type value found in the other code path when using GL_DEPTH_STENCIL:
if (rt->depth_has_stencil) {
internal_format = GL_DEPTH24_STENCIL8;
format = GL_DEPTH_STENCIL;
type = GL_UNSIGNED_INT_24_8;
attachment = GL_DEPTH_STENCIL_ATTACHMENT;
element_size = 4;
Aside from this one value all of the others are already the same, so I am assuming that this was a mistake in the first place.

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Indeed that is the same type used everywhere else we create depth buffers

@clayjohn clayjohn added this to the 4.6 milestone Oct 4, 2025
@clayjohn clayjohn merged commit 60b7b8b into godotengine:master Oct 6, 2025
20 checks passed
@Kaleb-Reid Kaleb-Reid deleted the compat-fix-depth-scaling branch October 6, 2025 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup