feat(gx): implement draw calls in d3d backend

This commit is contained in:
fallenoak 2023-03-10 10:33:38 -06:00 committed by GitHub
parent 34c7593ddb
commit d869c6d898
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 78 additions and 0 deletions

View file

@ -35,6 +35,24 @@ uint32_t CGxDevice::s_alphaRef[] = {
C3Vector CGxDevice::s_pointScaleIdentity = { 1.0f, 0.0f, 0.0f };
uint32_t CGxDevice::s_primVtxAdjust[] = {
0, // GxPrim_Points
0, // GxPrim_Lines
1, // GxPrim_LineStrip
0, // GxPrim_Triangles
2, // GxPrim_TriangleStrip
2, // GxPrim_TriangleFan
};
uint32_t CGxDevice::s_primVtxDiv[] = {
1, // GxPrim_Points
2, // GxPrim_Lines
1, // GxPrim_LineStrip
3, // GxPrim_Triangles
1, // GxPrim_TriangleStrip
1, // GxPrim_TriangleFan
};
ShaderConstants CGxDevice::s_shadowConstants[2];
uint32_t CGxDevice::s_streamPoolSize[] = {
@ -109,6 +127,15 @@ CGxDevice* CGxDevice::NewOpenGl() {
return nullptr;
}
uint32_t CGxDevice::PrimCalcCount(EGxPrim primType, uint32_t count) {
auto div = CGxDevice::s_primVtxDiv[primType];
if (div != 1) {
count /= div;
}
return count - CGxDevice::s_primVtxAdjust[primType];
}
CGxDevice::CGxDevice() {
// TODO
// - implement rest of constructor