mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 19:22:30 +00:00
feat(gx): clean up draw calls across gll and d3d backends
This commit is contained in:
parent
d869c6d898
commit
02ddaa106f
7 changed files with 20 additions and 20 deletions
|
|
@ -334,7 +334,7 @@ int32_t CGxDeviceGLL::DeviceSetFormat(const CGxFormat& format) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
void CGxDeviceGLL::Draw(CGxBatch* batch, int32_t count) {
|
||||
void CGxDeviceGLL::Draw(CGxBatch* batch, int32_t indexed) {
|
||||
if (!this->m_context) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -343,28 +343,26 @@ void CGxDeviceGLL::Draw(CGxBatch* batch, int32_t count) {
|
|||
// unk conditional check early return
|
||||
|
||||
this->IStateSync();
|
||||
this->ValidateDraw(batch, count);
|
||||
this->ValidateDraw(batch, indexed);
|
||||
|
||||
int32_t v4 = 0;
|
||||
uint32_t baseIndex = 0;
|
||||
if (!this->m_caps.int10) {
|
||||
baseIndex = this->m_primVertexFormatBuf[0]->m_index / this->m_primVertexFormatBuf[0]->m_itemSize;
|
||||
}
|
||||
|
||||
// TODO
|
||||
// if (!this->unk0[154]) {
|
||||
// v4 = (this->unk6[56] + 24) / (this->unk6[56] + 12);
|
||||
// }
|
||||
|
||||
if (count) {
|
||||
if (indexed) {
|
||||
this->m_glDevice.DrawIndexed(
|
||||
CGxDeviceGLL::s_primitiveConversion[batch->m_primType],
|
||||
batch->m_minIndex,
|
||||
batch->m_maxIndex,
|
||||
v4,
|
||||
batch->m_start + (this->m_primIndexBuf->m_index >> 1),
|
||||
baseIndex,
|
||||
batch->m_start + (this->m_primIndexBuf->m_index / 2),
|
||||
batch->m_count
|
||||
);
|
||||
} else {
|
||||
this->m_glDevice.Draw(
|
||||
CGxDeviceGLL::s_primitiveConversion[batch->m_primType],
|
||||
v4,
|
||||
baseIndex,
|
||||
batch->m_count
|
||||
);
|
||||
}
|
||||
|
|
@ -672,6 +670,8 @@ void CGxDeviceGLL::ISetCaps(const CGxFormat& format) {
|
|||
|
||||
this->m_caps.m_generateMipMaps = 1;
|
||||
|
||||
this->m_caps.int10 = 1;
|
||||
|
||||
this->m_caps.m_texFmt[GxTex_Dxt1] = 1;
|
||||
this->m_caps.m_texFmt[GxTex_Dxt3] = 1;
|
||||
this->m_caps.m_texFmt[GxTex_Dxt5] = 1;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class CGxDeviceGLL : public CGxDevice {
|
|||
virtual void SceneClear(uint32_t, CImVector);
|
||||
virtual void XformSetProjection(const C44Matrix&);
|
||||
virtual void XformSetView(const C44Matrix&);
|
||||
virtual void Draw(CGxBatch*, int32_t);
|
||||
virtual void Draw(CGxBatch* batch, int32_t indexed);
|
||||
virtual void PoolSizeSet(CGxPool*, uint32_t);
|
||||
virtual char* BufLock(CGxBuf*);
|
||||
virtual int32_t BufUnlock(CGxBuf*, uint32_t);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue