Unify UpdateCmdInfo

This commit is contained in:
Henrik Rydgård 2018-02-26 11:48:56 +01:00
parent 8cef1f0f8d
commit 6a2f45c2e1
10 changed files with 14 additions and 52 deletions

View File

@ -123,18 +123,6 @@ GPU_D3D11::~GPU_D3D11() {
stockD3D11.Destroy();
}
void GPU_D3D11::UpdateCmdInfo() {
if (g_Config.bSoftwareSkinning) {
cmdInfo_[GE_CMD_VERTEXTYPE].flags &= ~FLAG_FLUSHBEFOREONCHANGE;
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GPUCommon::Execute_VertexTypeSkinning;
} else {
cmdInfo_[GE_CMD_VERTEXTYPE].flags |= FLAG_FLUSHBEFOREONCHANGE;
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GPUCommon::Execute_VertexType;
}
CheckGPUFeatures();
}
void GPU_D3D11::CheckGPUFeatures() {
u32 features = 0;

View File

@ -70,8 +70,6 @@ protected:
void FinishDeferred() override;
private:
void UpdateCmdInfo();
void Flush() {
drawEngine_.Flush();
}

View File

@ -103,18 +103,6 @@ GPU_DX9::GPU_DX9(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
}
}
void GPU_DX9::UpdateCmdInfo() {
if (g_Config.bSoftwareSkinning) {
cmdInfo_[GE_CMD_VERTEXTYPE].flags &= ~FLAG_FLUSHBEFOREONCHANGE;
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GPUCommon::Execute_VertexTypeSkinning;
} else {
cmdInfo_[GE_CMD_VERTEXTYPE].flags |= FLAG_FLUSHBEFOREONCHANGE;
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GPUCommon::Execute_VertexType;
}
CheckGPUFeatures();
}
void GPU_DX9::CheckGPUFeatures() {
u32 features = 0;

View File

@ -70,8 +70,6 @@ protected:
void FinishDeferred() override;
private:
void UpdateCmdInfo();
void Flush() {
drawEngine_.Flush();
}

View File

@ -407,16 +407,6 @@ inline void GPU_GLES::UpdateVsyncInterval(bool force) {
#endif
}
void GPU_GLES::UpdateCmdInfo() {
if (g_Config.bSoftwareSkinning) {
cmdInfo_[GE_CMD_VERTEXTYPE].flags &= ~FLAG_FLUSHBEFOREONCHANGE;
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GPUCommon::Execute_VertexTypeSkinning;
} else {
cmdInfo_[GE_CMD_VERTEXTYPE].flags |= FLAG_FLUSHBEFOREONCHANGE;
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GPUCommon::Execute_VertexType;
}
}
void GPU_GLES::ReapplyGfxState() {
GPUCommon::ReapplyGfxState();
}

View File

@ -87,7 +87,6 @@ private:
void Reinitialize() override;
inline void UpdateVsyncInterval(bool force);
void UpdateCmdInfo();
FramebufferManagerGLES *framebufferManagerGL_;
TextureCacheGLES *textureCacheGL_;

View File

@ -402,11 +402,23 @@ GPUCommon::GPUCommon(GraphicsContext *gfxCtx, Draw::DrawContext *draw) :
ERROR_LOG(G3D, "Command missing from table: %02x (%i)", i, i);
}
}
UpdateCmdInfo();
}
GPUCommon::~GPUCommon() {
}
void GPUCommon::UpdateCmdInfo() {
if (g_Config.bSoftwareSkinning) {
cmdInfo_[GE_CMD_VERTEXTYPE].flags &= ~FLAG_FLUSHBEFOREONCHANGE;
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GPUCommon::Execute_VertexTypeSkinning;
} else {
cmdInfo_[GE_CMD_VERTEXTYPE].flags |= FLAG_FLUSHBEFOREONCHANGE;
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GPUCommon::Execute_VertexType;
}
}
void GPUCommon::BeginHostFrame() {
ReapplyGfxState();

View File

@ -72,6 +72,8 @@ public:
}
virtual void CheckGPUFeatures() = 0;
void UpdateCmdInfo();
bool IsReady() override {
return true;
}

View File

@ -86,8 +86,6 @@ GPU_Vulkan::GPU_Vulkan(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
ERROR_LOG(G3D, "gstate has drifted out of sync!");
}
UpdateCmdInfo();
BuildReportingInfo();
// Update again after init to be sure of any silly driver problems.
UpdateVsyncInterval(true);
@ -342,16 +340,6 @@ void GPU_Vulkan::UpdateVsyncInterval(bool force) {
// TODO
}
void GPU_Vulkan::UpdateCmdInfo() {
if (g_Config.bSoftwareSkinning) {
cmdInfo_[GE_CMD_VERTEXTYPE].flags &= ~FLAG_FLUSHBEFOREONCHANGE;
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GPUCommon::Execute_VertexTypeSkinning;
} else {
cmdInfo_[GE_CMD_VERTEXTYPE].flags |= FLAG_FLUSHBEFOREONCHANGE;
cmdInfo_[GE_CMD_VERTEXTYPE].func = &GPUCommon::Execute_VertexType;
}
}
void GPU_Vulkan::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) {
host->GPUNotifyDisplay(framebuf, stride, format);
framebufferManager_->SetDisplayFramebuffer(framebuf, stride, format);

View File

@ -84,7 +84,6 @@ private:
void CopyDisplayToOutput() override;
void Reinitialize() override;
inline void UpdateVsyncInterval(bool force);
void UpdateCmdInfo();
void InitDeviceObjects();
void DestroyDeviceObjects();