From 52d3b65cc4320e273b5c84f48167527c068cf84b Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Mon, 15 May 2006 23:02:13 +0000 Subject: [PATCH] Fix RTT clear color buffer problem. Use color instead of back. --- panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 8 ++++---- panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index 5bd99d7516..d5bf028f09 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -496,7 +496,7 @@ do_clear(const RenderBuffer &buffer) { DWORD aux_flags = 0; //set appropriate flags - if (buffer_type & RenderBuffer::T_back) { + if (buffer_type & RenderBuffer::T_color) { main_flags |= D3DCLEAR_TARGET; } @@ -558,7 +558,7 @@ do_clear(const RenderBuffer &buffer) { // scissor region and viewport) //////////////////////////////////////////////////////////////////// void DXGraphicsStateGuardian8:: -prepare_display_region(DisplayRegionPipelineReader *dr, +prepare_display_region(DisplayRegionPipelineReader *dr, Lens::StereoChannel stereo_channel) { nassertv(dr != (DisplayRegionPipelineReader *)NULL); GraphicsStateGuardian::prepare_display_region(dr, stereo_channel); @@ -791,10 +791,10 @@ end_frame(Thread *current_thread) { // are ok, false to abort this group of primitives. //////////////////////////////////////////////////////////////////// bool DXGraphicsStateGuardian8:: -begin_draw_primitives(const GeomPipelineReader *geom_reader, +begin_draw_primitives(const GeomPipelineReader *geom_reader, const GeomMunger *munger, const GeomVertexDataPipelineReader *data_reader) { - if (!GraphicsStateGuardian::begin_draw_primitives(geom_reader, munger, + if (!GraphicsStateGuardian::begin_draw_primitives(geom_reader, munger, data_reader)) { return false; } diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index 49ed5a4ba3..e1fd97a64f 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -393,7 +393,7 @@ prepare_vertex_buffer(GeomVertexArrayData *data) { // makes it the current vertex buffer for rendering. //////////////////////////////////////////////////////////////////// void DXGraphicsStateGuardian9:: -apply_vertex_buffer(VertexBufferContext *vbc, +apply_vertex_buffer(VertexBufferContext *vbc, CLP(ShaderContext) *shader_context, const GeomVertexArrayDataPipelineReader *reader) { DXVertexBufferContext9 *dvbc = DCAST(DXVertexBufferContext9, vbc); @@ -709,7 +709,7 @@ do_clear(const RenderBuffer &buffer) { DBG_S dxgsg9_cat.debug ( ) << "DXGraphicsStateGuardian9::do_clear\n"; DBG_E //set appropriate flags - if (buffer_type & RenderBuffer::T_back) { + if (buffer_type & RenderBuffer::T_color) { main_flags |= D3DCLEAR_TARGET; } @@ -727,6 +727,7 @@ do_clear(const RenderBuffer &buffer) { if ((main_flags | aux_flags) != 0) { DBG_S dxgsg9_cat.debug ( ) << "ccccc DXGraphicsStateGuardian9::really do_clear\n"; DBG_E + DBG_S dxgsg9_cat.debug ( ) << "clear flags: main " << main_flags << " aux :" << aux_flags << "\n"; DBG_E HRESULT hr = _d3d_device->Clear(0, NULL, main_flags | aux_flags, _d3dcolor_clear_value, _depth_clear_value, (DWORD)_stencil_clear_value); @@ -1148,10 +1149,10 @@ DBG_S dxgsg9_cat.debug ( ) << "@@@@@@@@@@ end_frame \n"; DBG_E // are ok, false to abort this group of primitives. //////////////////////////////////////////////////////////////////// bool DXGraphicsStateGuardian9:: -begin_draw_primitives(const GeomPipelineReader *geom_reader, +begin_draw_primitives(const GeomPipelineReader *geom_reader, const GeomMunger *munger, const GeomVertexDataPipelineReader *data_reader) { - if (!GraphicsStateGuardian::begin_draw_primitives(geom_reader, munger, + if (!GraphicsStateGuardian::begin_draw_primitives(geom_reader, munger, data_reader)) { return false; } @@ -2215,7 +2216,7 @@ bool vertex_buffer_page_in_function (LruPage *lru_page) // allocate vertex buffer Thread *current_thread = Thread::get_current_thread(); - GeomVertexArrayDataPipelineReader reader(vertex_buffer->get_data(), current_thread); + GeomVertexArrayDataPipelineReader reader(vertex_buffer->get_data(), current_thread); vertex_buffer -> allocate_vbuffer (*(gsg->_screen), &reader); // update vertex buffer @@ -2256,7 +2257,7 @@ bool index_buffer_page_in_function (LruPage *lru_page) // allocate vertex buffer Thread *current_thread = Thread::get_current_thread(); - GeomPrimitivePipelineReader reader(index_buffer->get_data(), current_thread); + GeomPrimitivePipelineReader reader(index_buffer->get_data(), current_thread); index_buffer -> allocate_ibuffer (*(gsg->_screen), &reader); // update vertex buffer @@ -4697,7 +4698,7 @@ get_d3d_min_type(Texture::FilterType filter_type, case Texture::FT_linear_mipmap_linear: return D3DTEXF_LINEAR; - + case Texture::FT_shadow: case Texture::FT_default: return D3DTEXF_LINEAR;