D3D: move streaming buffer fallback into D3D backend
Neith OGL nor VideoCommon doen't use it, so there is no need to have it in VideoCommon.
This commit is contained in:
parent
62f1905978
commit
1ff681a412
|
@ -77,6 +77,12 @@ void VertexManager::DestroyDeviceObjects()
|
||||||
|
|
||||||
VertexManager::VertexManager()
|
VertexManager::VertexManager()
|
||||||
{
|
{
|
||||||
|
LocalVBuffer.resize(MAXVBUFFERSIZE);
|
||||||
|
s_pCurBufferPointer = s_pBaseBufferPointer = &LocalVBuffer[0];
|
||||||
|
s_pEndBufferPointer = s_pBaseBufferPointer + LocalVBuffer.size();
|
||||||
|
|
||||||
|
LocalIBuffer.resize(MAXIBUFFERSIZE);
|
||||||
|
|
||||||
CreateDeviceObjects();
|
CreateDeviceObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,4 +228,10 @@ void VertexManager::vFlush()
|
||||||
g_renderer->RestoreState();
|
g_renderer->RestoreState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VertexManager::ResetBuffer(u32 stride)
|
||||||
|
{
|
||||||
|
s_pCurBufferPointer = s_pBaseBufferPointer;
|
||||||
|
IndexGenerator::Start(GetIndexBuffer());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -22,6 +22,10 @@ public:
|
||||||
void CreateDeviceObjects();
|
void CreateDeviceObjects();
|
||||||
void DestroyDeviceObjects();
|
void DestroyDeviceObjects();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void ResetBuffer(u32 stride);
|
||||||
|
u16* GetIndexBuffer() { return &LocalIBuffer[0]; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void PrepareDrawBuffers();
|
void PrepareDrawBuffers();
|
||||||
|
@ -41,6 +45,9 @@ private:
|
||||||
|
|
||||||
LineGeometryShader m_lineShader;
|
LineGeometryShader m_lineShader;
|
||||||
PointGeometryShader m_pointShader;
|
PointGeometryShader m_pointShader;
|
||||||
|
|
||||||
|
std::vector<u8> LocalVBuffer;
|
||||||
|
std::vector<u16> LocalIBuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -39,12 +39,6 @@ static const PrimitiveType primitive_from_gx[8] = {
|
||||||
|
|
||||||
VertexManager::VertexManager()
|
VertexManager::VertexManager()
|
||||||
{
|
{
|
||||||
LocalVBuffer.resize(MAXVBUFFERSIZE);
|
|
||||||
s_pCurBufferPointer = s_pBaseBufferPointer = &LocalVBuffer[0];
|
|
||||||
s_pEndBufferPointer = s_pBaseBufferPointer + LocalVBuffer.size();
|
|
||||||
|
|
||||||
LocalIBuffer.resize(MAXIBUFFERSIZE);
|
|
||||||
|
|
||||||
IsFlushed = true;
|
IsFlushed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,12 +46,6 @@ VertexManager::~VertexManager()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void VertexManager::ResetBuffer(u32 stride)
|
|
||||||
{
|
|
||||||
s_pCurBufferPointer = s_pBaseBufferPointer;
|
|
||||||
IndexGenerator::Start(GetIndexBuffer());
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 VertexManager::GetRemainingSize()
|
u32 VertexManager::GetRemainingSize()
|
||||||
{
|
{
|
||||||
return (u32)(s_pEndBufferPointer - s_pCurBufferPointer);
|
return (u32)(s_pEndBufferPointer - s_pCurBufferPointer);
|
||||||
|
|
|
@ -51,14 +51,11 @@ public:
|
||||||
virtual void DestroyDeviceObjects(){};
|
virtual void DestroyDeviceObjects(){};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
u16* GetIndexBuffer() { return &LocalIBuffer[0]; }
|
|
||||||
u8* GetVertexBuffer() { return &s_pBaseBufferPointer[0]; }
|
|
||||||
|
|
||||||
virtual void vDoState(PointerWrap& p) { }
|
virtual void vDoState(PointerWrap& p) { }
|
||||||
|
|
||||||
static PrimitiveType current_primitive_type;
|
static PrimitiveType current_primitive_type;
|
||||||
|
|
||||||
virtual void ResetBuffer(u32 stride);
|
virtual void ResetBuffer(u32 stride) = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool IsFlushed;
|
static bool IsFlushed;
|
||||||
|
@ -66,9 +63,6 @@ private:
|
||||||
//virtual void Draw(u32 stride, bool alphapass) = 0;
|
//virtual void Draw(u32 stride, bool alphapass) = 0;
|
||||||
// temp
|
// temp
|
||||||
virtual void vFlush() = 0;
|
virtual void vFlush() = 0;
|
||||||
|
|
||||||
std::vector<u8> LocalVBuffer;
|
|
||||||
std::vector<u16> LocalIBuffer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern VertexManager *g_vertex_manager;
|
extern VertexManager *g_vertex_manager;
|
||||||
|
|
Loading…
Reference in New Issue