mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
Fix bug: copy-to-ram depth texture binding gets format set to RGB
This was a regression introduced by be8f4de33789cbb96551bb34b1ba85e7134d1e73 Fixes: #212
This commit is contained in:
parent
e4a817b469
commit
29f50be15e
@ -275,12 +275,21 @@ add_render_texture(Texture *tex, RenderTextureMode mode,
|
||||
|
||||
// Choose a default bitplane.
|
||||
if (plane == RTP_COUNT) {
|
||||
if (tex->get_format() == Texture::F_depth_stencil) {
|
||||
switch (tex->get_format()) {
|
||||
case Texture::F_depth_stencil:
|
||||
plane = RTP_depth_stencil;
|
||||
} else if (tex->get_format() == Texture::F_depth_component) {
|
||||
break;
|
||||
|
||||
case Texture::F_depth_component:
|
||||
case Texture::F_depth_component16:
|
||||
case Texture::F_depth_component24:
|
||||
case Texture::F_depth_component32:
|
||||
plane = RTP_depth;
|
||||
} else {
|
||||
break;
|
||||
|
||||
default:
|
||||
plane = RTP_color;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6455,6 +6455,18 @@ framebuffer_copy_to_ram(Texture *tex, int view, int z,
|
||||
}
|
||||
break;
|
||||
|
||||
case Texture::F_depth_component16:
|
||||
component_type = Texture::T_unsigned_short;
|
||||
break;
|
||||
|
||||
case Texture::F_depth_component24:
|
||||
component_type = Texture::T_unsigned_int;
|
||||
break;
|
||||
|
||||
case Texture::F_depth_component32:
|
||||
component_type = Texture::T_float;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (_current_properties->get_srgb_color()) {
|
||||
if (_current_properties->get_alpha_bits()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user