glgsg: fix framebuffer_copy_to_ram format for float framebuffers

This commit is contained in:
rdb 2018-12-19 12:43:39 +01:00
parent 8dcb735f2b
commit 840f28ef18
1 changed files with 15 additions and 1 deletions

View File

@ -7049,6 +7049,16 @@ framebuffer_copy_to_ram(Texture *tex, int view, int z,
} else {
format = Texture::F_srgb;
}
} else if (_current_properties->get_float_color()) {
if (_current_properties->get_alpha_bits()) {
format = Texture::F_rgba32;
} else if (_current_properties->get_blue_bits()) {
format = Texture::F_rgb32;
} else if (_current_properties->get_green_bits()) {
format = Texture::F_rg32;
} else {
format = Texture::F_r32;
}
} else {
if (_current_properties->get_alpha_bits()) {
format = Texture::F_rgba;
@ -7058,7 +7068,11 @@ framebuffer_copy_to_ram(Texture *tex, int view, int z,
}
if (_current_properties->get_float_color()) {
component_type = Texture::T_float;
} else if (_current_properties->get_color_bits() <= 24) {
} else if (_current_properties->get_color_bits() <= 24
&& _current_properties->get_red_bits() <= 8
&& _current_properties->get_green_bits() <= 8
&& _current_properties->get_blue_bits() <= 8
&& _current_properties->get_alpha_bits() <= 8) {
component_type = Texture::T_unsigned_byte;
} else {
component_type = Texture::T_unsigned_short;