mirror of https://github.com/bkaradzic/bgfx
Added handling for dirty box.
This commit is contained in:
parent
e758f12b22
commit
42653612cf
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue