mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
GPU: Delete copy operations on classes that own resources
These own GPU objects, memory or refcounts in their destructors (or assert there that they were torn down), so a copy would double-free. Nothing copies them today; this keeps it that way. The manager base classes cover every backend's subclass. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
39049a67fd
commit
93f57a4f38
23 files changed
+70
No files matched your search
@@ -73,6 +73,8 @@ struct alignas(16) Plane8 {
|
||||
|
||||
class DrawEngineCommon {
|
||||
public:
|
||||
DrawEngineCommon(const DrawEngineCommon &) = delete;
|
||||
DrawEngineCommon &operator=(const DrawEngineCommon &) = delete;
|
||||
DrawEngineCommon();
|
||||
virtual ~DrawEngineCommon();
|
||||
|
||||
|
||||
@@ -291,6 +291,8 @@ struct DisplayLayoutConfig;
|
||||
|
||||
class FramebufferManagerCommon {
|
||||
public:
|
||||
FramebufferManagerCommon(const FramebufferManagerCommon &) = delete;
|
||||
FramebufferManagerCommon &operator=(const FramebufferManagerCommon &) = delete;
|
||||
FramebufferManagerCommon(Draw::DrawContext *draw);
|
||||
virtual ~FramebufferManagerCommon();
|
||||
|
||||
|
||||
@@ -80,6 +80,8 @@ ENUM_CLASS_BITOPS(OutputFlags);
|
||||
|
||||
class PresentationCommon {
|
||||
public:
|
||||
PresentationCommon(const PresentationCommon &) = delete;
|
||||
PresentationCommon &operator=(const PresentationCommon &) = delete;
|
||||
PresentationCommon(Draw::DrawContext *draw);
|
||||
~PresentationCommon();
|
||||
|
||||
|
||||
@@ -140,6 +140,8 @@ struct ReplacedTextureLevel {
|
||||
|
||||
class ReplacedTexture {
|
||||
public:
|
||||
ReplacedTexture(const ReplacedTexture &) = delete;
|
||||
ReplacedTexture &operator=(const ReplacedTexture &) = delete;
|
||||
ReplacedTexture(VFSBackend *vfs, const ReplacementDesc &desc);
|
||||
~ReplacedTexture();
|
||||
|
||||
|
||||
@@ -123,6 +123,8 @@ enum : uint64_t {
|
||||
|
||||
class ShaderManagerCommon {
|
||||
public:
|
||||
ShaderManagerCommon(const ShaderManagerCommon &) = delete;
|
||||
ShaderManagerCommon &operator=(const ShaderManagerCommon &) = delete;
|
||||
ShaderManagerCommon(Draw::DrawContext *draw) : draw_(draw) {}
|
||||
virtual ~ShaderManagerCommon() {}
|
||||
|
||||
|
||||
@@ -160,6 +160,9 @@ ENUM_CLASS_BITOPS(TexStatus);
|
||||
|
||||
// TODO: Shrink this struct. There is some fluff.
|
||||
struct TexCacheEntry {
|
||||
TexCacheEntry() = default;
|
||||
TexCacheEntry(const TexCacheEntry &) = delete;
|
||||
TexCacheEntry &operator=(const TexCacheEntry &) = delete;
|
||||
~TexCacheEntry() {
|
||||
#ifdef _DEBUG
|
||||
if (texturePtr || textureName || vkTex)
|
||||
@@ -338,6 +341,8 @@ struct TextureApplyResult {
|
||||
|
||||
class TextureCacheCommon {
|
||||
public:
|
||||
TextureCacheCommon(const TextureCacheCommon &) = delete;
|
||||
TextureCacheCommon &operator=(const TextureCacheCommon &) = delete;
|
||||
TextureCacheCommon(Draw::DrawContext *draw, Draw2D *draw2D);
|
||||
virtual ~TextureCacheCommon();
|
||||
|
||||
|
||||
@@ -76,6 +76,8 @@ enum class ReplacerDecimateMode {
|
||||
|
||||
class TextureReplacer {
|
||||
public:
|
||||
TextureReplacer(const TextureReplacer &) = delete;
|
||||
TextureReplacer &operator=(const TextureReplacer &) = delete;
|
||||
// The draw context is checked for supported texture formats.
|
||||
TextureReplacer(Draw::DrawContext *draw);
|
||||
~TextureReplacer();
|
||||
|
||||
@@ -37,6 +37,8 @@ class IOFile;
|
||||
|
||||
class LinkedShader {
|
||||
public:
|
||||
LinkedShader(const LinkedShader &) = delete;
|
||||
LinkedShader &operator=(const LinkedShader &) = delete;
|
||||
LinkedShader(GLRenderManager *render, VShaderID VSID, Shader *vs, FShaderID FSID, Shader *fs, bool useHWTransform, bool preloading = false);
|
||||
~LinkedShader();
|
||||
|
||||
@@ -139,6 +141,8 @@ struct ShaderDescGLES {
|
||||
|
||||
class Shader {
|
||||
public:
|
||||
Shader(const Shader &) = delete;
|
||||
Shader &operator=(const Shader &) = delete;
|
||||
Shader(GLRenderManager *render, const char *code, const std::string &desc, const ShaderDescGLES ¶ms);
|
||||
~Shader();
|
||||
GLRShader *shader;
|
||||
|
||||
@@ -56,6 +56,8 @@ inline bool IsTrianglePrim(GEPrimitiveType prim) {
|
||||
struct TransformStats;
|
||||
class GPUCommon {
|
||||
public:
|
||||
GPUCommon(const GPUCommon &) = delete;
|
||||
GPUCommon &operator=(const GPUCommon &) = delete;
|
||||
// The constructor might run on the loader thread.
|
||||
GPUCommon(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
|
||||
virtual ~GPUCommon() = default;
|
||||
|
||||
@@ -57,6 +57,8 @@ struct BinItem {
|
||||
|
||||
template <typename T, size_t N>
|
||||
struct BinQueue {
|
||||
BinQueue(const BinQueue &) = delete;
|
||||
BinQueue &operator=(const BinQueue &) = delete;
|
||||
BinQueue() {
|
||||
Reset();
|
||||
}
|
||||
@@ -185,6 +187,8 @@ struct BinDirtyRange {
|
||||
class StringWriter;
|
||||
class BinManager {
|
||||
public:
|
||||
BinManager(const BinManager &) = delete;
|
||||
BinManager &operator=(const BinManager &) = delete;
|
||||
BinManager();
|
||||
~BinManager();
|
||||
|
||||
|
||||
@@ -111,6 +111,8 @@ class StringWriter;
|
||||
|
||||
class TransformUnit {
|
||||
public:
|
||||
TransformUnit(const TransformUnit &) = delete;
|
||||
TransformUnit &operator=(const TransformUnit &) = delete;
|
||||
TransformUnit();
|
||||
~TransformUnit();
|
||||
|
||||
|
||||
@@ -63,6 +63,9 @@ private:
|
||||
|
||||
// Simply wraps a Vulkan pipeline, providing some metadata.
|
||||
struct VulkanPipeline {
|
||||
VulkanPipeline() = default;
|
||||
VulkanPipeline(const VulkanPipeline &) = delete;
|
||||
VulkanPipeline &operator=(const VulkanPipeline &) = delete;
|
||||
~VulkanPipeline() {
|
||||
desc->Release();
|
||||
}
|
||||
|
||||
@@ -40,6 +40,8 @@ class VulkanPushPool;
|
||||
|
||||
class VulkanFragmentShader {
|
||||
public:
|
||||
VulkanFragmentShader(const VulkanFragmentShader &) = delete;
|
||||
VulkanFragmentShader &operator=(const VulkanFragmentShader &) = delete;
|
||||
VulkanFragmentShader(VulkanContext *vulkan, FShaderID id, FragmentShaderFlags flags, const char *code, SPIRVCache *cache);
|
||||
~VulkanFragmentShader();
|
||||
|
||||
@@ -63,6 +65,8 @@ protected:
|
||||
|
||||
class VulkanVertexShader {
|
||||
public:
|
||||
VulkanVertexShader(const VulkanVertexShader &) = delete;
|
||||
VulkanVertexShader &operator=(const VulkanVertexShader &) = delete;
|
||||
VulkanVertexShader(VulkanContext *vulkan, VShaderID id, VertexShaderFlags flags, const char *code, bool useHWTransform, SPIRVCache *cache);
|
||||
~VulkanVertexShader();
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ class StringWriter;
|
||||
|
||||
class SamplerCache {
|
||||
public:
|
||||
SamplerCache(const SamplerCache &) = delete;
|
||||
SamplerCache &operator=(const SamplerCache &) = delete;
|
||||
SamplerCache(VulkanContext *vulkan) : vulkan_(vulkan), cache_(16) {}
|
||||
~SamplerCache();
|
||||
VkSampler GetOrCreateSampler(const SamplerCacheKey &key);
|
||||
|
||||
Reference in new issue
Block a user