Unify ExecuteOp between the accelerated backends

This commit is contained in:
Henrik Rydgård 2023-02-25 12:02:52 +01:00
parent 6b91647209
commit 609a8f6d36
10 changed files with 14 additions and 58 deletions

View File

@ -185,19 +185,6 @@ void GPU_D3D11::FinishDeferred() {
drawEngine_.FinishDeferred();
}
void GPU_D3D11::ExecuteOp(u32 op, u32 diff) {
const u8 cmd = op >> 24;
const CommandInfo info = cmdInfo_[cmd];
const u8 cmdFlags = info.flags;
if ((cmdFlags & FLAG_EXECUTE) || (diff && (cmdFlags & FLAG_EXECUTEONCHANGE))) {
(this->*info.func)(op, diff);
} else if (diff) {
uint64_t dirty = info.flags >> 8;
if (dirty)
gstate_c.Dirty(dirty);
}
}
void GPU_D3D11::GetStats(char *buffer, size_t bufsize) {
size_t offset = FormatGPUStatsCommon(buffer, bufsize);
buffer += offset;

View File

@ -37,7 +37,6 @@ public:
~GPU_D3D11();
u32 CheckGPUFeatures() const override;
void ExecuteOp(u32 op, u32 diff) override;
void GetStats(char *buffer, size_t bufsize) override;
void DeviceLost() override; // Only happens on Android. Drop all textures and shaders.

View File

@ -181,19 +181,6 @@ void GPU_DX9::FinishDeferred() {
drawEngine_.FinishDeferred();
}
void GPU_DX9::ExecuteOp(u32 op, u32 diff) {
const u8 cmd = op >> 24;
const CommandInfo info = cmdInfo_[cmd];
const u8 cmdFlags = info.flags;
if ((cmdFlags & FLAG_EXECUTE) || (diff && (cmdFlags & FLAG_EXECUTEONCHANGE))) {
(this->*info.func)(op, diff);
} else if (diff) {
uint64_t dirty = info.flags >> 8;
if (dirty)
gstate_c.Dirty(dirty);
}
}
void GPU_DX9::GetStats(char *buffer, size_t bufsize) {
size_t offset = FormatGPUStatsCommon(buffer, bufsize);
buffer += offset;

View File

@ -36,7 +36,6 @@ public:
~GPU_DX9();
u32 CheckGPUFeatures() const override;
void ExecuteOp(u32 op, u32 diff) override;
void ReapplyGfxState() override;
void GetStats(char *buffer, size_t bufsize) override;

View File

@ -334,19 +334,6 @@ void GPU_GLES::FinishDeferred() {
drawEngine_.FinishDeferred();
}
void GPU_GLES::ExecuteOp(u32 op, u32 diff) {
const u8 cmd = op >> 24;
const CommandInfo info = cmdInfo_[cmd];
const u8 cmdFlags = info.flags;
if ((cmdFlags & FLAG_EXECUTE) || (diff && (cmdFlags & FLAG_EXECUTEONCHANGE))) {
(this->*info.func)(op, diff);
} else if (diff) {
uint64_t dirty = info.flags >> 8;
if (dirty)
gstate_c.Dirty(dirty);
}
}
void GPU_GLES::GetStats(char *buffer, size_t bufsize) {
size_t offset = FormatGPUStatsCommon(buffer, bufsize);
buffer += offset;

View File

@ -43,8 +43,6 @@ public:
bool IsReady() override;
void CancelReady() override;
void ExecuteOp(u32 op, u32 diff) override;
void ReapplyGfxState() override;
void GetStats(char *buffer, size_t bufsize) override;

View File

@ -2706,6 +2706,19 @@ void GPUCommon::FlushImm() {
}
}
void GPUCommon::ExecuteOp(u32 op, u32 diff) {
const u8 cmd = op >> 24;
const CommandInfo info = cmdInfo_[cmd];
const u8 cmdFlags = info.flags;
if ((cmdFlags & FLAG_EXECUTE) || (diff && (cmdFlags & FLAG_EXECUTEONCHANGE))) {
(this->*info.func)(op, diff);
} else if (diff) {
uint64_t dirty = info.flags >> 8;
if (dirty)
gstate_c.Dirty(dirty);
}
}
void GPUCommon::Execute_Unknown(u32 op, u32 diff) {
if ((op & 0xFFFFFF) != 0)
WARN_LOG_REPORT_ONCE(unknowncmd, G3D, "Unknown GE command : %08x ", op);

View File

@ -108,6 +108,7 @@ public:
void DumpNextFrame() override;
void ExecuteOp(u32 op, u32 diff) override;
virtual void PreExecuteOp(u32 op, u32 diff);
bool InterpretList(DisplayList &list);

View File

@ -416,19 +416,6 @@ void GPU_Vulkan::FinishDeferred() {
drawEngine_.FinishDeferred();
}
void GPU_Vulkan::ExecuteOp(u32 op, u32 diff) {
const u8 cmd = op >> 24;
const CommandInfo info = cmdInfo_[cmd];
const u8 cmdFlags = info.flags;
if ((cmdFlags & FLAG_EXECUTE) || (diff && (cmdFlags & FLAG_EXECUTEONCHANGE))) {
(this->*info.func)(op, diff);
} else if (diff) {
uint64_t dirty = info.flags >> 8;
if (dirty)
gstate_c.Dirty(dirty);
}
}
void GPU_Vulkan::InitDeviceObjects() {
INFO_LOG(G3D, "GPU_Vulkan::InitDeviceObjects");
VulkanContext *vulkan = (VulkanContext *)draw_->GetNativeObject(Draw::NativeObject::CONTEXT);

View File

@ -47,8 +47,6 @@ public:
void BeginHostFrame() override;
void EndHostFrame() override;
void ExecuteOp(u32 op, u32 diff) override;
void GetStats(char *buffer, size_t bufsize) override;
void DeviceLost() override; // Only happens on Android. Drop all textures and shaders.
void DeviceRestore() override;