mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Avoid redundant setting of FVF.
This commit is contained in:
parent
4731e7e50e
commit
54185735cd
@ -133,6 +133,7 @@ DXGraphicsStateGuardian9(const FrameBufferProperties &properties) :
|
|||||||
_enable_lru = dx_lru_management;
|
_enable_lru = dx_lru_management;
|
||||||
|
|
||||||
_lru = 0;
|
_lru = 0;
|
||||||
|
_last_fvf = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -382,15 +383,21 @@ apply_vertex_buffer(VertexBufferContext *vbc) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// HRESULT hr = _d3d_device->SetVertexShader(dvbc->_fvf);
|
if (dvbc->_fvf != _last_fvf) {
|
||||||
HRESULT hr = _d3d_device->SetFVF(dvbc->_fvf);
|
HRESULT hr = _d3d_device->SetFVF(dvbc->_fvf);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
dxgsg9_cat.error()
|
dxgsg9_cat.error()
|
||||||
<< "SetVertexShader(0x" << (void*)dvbc->_fvf
|
<< "SetVertexShader(0x" << (void*)dvbc->_fvf
|
||||||
<< ") failed" << D3DERRORSTRING(hr);
|
<< ") failed" << D3DERRORSTRING(hr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
_last_fvf = dvbc->_fvf;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// dxgsg9_cat.error() << "EQUAL FVF\n";
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -2260,6 +2267,8 @@ reset() {
|
|||||||
// must check (_screen->_d3dcaps.PrimitiveMiscCaps & D3DPMISCCAPS_BLENDOP) (yes on GF2/Radeon8500, no on TNT)
|
// must check (_screen->_d3dcaps.PrimitiveMiscCaps & D3DPMISCCAPS_BLENDOP) (yes on GF2/Radeon8500, no on TNT)
|
||||||
_d3d_device->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD);
|
_d3d_device->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD);
|
||||||
|
|
||||||
|
_last_fvf = 0;
|
||||||
|
|
||||||
PRINT_REFCNT(dxgsg9, _d3d_device);
|
PRINT_REFCNT(dxgsg9, _d3d_device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,6 +256,8 @@ protected:
|
|||||||
|
|
||||||
Lru *_lru;
|
Lru *_lru;
|
||||||
|
|
||||||
|
DWORD _last_fvf;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual TypeHandle get_type() const {
|
virtual TypeHandle get_type() const {
|
||||||
return get_class_type();
|
return get_class_type();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user