mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-19 21:52:45 +00:00
Create the GPUCommonHW class.
This commit is contained in:
parent
c4f4439b8c
commit
18999c3687
@ -1659,6 +1659,8 @@ set(GPU_SOURCES
|
|||||||
GPU/GPU.h
|
GPU/GPU.h
|
||||||
GPU/GPUCommon.cpp
|
GPU/GPUCommon.cpp
|
||||||
GPU/GPUCommon.h
|
GPU/GPUCommon.h
|
||||||
|
GPU/GPUCommonHW.cpp
|
||||||
|
GPU/GPUCommonHW.h
|
||||||
GPU/GPUState.cpp
|
GPU/GPUState.cpp
|
||||||
GPU/GPUState.h
|
GPU/GPUState.h
|
||||||
GPU/Math3D.cpp
|
GPU/Math3D.cpp
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#include "GPU/D3D11/D3D11Util.h"
|
#include "GPU/D3D11/D3D11Util.h"
|
||||||
|
|
||||||
GPU_D3D11::GPU_D3D11(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
GPU_D3D11::GPU_D3D11(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
||||||
: GPUCommon(gfxCtx, draw), drawEngine_(draw,
|
: GPUCommonHW(gfxCtx, draw), drawEngine_(draw,
|
||||||
(ID3D11Device *)draw->GetNativeObject(Draw::NativeObject::DEVICE),
|
(ID3D11Device *)draw->GetNativeObject(Draw::NativeObject::DEVICE),
|
||||||
(ID3D11DeviceContext *)draw->GetNativeObject(Draw::NativeObject::CONTEXT)) {
|
(ID3D11DeviceContext *)draw->GetNativeObject(Draw::NativeObject::CONTEXT)) {
|
||||||
device_ = (ID3D11Device *)draw->GetNativeObject(Draw::NativeObject::DEVICE);
|
device_ = (ID3D11Device *)draw->GetNativeObject(Draw::NativeObject::DEVICE);
|
||||||
|
@ -21,17 +21,15 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <d3d11.h>
|
#include <d3d11.h>
|
||||||
|
|
||||||
#include "GPU/GPUCommon.h"
|
#include "GPU/GPUCommonHW.h"
|
||||||
#include "GPU/D3D11/DrawEngineD3D11.h"
|
#include "GPU/D3D11/DrawEngineD3D11.h"
|
||||||
#include "GPU/Common/TextureShaderCommon.h"
|
|
||||||
#include "GPU/Common/VertexDecoderCommon.h"
|
#include "GPU/Common/VertexDecoderCommon.h"
|
||||||
|
|
||||||
class FramebufferManagerD3D11;
|
class FramebufferManagerD3D11;
|
||||||
class ShaderManagerD3D11;
|
class ShaderManagerD3D11;
|
||||||
class LinkedShaderD3D11;
|
|
||||||
class TextureCacheD3D11;
|
class TextureCacheD3D11;
|
||||||
|
|
||||||
class GPU_D3D11 : public GPUCommon {
|
class GPU_D3D11 : public GPUCommonHW {
|
||||||
public:
|
public:
|
||||||
GPU_D3D11(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
|
GPU_D3D11(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
|
||||||
~GPU_D3D11();
|
~GPU_D3D11();
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
#include "GPU/Directx9/TextureCacheDX9.h"
|
#include "GPU/Directx9/TextureCacheDX9.h"
|
||||||
|
|
||||||
GPU_DX9::GPU_DX9(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
GPU_DX9::GPU_DX9(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
||||||
: GPUCommon(gfxCtx, draw),
|
: GPUCommonHW(gfxCtx, draw),
|
||||||
drawEngine_(draw) {
|
drawEngine_(draw) {
|
||||||
device_ = (LPDIRECT3DDEVICE9)draw->GetNativeObject(Draw::NativeObject::DEVICE);
|
device_ = (LPDIRECT3DDEVICE9)draw->GetNativeObject(Draw::NativeObject::DEVICE);
|
||||||
deviceEx_ = (LPDIRECT3DDEVICE9EX)draw->GetNativeObject(Draw::NativeObject::DEVICE_EX);
|
deviceEx_ = (LPDIRECT3DDEVICE9EX)draw->GetNativeObject(Draw::NativeObject::DEVICE_EX);
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "GPU/GPUCommon.h"
|
#include "GPU/GPUCommonHW.h"
|
||||||
#include "GPU/Directx9/FramebufferManagerDX9.h"
|
#include "GPU/Directx9/FramebufferManagerDX9.h"
|
||||||
#include "GPU/Directx9/DrawEngineDX9.h"
|
#include "GPU/Directx9/DrawEngineDX9.h"
|
||||||
#include "GPU/Common/TextureShaderCommon.h"
|
#include "GPU/Common/TextureShaderCommon.h"
|
||||||
@ -30,7 +30,7 @@ class ShaderManagerDX9;
|
|||||||
class LinkedShaderDX9;
|
class LinkedShaderDX9;
|
||||||
class TextureCacheDX9;
|
class TextureCacheDX9;
|
||||||
|
|
||||||
class GPU_DX9 : public GPUCommon {
|
class GPU_DX9 : public GPUCommonHW {
|
||||||
public:
|
public:
|
||||||
GPU_DX9(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
|
GPU_DX9(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
|
||||||
~GPU_DX9();
|
~GPU_DX9();
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
GPU_GLES::GPU_GLES(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
GPU_GLES::GPU_GLES(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
||||||
: GPUCommon(gfxCtx, draw), drawEngine_(draw), fragmentTestCache_(draw) {
|
: GPUCommonHW(gfxCtx, draw), drawEngine_(draw), fragmentTestCache_(draw) {
|
||||||
UpdateVsyncInterval(true);
|
UpdateVsyncInterval(true);
|
||||||
gstate_c.SetUseFlags(CheckGPUFeatures());
|
gstate_c.SetUseFlags(CheckGPUFeatures());
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "Common/File/Path.h"
|
#include "Common/File/Path.h"
|
||||||
|
|
||||||
#include "GPU/GPUCommon.h"
|
#include "GPU/GPUCommonHW.h"
|
||||||
#include "GPU/Common/TextureShaderCommon.h"
|
#include "GPU/Common/TextureShaderCommon.h"
|
||||||
#include "GPU/GLES/FramebufferManagerGLES.h"
|
#include "GPU/GLES/FramebufferManagerGLES.h"
|
||||||
#include "GPU/GLES/DrawEngineGLES.h"
|
#include "GPU/GLES/DrawEngineGLES.h"
|
||||||
@ -32,7 +32,7 @@ class ShaderManagerGLES;
|
|||||||
class TextureCacheGLES;
|
class TextureCacheGLES;
|
||||||
class LinkedShader;
|
class LinkedShader;
|
||||||
|
|
||||||
class GPU_GLES : public GPUCommon {
|
class GPU_GLES : public GPUCommonHW {
|
||||||
public:
|
public:
|
||||||
GPU_GLES(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
|
GPU_GLES(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
|
||||||
~GPU_GLES();
|
~GPU_GLES();
|
||||||
|
@ -427,6 +427,7 @@
|
|||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="GPU.h" />
|
<ClInclude Include="GPU.h" />
|
||||||
<ClInclude Include="GPUCommon.h" />
|
<ClInclude Include="GPUCommon.h" />
|
||||||
|
<ClInclude Include="GPUCommonHW.h" />
|
||||||
<ClInclude Include="GPUInterface.h" />
|
<ClInclude Include="GPUInterface.h" />
|
||||||
<ClInclude Include="GPUState.h" />
|
<ClInclude Include="GPUState.h" />
|
||||||
<ClInclude Include="Math3D.h" />
|
<ClInclude Include="Math3D.h" />
|
||||||
@ -572,6 +573,7 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="GPU.cpp" />
|
<ClCompile Include="GPU.cpp" />
|
||||||
<ClCompile Include="GPUCommon.cpp" />
|
<ClCompile Include="GPUCommon.cpp" />
|
||||||
|
<ClCompile Include="GPUCommonHW.cpp" />
|
||||||
<ClCompile Include="GPUState.cpp" />
|
<ClCompile Include="GPUState.cpp" />
|
||||||
<ClCompile Include="Math3D.cpp" />
|
<ClCompile Include="Math3D.cpp" />
|
||||||
<ClCompile Include="Software\BinManager.cpp" />
|
<ClCompile Include="Software\BinManager.cpp" />
|
||||||
|
@ -264,6 +264,9 @@
|
|||||||
<ClInclude Include="Common\GeometryShaderGenerator.h">
|
<ClInclude Include="Common\GeometryShaderGenerator.h">
|
||||||
<Filter>Common</Filter>
|
<Filter>Common</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="GPUCommonHW.h">
|
||||||
|
<Filter>Common</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="Math3D.cpp">
|
<ClCompile Include="Math3D.cpp">
|
||||||
@ -524,6 +527,9 @@
|
|||||||
<ClCompile Include="Common\VertexDecoderRiscV.cpp">
|
<ClCompile Include="Common\VertexDecoderRiscV.cpp">
|
||||||
<Filter>Common</Filter>
|
<Filter>Common</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="GPUCommonHW.cpp">
|
||||||
|
<Filter>Common</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<FxCompile Include="..\assets\shaders\tex_4xbrz.csh">
|
<FxCompile Include="..\assets\shaders\tex_4xbrz.csh">
|
||||||
|
@ -1410,10 +1410,6 @@ void GPUCommon::ProcessDLQueue() {
|
|||||||
// Since the event is in CoreTiming, we're in sync. Just set 0 now.
|
// Since the event is in CoreTiming, we're in sync. Just set 0 now.
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUCommon::PreExecuteOp(u32 op, u32 diff) {
|
|
||||||
CheckFlushOp(op >> 24, diff);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GPUCommon::Execute_OffsetAddr(u32 op, u32 diff) {
|
void GPUCommon::Execute_OffsetAddr(u32 op, u32 diff) {
|
||||||
gstate_c.offsetAddr = op << 8;
|
gstate_c.offsetAddr = op << 8;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ public:
|
|||||||
void DumpNextFrame() override;
|
void DumpNextFrame() override;
|
||||||
|
|
||||||
void ExecuteOp(u32 op, u32 diff) override;
|
void ExecuteOp(u32 op, u32 diff) override;
|
||||||
virtual void PreExecuteOp(u32 op, u32 diff);
|
virtual void PreExecuteOp(u32 op, u32 diff) {}
|
||||||
|
|
||||||
bool InterpretList(DisplayList &list);
|
bool InterpretList(DisplayList &list);
|
||||||
void ProcessDLQueue();
|
void ProcessDLQueue();
|
||||||
|
13
GPU/GPUCommonHW.cpp
Normal file
13
GPU/GPUCommonHW.cpp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#include "Common/GPU/thin3d.h"
|
||||||
|
#include "GPU/GPUCommonHW.h"
|
||||||
|
|
||||||
|
|
||||||
|
GPUCommonHW::GPUCommonHW(GraphicsContext *gfxCtx, Draw::DrawContext *draw) : GPUCommon(gfxCtx, draw) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GPUCommonHW::~GPUCommonHW() {}
|
||||||
|
|
||||||
|
void GPUCommonHW::PreExecuteOp(u32 op, u32 diff) {
|
||||||
|
CheckFlushOp(op >> 24, diff);
|
||||||
|
}
|
16
GPU/GPUCommonHW.h
Normal file
16
GPU/GPUCommonHW.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "GPUCommon.h"
|
||||||
|
|
||||||
|
// Shared GPUCommon implementation for the HW backends.
|
||||||
|
// Things that are irrelevant for SoftGPU should live here.
|
||||||
|
class GPUCommonHW : public GPUCommon {
|
||||||
|
public:
|
||||||
|
GPUCommonHW(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
|
||||||
|
~GPUCommonHW();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void PreExecuteOp(u32 op, u32 diff);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
@ -210,7 +210,6 @@ protected:
|
|||||||
void ConvertTextureDescFrom16(Draw::TextureDesc &desc, int srcwidth, int srcheight, const uint16_t *overrideData = nullptr);
|
void ConvertTextureDescFrom16(Draw::TextureDesc &desc, int srcwidth, int srcheight, const uint16_t *overrideData = nullptr);
|
||||||
|
|
||||||
void BuildReportingInfo() override {}
|
void BuildReportingInfo() override {}
|
||||||
void PreExecuteOp(u32 op, u32 diff) override {}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void MarkDirty(uint32_t addr, uint32_t stride, uint32_t height, GEBufferFormat fmt, SoftGPUVRAMDirty value);
|
void MarkDirty(uint32_t addr, uint32_t stride, uint32_t height, GEBufferFormat fmt, SoftGPUVRAMDirty value);
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#include "Common/GPU/Vulkan/VulkanQueueRunner.h"
|
#include "Common/GPU/Vulkan/VulkanQueueRunner.h"
|
||||||
|
|
||||||
GPU_Vulkan::GPU_Vulkan(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
GPU_Vulkan::GPU_Vulkan(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
||||||
: GPUCommon(gfxCtx, draw), drawEngine_(draw) {
|
: GPUCommonHW(gfxCtx, draw), drawEngine_(draw) {
|
||||||
gstate_c.SetUseFlags(CheckGPUFeatures());
|
gstate_c.SetUseFlags(CheckGPUFeatures());
|
||||||
drawEngine_.InitDeviceObjects();
|
drawEngine_.InitDeviceObjects();
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "Common/File/Path.h"
|
#include "Common/File/Path.h"
|
||||||
|
|
||||||
#include "GPU/GPUCommon.h"
|
#include "GPU/GPUCommonHW.h"
|
||||||
#include "GPU/Vulkan/DrawEngineVulkan.h"
|
#include "GPU/Vulkan/DrawEngineVulkan.h"
|
||||||
#include "GPU/Vulkan/PipelineManagerVulkan.h"
|
#include "GPU/Vulkan/PipelineManagerVulkan.h"
|
||||||
#include "GPU/Common/TextureShaderCommon.h"
|
#include "GPU/Common/TextureShaderCommon.h"
|
||||||
@ -32,7 +32,7 @@ class ShaderManagerVulkan;
|
|||||||
class LinkedShader;
|
class LinkedShader;
|
||||||
class TextureCacheVulkan;
|
class TextureCacheVulkan;
|
||||||
|
|
||||||
class GPU_Vulkan : public GPUCommon {
|
class GPU_Vulkan : public GPUCommonHW {
|
||||||
public:
|
public:
|
||||||
GPU_Vulkan(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
|
GPU_Vulkan(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
|
||||||
~GPU_Vulkan();
|
~GPU_Vulkan();
|
||||||
|
@ -423,6 +423,7 @@
|
|||||||
<ClInclude Include="..\..\GPU\ge_constants.h" />
|
<ClInclude Include="..\..\GPU\ge_constants.h" />
|
||||||
<ClInclude Include="..\..\GPU\GPU.h" />
|
<ClInclude Include="..\..\GPU\GPU.h" />
|
||||||
<ClInclude Include="..\..\GPU\GPUCommon.h" />
|
<ClInclude Include="..\..\GPU\GPUCommon.h" />
|
||||||
|
<ClInclude Include="..\..\GPU\GPUCommonHW.h" />
|
||||||
<ClInclude Include="..\..\GPU\GPUInterface.h" />
|
<ClInclude Include="..\..\GPU\GPUInterface.h" />
|
||||||
<ClInclude Include="..\..\GPU\GPUState.h" />
|
<ClInclude Include="..\..\GPU\GPUState.h" />
|
||||||
<ClInclude Include="..\..\GPU\Math3D.h" />
|
<ClInclude Include="..\..\GPU\Math3D.h" />
|
||||||
@ -487,6 +488,7 @@
|
|||||||
<ClCompile Include="..\..\GPU\GeDisasm.cpp" />
|
<ClCompile Include="..\..\GPU\GeDisasm.cpp" />
|
||||||
<ClCompile Include="..\..\GPU\GPU.cpp" />
|
<ClCompile Include="..\..\GPU\GPU.cpp" />
|
||||||
<ClCompile Include="..\..\GPU\GPUCommon.cpp" />
|
<ClCompile Include="..\..\GPU\GPUCommon.cpp" />
|
||||||
|
<ClCompile Include="..\..\GPU\GPUCommonHW.cpp" />
|
||||||
<ClCompile Include="..\..\GPU\GPUState.cpp" />
|
<ClCompile Include="..\..\GPU\GPUState.cpp" />
|
||||||
<ClCompile Include="..\..\GPU\Math3D.cpp" />
|
<ClCompile Include="..\..\GPU\Math3D.cpp" />
|
||||||
<ClCompile Include="..\..\GPU\Software\BinManager.cpp" />
|
<ClCompile Include="..\..\GPU\Software\BinManager.cpp" />
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
<ClCompile Include="..\..\GPU\Common\Draw2D.cpp" />
|
<ClCompile Include="..\..\GPU\Common\Draw2D.cpp" />
|
||||||
<ClCompile Include="..\..\GPU\Common\TextureShaderCommon.cpp" />
|
<ClCompile Include="..\..\GPU\Common\TextureShaderCommon.cpp" />
|
||||||
<ClCompile Include="..\..\GPU\Common\DepthBufferCommon.cpp" />
|
<ClCompile Include="..\..\GPU\Common\DepthBufferCommon.cpp" />
|
||||||
|
<ClCompile Include="..\..\GPU\GPUCommonHW.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\GPU\Common\DepalettizeShaderCommon.h" />
|
<ClInclude Include="..\..\GPU\Common\DepalettizeShaderCommon.h" />
|
||||||
@ -123,5 +124,6 @@
|
|||||||
<ClInclude Include="..\..\GPU\Common\ReinterpretFramebuffer.h" />
|
<ClInclude Include="..\..\GPU\Common\ReinterpretFramebuffer.h" />
|
||||||
<ClInclude Include="..\..\GPU\Common\Draw2D.h" />
|
<ClInclude Include="..\..\GPU\Common\Draw2D.h" />
|
||||||
<ClInclude Include="..\..\GPU\Common\TextureShaderCommon.h" />
|
<ClInclude Include="..\..\GPU\Common\TextureShaderCommon.h" />
|
||||||
|
<ClInclude Include="..\..\GPU\GPUCommonHW.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@ -358,6 +358,7 @@ EXEC_AND_LIB_FILES := \
|
|||||||
$(SRC)/GPU/Math3D.cpp \
|
$(SRC)/GPU/Math3D.cpp \
|
||||||
$(SRC)/GPU/GPU.cpp \
|
$(SRC)/GPU/GPU.cpp \
|
||||||
$(SRC)/GPU/GPUCommon.cpp \
|
$(SRC)/GPU/GPUCommon.cpp \
|
||||||
|
$(SRC)/GPU/GPUCommonHW.cpp \
|
||||||
$(SRC)/GPU/GPUState.cpp \
|
$(SRC)/GPU/GPUState.cpp \
|
||||||
$(SRC)/GPU/GeConstants.cpp \
|
$(SRC)/GPU/GeConstants.cpp \
|
||||||
$(SRC)/GPU/GeDisasm.cpp \
|
$(SRC)/GPU/GeDisasm.cpp \
|
||||||
|
@ -406,6 +406,7 @@ SOURCES_CXX += \
|
|||||||
$(GPUDIR)/GeConstants.cpp \
|
$(GPUDIR)/GeConstants.cpp \
|
||||||
$(GPUDIR)/GeDisasm.cpp \
|
$(GPUDIR)/GeDisasm.cpp \
|
||||||
$(GPUDIR)/GPUCommon.cpp \
|
$(GPUDIR)/GPUCommon.cpp \
|
||||||
|
$(GPUDIR)/GPUCommonHW.cpp \
|
||||||
$(GPUDIR)/GPU.cpp \
|
$(GPUDIR)/GPU.cpp \
|
||||||
$(GPUDIR)/GPUState.cpp \
|
$(GPUDIR)/GPUState.cpp \
|
||||||
$(GPUDIR)/Math3D.cpp \
|
$(GPUDIR)/Math3D.cpp \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user