diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index 6ead8a3dd0..3f5f1e0917 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -202,7 +202,7 @@ prepare_texture(Texture *tex) { << *dtc->get_texture() << " is stored in an unsupported compressed format.\n"; return NULL; } - + if (!dtc->create_texture(*_screen)) { delete dtc; return NULL; @@ -2531,9 +2531,8 @@ reset() { D3DDEVICE_CREATION_PARAMETERS creation_parameters; _supports_render_texture = false; - - // default render to texture format - _screen->_render_to_texture_d3d_format = D3DFMT_A8R8G8B8; + _screen->_render_to_texture_d3d_format = D3DFMT_UNKNOWN; + _screen->_framebuffer_d3d_format = D3DFMT_UNKNOWN; #define TOTAL_RENDER_TO_TEXTURE_FORMATS 3 @@ -2541,13 +2540,15 @@ reset() { { D3DFMT_A8R8G8B8, // check for this format first D3DFMT_X8R8G8B8, - (D3DFORMAT) 0, // place holder for _screen->_display_mode.Format + D3DFMT_UNKNOWN, // place holder for _screen->_display_mode.Format }; render_to_texture_formats [TOTAL_RENDER_TO_TEXTURE_FORMATS - 1] = _screen->_display_mode.Format; hr = _d3d_device->GetCreationParameters (&creation_parameters); if (SUCCEEDED (hr)) { + _screen->_framebuffer_d3d_format = _screen->_display_mode.Format; + int index; for (index = 0; index < TOTAL_RENDER_TO_TEXTURE_FORMATS; index++) { hr = _screen->_d3d9->CheckDeviceFormat ( diff --git a/panda/src/dxgsg9/dxgsg9base.h b/panda/src/dxgsg9/dxgsg9base.h index acacfcc92e..857962fda3 100755 --- a/panda/src/dxgsg9/dxgsg9base.h +++ b/panda/src/dxgsg9/dxgsg9base.h @@ -202,6 +202,9 @@ struct DXScreenData { D3DPRESENT_PARAMETERS _presentation_params; // not redundant with _display_mode since width/height must be 0 for windowed mode D3DADAPTER_IDENTIFIER9 _dx_device_id; D3DFORMAT _render_to_texture_d3d_format; + D3DFORMAT _framebuffer_d3d_format; + + DXGraphicsStateGuardian9 *_dxgsg9; int _managed_textures; int _managed_vertex_buffers; @@ -209,8 +212,6 @@ struct DXScreenData { bool _supports_dynamic_textures; bool _supports_automatic_mipmap_generation; - - DXGraphicsStateGuardian9 *_dxgsg9; };