mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
In Rev 1.130 of GraphicsOut.cxx by drwr, the query for render-to-texture support is no longer made to the gsg directly at line 368, but is instead routed through an internal GraphicsOut.get_supports_render_texture() which defaults to false. In the wgl path, the derived wglGraphicsBuffer supplies its own get_supports_render_texture() and querys the gsg. The DirectX equivalent classes do not supply a new get_supports_render_texture() and so fails everytime when trying to render_to_texture.
This patches in the requisite get_supports_render_texture() for wdxGraphicsBuffer8 and fixes a few typos between depth and color texture usages. Thanks to Jonah (11thpenguin) for pointing these mistakes out.
This commit is contained in:
parent
563f8bec7d
commit
a6993457cc
27
panda/src/dxgsg8/wdxGraphicsBuffer8.I
Normal file
27
panda/src/dxgsg8/wdxGraphicsBuffer8.I
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Filename: wdxGraphicsBuffer9.I
|
||||||
|
// Created by: zhao (29Sep12)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||||
|
//
|
||||||
|
// All use of this software is subject to the terms of the revised BSD
|
||||||
|
// license. You should have received a copy of this license along
|
||||||
|
// with this source code in a file named "LICENSE."
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: wdxGraphicsBuffer8::get_supports_render_texture
|
||||||
|
// Access: Published, Virtual
|
||||||
|
// Description: Returns true if this particular GraphicsOutput can
|
||||||
|
// render directly into a texture, or false if it must
|
||||||
|
// always copy-to-texture at the end of each frame to
|
||||||
|
// achieve this effect.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE bool wdxGraphicsBuffer9::
|
||||||
|
get_supports_render_texture() const {
|
||||||
|
// DX8 buffers can always bind-to-texture.
|
||||||
|
return true;
|
||||||
|
}
|
@ -347,14 +347,14 @@ rebuild_bitplanes() {
|
|||||||
if (depth_ctx) {
|
if (depth_ctx) {
|
||||||
if (!depth_ctx->create_texture(*_dxgsg->_screen)) {
|
if (!depth_ctx->create_texture(*_dxgsg->_screen)) {
|
||||||
dxgsg8_cat.error()
|
dxgsg8_cat.error()
|
||||||
<< "Unable to re-create texture " << *color_ctx->get_texture() << endl;
|
<< "Unable to re-create texture " << *depth_ctx->get_texture() << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (depth_tex->get_texture_type() == Texture::TT_2d_texture) {
|
if (depth_tex->get_texture_type() == Texture::TT_2d_texture) {
|
||||||
depth_d3d_tex = depth_ctx->_d3d_2d_texture;
|
depth_d3d_tex = depth_ctx->_d3d_2d_texture;
|
||||||
nassertr(depth_d3d_tex != 0, false);
|
nassertr(depth_d3d_tex != 0, false);
|
||||||
hr = color_d3d_tex -> GetSurfaceLevel(0, &depth_surf);
|
hr = depth_d3d_tex -> GetSurfaceLevel(0, &depth_surf);
|
||||||
if (!SUCCEEDED(hr)) {
|
if (!SUCCEEDED(hr)) {
|
||||||
dxgsg8_cat.error ( ) << "GetSurfaceLevel " << D3DERRORSTRING(hr) FL;
|
dxgsg8_cat.error ( ) << "GetSurfaceLevel " << D3DERRORSTRING(hr) FL;
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,8 @@ public:
|
|||||||
GraphicsOutput *host);
|
GraphicsOutput *host);
|
||||||
virtual ~wdxGraphicsBuffer8();
|
virtual ~wdxGraphicsBuffer8();
|
||||||
|
|
||||||
|
virtual INLINE bool get_supports_render_texture() const;
|
||||||
|
|
||||||
virtual bool begin_frame(FrameMode mode, Thread *current_thread);
|
virtual bool begin_frame(FrameMode mode, Thread *current_thread);
|
||||||
virtual void end_frame(FrameMode mode, Thread *current_thread);
|
virtual void end_frame(FrameMode mode, Thread *current_thread);
|
||||||
|
|
||||||
@ -92,4 +94,6 @@ private:
|
|||||||
friend class DXTextureContext8;
|
friend class DXTextureContext8;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#include "wdxGraphicsBuffer8.I"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user