Some mostly empty files for D3D11

This commit is contained in:
Henrik Rydgard
2017-02-08 17:47:07 +01:00
parent 02e7d371bd
commit 01e11c6437
16 changed files with 341 additions and 6 deletions
+23 -1
View File
@@ -1156,13 +1156,35 @@ set(GPU_D3D9
GPU/Directx9/VertexShaderGeneratorDX9.h
)
set(GPU_D3D11
GPU/D3D11/DepalettizeShaderD3D11.cpp
GPU/D3D11/DepalettizeShaderD3D11.h
GPU/D3D11/DrawEngineD3D11.cpp
GPU/D3D11/DrawEngineD3D11.h
GPU/D3D11/FragmentShaderGeneratorD3D11.cpp
GPU/D3D11/FragmentShaderGeneratorD3D11.h
GPU/D3D11/FramebufferManagerD3D11.cpp
GPU/D3D11/FramebufferManagerD3D11.h
GPU/D3D11/GPU_D3D11.cpp
GPU/D3D11/GPU_D3D11.h
GPU/D3D11/ShaderManagerD3D11.cpp
GPU/D3D11/ShaderManagerD3D11.h
GPU/D3D11/StateMappingD3D11.cpp
GPU/D3D11/StateMappingD3D11.h
GPU/D3D11/TextureCacheD3D11.cpp
GPU/D3D11/TextureCacheD3D11.h
GPU/D3D11/TextureScalerD3D11.cpp
GPU/D3D11/TextureScalerD3D11.h
GPU/D3D11/VertexShaderGeneratorD3D11.cpp
GPU/D3D11/VertexShaderGeneratorD3D11.h
)
set(GPU_IMPLS ${GPU_GLES})
if(VULKAN)
set(GPU_IMPLS ${GPU_IMPLS} ${GPU_VULKAN})
endif()
if(WIN32)
list(APPEND GPU_IMPLS ${GPU_D3D9})
list(APPEND GPU_IMPLS ${GPU_D3D9} ${GPU_D3D11})
endif()
if(ARMV7 OR ARM64)
+20
View File
@@ -0,0 +1,20 @@
// Copyright (c) 2017- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
class DepalShaderCacheD3D11 {};
View File
+23
View File
@@ -0,0 +1,23 @@
// Copyright (c) 2017- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
class DrawEngineD3D11 {
public:
void Flush() {}
};
+17
View File
@@ -1,3 +1,20 @@
// Copyright (c) 2017- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
#include "GPU/Common/ShaderId.h"
+20
View File
@@ -0,0 +1,20 @@
// Copyright (c) 2017- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
class FramebufferManagerD3D11 {};
+18
View File
@@ -0,0 +1,18 @@
// Copyright (c) 2017- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "GPU/D3D11/GPU_D3D11.h"
+132
View File
@@ -0,0 +1,132 @@
// Copyright (c) 2017- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
#include <list>
#include <deque>
#include <d3d11.h>
#include "GPU/GPUCommon.h"
#include "GPU/D3D11/FramebufferManagerD3D11.h"
#include "GPU/D3D11/DrawEngineD3D11.h"
#include "GPU/D3D11/TextureCacheD3D11.h"
#include "GPU/D3D11/DepalettizeShaderD3D11.h"
#include "GPU/Common/VertexDecoderCommon.h"
namespace D3D11 {
class ShaderManagerD3D11;
class LinkedShaderD3D11;
class GPU_D3D11 : public GPUCommon {
public:
GPU_D3D11(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
~GPU_D3D11();
void CheckGPUFeatures();
void PreExecuteOp(u32 op, u32 diff) override;
void ExecuteOp(u32 op, u32 diff) override;
void ReapplyGfxStateInternal() override;
void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;
void BeginFrame() override;
void GetStats(char *buffer, size_t bufsize) override;
void ClearCacheNextFrame() override;
void DeviceLost() override; // Only happens on Android. Drop all textures and shaders.
void DeviceRestore() override;
void DumpNextFrame() override;
void DoState(PointerWrap &p) override;
void ClearShaderCache() override;
bool DecodeTexture(u8 *dest, const GPUgstate &state) override {
return false;
}
bool FramebufferDirty() override;
bool FramebufferReallyDirty() override;
void GetReportingInfo(std::string &primaryInfo, std::string &fullInfo) override {
primaryInfo = reportingPrimaryInfo_;
fullInfo = reportingFullInfo_;
}
std::vector<FramebufferInfo> GetFramebufferList() override;
bool GetCurrentFramebuffer(GPUDebugBuffer &buffer, GPUDebugFramebufferType type, int maxRes = -1) override;
bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer) override;
bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer) override;
bool GetCurrentTexture(GPUDebugBuffer &buffer, int level) override;
bool GetCurrentClut(GPUDebugBuffer &buffer) override;
bool GetOutputFramebuffer(GPUDebugBuffer &buffer) override;
bool GetCurrentSimpleVertices(int count, std::vector<GPUDebugVertex> &vertices, std::vector<u16> &indices) override;
typedef void (GPU_D3D11::*CmdFunc)(u32 op, u32 diff);
struct CommandInfo {
uint64_t flags;
GPU_D3D11::CmdFunc func;
};
void Execute_Prim(u32 op, u32 diff);
void Execute_Bezier(u32 op, u32 diff);
void Execute_Spline(u32 op, u32 diff);
void Execute_VertexType(u32 op, u32 diff);
void Execute_VertexTypeSkinning(u32 op, u32 diff);
void Execute_TexSize0(u32 op, u32 diff);
void Execute_LoadClut(u32 op, u32 diff);
// Using string because it's generic - makes no assumptions on the size of the shader IDs of this backend.
std::vector<std::string> DebugGetShaderIDs(DebugShaderType shader) override;
std::string DebugGetShaderString(std::string id, DebugShaderType shader, DebugShaderStringType stringType) override;
protected:
void FastRunLoop(DisplayList &list) override;
void FinishDeferred() override;
private:
void UpdateCmdInfo();
void Flush() {
drawEngine_.Flush();
}
// void ApplyDrawState(int prim);
void CheckFlushOp(int cmd, u32 diff);
void BuildReportingInfo();
void InitClearInternal() override;
void BeginFrameInternal() override;
void CopyDisplayToOutputInternal() override;
ID3D11Device *device_;
ID3D11DeviceContext *context_;
FramebufferManagerD3D11 *framebufferManagerD3D11_;
TextureCacheD3D11 *textureCacheD3D11_;
DepalShaderCacheD3D11 depalShaderCache_;
DrawEngineD3D11 drawEngine_;
ShaderManagerD3D11 *shaderManagerD3D11_;
static CommandInfo cmdInfo_[256];
int lastVsync_;
std::string reportingPrimaryInfo_;
std::string reportingFullInfo_;
};
} // namespace D3D11
typedef D3D11::GPU_D3D11 D3D11_GPU;
View File
+20
View File
@@ -0,0 +1,20 @@
// Copyright (c) 2017- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
class TextureCacheD3D11 {};
+17
View File
@@ -1,3 +1,20 @@
// Copyright (c) 2017- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
#include "GPU/Common/ShaderId.h"
+11 -2
View File
@@ -29,6 +29,7 @@
#if defined(_WIN32)
#include "GPU/Directx9/GPU_DX9.h"
#include "GPU/D3D11/GPU_D3D11.h"
#endif
GPUStatistics gpuStats;
@@ -59,10 +60,18 @@ bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *draw) {
case GPUCORE_DIRECTX9:
#if defined(_WIN32)
SetGPU(new DIRECTX9_GPU(ctx, draw));
#endif
break;
case GPUCORE_DIRECTX11:
#else
return false;
#endif
case GPUCORE_DIRECTX11:
#if defined(_WIN32)
// SetGPU(new D3D11_GPU(ctx, draw));
// break;
return false;
#else
return false;
#endif
case GPUCORE_VULKAN:
#ifndef NO_VULKAN
if (!ctx) {
+10
View File
@@ -203,8 +203,13 @@
<ClInclude Include="Common\TextureScalerCommon.h" />
<ClInclude Include="Common\TransformCommon.h" />
<ClInclude Include="Common\VertexDecoderCommon.h" />
<ClInclude Include="D3D11\DepalettizeShaderD3D11.h" />
<ClInclude Include="D3D11\DrawEngineD3D11.h" />
<ClInclude Include="D3D11\FragmentShaderGeneratorD3D11.h" />
<ClInclude Include="D3D11\FramebufferManagerD3D11.h" />
<ClInclude Include="D3D11\GPU_D3D11.h" />
<ClInclude Include="D3D11\ShaderManagerD3D11.h" />
<ClInclude Include="D3D11\TextureCacheD3D11.h" />
<ClInclude Include="D3D11\VertexShaderGeneratorD3D11.h" />
<ClInclude Include="Debugger\Breakpoints.h" />
<ClInclude Include="Debugger\Stepping.h" />
@@ -291,9 +296,14 @@
</ClCompile>
<ClCompile Include="Common\VertexDecoderCommon.cpp" />
<ClCompile Include="Common\VertexDecoderX86.cpp" />
<ClCompile Include="D3D11\DepalettizeShaderD3D11.cpp" />
<ClCompile Include="D3D11\DrawEngineD3D11.cpp" />
<ClCompile Include="D3D11\FragmentShaderGeneratorD3D11.cpp" />
<ClCompile Include="D3D11\FramebufferManagerD3D11.cpp" />
<ClCompile Include="D3D11\GPU_D3D11.cpp" />
<ClCompile Include="D3D11\ShaderManagerD3D11.cpp" />
<ClCompile Include="D3D11\StateMappingD3D11.cpp" />
<ClCompile Include="D3D11\TextureCacheD3D11.cpp" />
<ClCompile Include="D3D11\VertexShaderGeneratorD3D11.cpp" />
<ClCompile Include="Debugger\Breakpoints.cpp" />
<ClCompile Include="Debugger\Stepping.cpp" />
+30 -3
View File
@@ -16,9 +16,6 @@
<Filter Include="DirectX9">
<UniqueIdentifier>{88629970-4774-4122-b031-2128244b795c}</UniqueIdentifier>
</Filter>
<Filter Include="DirectX9\helper">
<UniqueIdentifier>{ba434472-5d5e-4b08-ab16-bfb7ec8e7068}</UniqueIdentifier>
</Filter>
<Filter Include="Debugger">
<UniqueIdentifier>{0cbddc00-4aa3-41d0-bed2-a454d37f838e}</UniqueIdentifier>
</Filter>
@@ -237,6 +234,21 @@
<ClInclude Include="D3D11\FragmentShaderGeneratorD3D11.h">
<Filter>D3D11</Filter>
</ClInclude>
<ClInclude Include="D3D11\TextureCacheD3D11.h">
<Filter>D3D11</Filter>
</ClInclude>
<ClInclude Include="D3D11\FramebufferManagerD3D11.h">
<Filter>D3D11</Filter>
</ClInclude>
<ClInclude Include="D3D11\GPU_D3D11.h">
<Filter>D3D11</Filter>
</ClInclude>
<ClInclude Include="D3D11\DrawEngineD3D11.h">
<Filter>D3D11</Filter>
</ClInclude>
<ClInclude Include="D3D11\DepalettizeShaderD3D11.h">
<Filter>D3D11</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Math3D.cpp">
@@ -458,5 +470,20 @@
<ClCompile Include="D3D11\FragmentShaderGeneratorD3D11.cpp">
<Filter>D3D11</Filter>
</ClCompile>
<ClCompile Include="D3D11\TextureCacheD3D11.cpp">
<Filter>D3D11</Filter>
</ClCompile>
<ClCompile Include="D3D11\FramebufferManagerD3D11.cpp">
<Filter>D3D11</Filter>
</ClCompile>
<ClCompile Include="D3D11\GPU_D3D11.cpp">
<Filter>D3D11</Filter>
</ClCompile>
<ClCompile Include="D3D11\DrawEngineD3D11.cpp">
<Filter>D3D11</Filter>
</ClCompile>
<ClCompile Include="D3D11\DepalettizeShaderD3D11.cpp">
<Filter>D3D11</Filter>
</ClCompile>
</ItemGroup>
</Project>