Added handling for dirty box.

This commit is contained in:
bkaradzic 2013-03-02 23:20:28 -08:00
parent e758f12b22
commit 42653612cf
2 changed files with 14 additions and 4 deletions

View File

@ -1352,7 +1352,7 @@ namespace bgfx
BX_CHECK(false, "You should not be here.");
}
void Texture::dirty(uint8_t _side, const Rect& _rect)
void Texture::dirty(uint8_t _side, const Rect& _rect, uint16_t _z, uint16_t _depth)
{
switch (m_type)
{
@ -1369,7 +1369,14 @@ namespace bgfx
case Texture3D:
{
// DX_CHECK(m_texture3d->AddDirtyRect(_box) );
D3DBOX box;
box.Left = _rect.m_x;
box.Top = _rect.m_y;
box.Right = box.Left + _rect.m_width;
box.Bottom = box.Top + _rect.m_height;
box.Front = _z;
box.Back = box.Front + _depth;
DX_CHECK(m_texture3d->AddDirtyBox(&box) );
}
return;
@ -1619,7 +1626,10 @@ namespace bgfx
}
}
dirty(_side, _rect);
if (0 == _mip)
{
dirty(_side, _rect, _z, _depth);
}
}
void Texture::updateEnd()

View File

@ -320,7 +320,7 @@ namespace bgfx
uint8_t* lock(uint8_t _side, uint8_t _lod, uint32_t& _pitch, uint32_t& _slicePitch, const Rect* _rect = NULL);
void unlock(uint8_t _side, uint8_t _lod);
void dirty(uint8_t _side, const Rect& _rect);
void dirty(uint8_t _side, const Rect& _rect, uint16_t _z, uint16_t _depth);
void create(const Memory* _mem, uint32_t _flags);