feat(gx): sync index buffer in d3d backend

This commit is contained in:
fallenoak 2023-03-10 16:13:18 -06:00
parent 38380ebc35
commit 6723f810ed
2 changed files with 13 additions and 1 deletions

View File

@ -950,7 +950,18 @@ void CGxDeviceD3d::IStateSyncEnables() {
}
void CGxDeviceD3d::IStateSyncIndexPtr() {
// TODO
if (!this->m_primIndexDirty) {
return;
}
this->m_primIndexDirty = 0;
auto d3dIndexBuf = static_cast<LPDIRECT3DINDEXBUFFER9>(this->m_primIndexBuf->m_pool->m_apiSpecific);
if (this->m_d3dCurrentIndexBuf != d3dIndexBuf) {
this->m_d3dDevice->SetIndices(d3dIndexBuf);
this->m_d3dCurrentIndexBuf = d3dIndexBuf;
}
}
void CGxDeviceD3d::IStateSyncVertexPtrs() {

View File

@ -220,6 +220,7 @@ class CGxDeviceD3d : public CGxDevice {
int32_t m_d3dIsHwDevice = 0;
D3DDISPLAYMODE m_desktopDisplayMode;
D3DFORMAT m_devAdapterFormat;
LPDIRECT3DINDEXBUFFER9 m_d3dCurrentIndexBuf;
uint32_t m_deviceStates[DeviceStates_Last];
// Virtual member functions