Skip to content
Permalink
Browse files

glgsg: fix RTM_copy_ram for multiview textures

  • Loading branch information
rdb committed Nov 10, 2019
1 parent 6fd6623 commit cb01d45eb6db76913d84bce7a365fca8fefb5714
Showing with 11 additions and 4 deletions.
  1. +11 −4 panda/src/glstuff/glGraphicsStateGuardian_src.cxx
@@ -7196,15 +7196,21 @@ framebuffer_copy_to_ram(Texture *tex, int view, int z,
z_size = 1;
}

int num_views = tex->get_num_views();
if (tex->get_x_size() != w || tex->get_y_size() != h ||
tex->get_z_size() != z_size ||
tex->get_component_type() != component_type ||
tex->get_format() != format ||
tex->get_texture_type() != texture_type) {
tex->get_texture_type() != texture_type ||
view >= num_views) {

tex->setup_texture(texture_type, w, h, z_size, component_type, format);

// Re-setup the texture; its properties have changed.
tex->setup_texture(texture_type, w, h, z_size,
component_type, format);
// The above resets the number of views to 1, so set this back.
num_views = std::max(view + 1, num_views);
if (num_views > 1) {
tex->set_num_views(num_views);
}
}

nassertr(z < tex->get_z_size(), false);
@@ -7276,6 +7282,7 @@ framebuffer_copy_to_ram(Texture *tex, int view, int z,
}
if (view > 0) {
image_ptr += (view * tex->get_z_size()) * image_size;
nassertr(view < tex->get_num_views(), false);
}
}

0 comments on commit cb01d45

Please sign in to comment.
You can’t perform that action at this time.