Browse Source

depth_component support to dxgsg

rdb 17 years ago
parent
commit
454dca9dfe

+ 2 - 0
panda/src/dxgsg8/wdxGraphicsBuffer8.cxx

@@ -256,6 +256,7 @@ rebuild_bitplanes() {
   for (int i=0; i<count_textures(); i++) {
   for (int i=0; i<count_textures(); i++) {
     if (get_rtm_mode(i) == RTM_bind_or_copy) {
     if (get_rtm_mode(i) == RTM_bind_or_copy) {
       if ((get_texture(i)->get_format() != Texture::F_depth_stencil)&&
       if ((get_texture(i)->get_format() != Texture::F_depth_stencil)&&
+          (get_texture(i)->get_format() != Texture::F_depth_component)&&
           (color_tex_index < 0)) {
           (color_tex_index < 0)) {
         color_tex_index = i;
         color_tex_index = i;
       } else {
       } else {
@@ -420,6 +421,7 @@ select_cube_map(int cube_map_index) {
   for (int i=0; i<count_textures(); i++) {
   for (int i=0; i<count_textures(); i++) {
     if (get_rtm_mode(i) == RTM_bind_or_copy) {
     if (get_rtm_mode(i) == RTM_bind_or_copy) {
       if ((get_texture(i)->get_format() != Texture::F_depth_stencil)&&
       if ((get_texture(i)->get_format() != Texture::F_depth_stencil)&&
+          (get_texture(i)->get_format() != Texture::F_depth_component)&&
           (color_tex_index < 0)) {
           (color_tex_index < 0)) {
         color_tex_index = i;
         color_tex_index = i;
       } else {
       } else {

+ 2 - 0
panda/src/dxgsg9/dxTextureContext9.cxx

@@ -2127,6 +2127,8 @@ get_bits_per_pixel(Texture::Format format, int *alphbits) {
   case Texture::F_rgba5:
   case Texture::F_rgba5:
     *alphbits = 1;
     *alphbits = 1;
     return 16;
     return 16;
+  case Texture::F_depth_component:
+    return 16;
   case Texture::F_depth_stencil:
   case Texture::F_depth_stencil:
     return 32;
     return 32;
   case Texture::F_rgb5:
   case Texture::F_rgb5:

+ 1 - 0
panda/src/dxgsg9/wdxGraphicsBuffer9.cxx

@@ -594,6 +594,7 @@ select_cube_map(int cube_map_index) {
   for (int i=0; i<count_textures(); i++) {
   for (int i=0; i<count_textures(); i++) {
     if (get_rtm_mode(i) == RTM_bind_or_copy) {
     if (get_rtm_mode(i) == RTM_bind_or_copy) {
       if ((get_texture(i)->get_format() != Texture::F_depth_stencil)&&
       if ((get_texture(i)->get_format() != Texture::F_depth_stencil)&&
+          (get_texture(i)->get_format() != Texture::F_depth_component)&&
           (color_tex_index < 0)) {
           (color_tex_index < 0)) {
         color_tex_index = i;
         color_tex_index = i;
       } else {
       } else {