placement new is allowed for gfx objects

This commit is contained in:
Turánszki János
2025-11-24 09:28:43 +01:00
parent 40f862135b
commit 90e94ed473
+11 -11
View File
@@ -886,13 +886,13 @@ namespace wi::graphics
constexpr const GPUBufferDesc& GetDesc() const { return desc; }
// Dynamic allocation and destruction of this object is not allowed because virtual table is not used
// Dynamic allocation and destruction of this object is not allowed because virtual table is not used. Placement new is allowed.
static void* operator new (size_t) = delete;
static void* operator new[] (size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete (void*) = delete;
static void operator delete[] (void*) = delete;
static void* operator new (size_t, void*) = delete;
static void* operator new[](size_t, void*) = delete;
static void operator delete[](void*) = delete;
static void* operator new(size_t, void* p) noexcept { return p; }
static void* operator new[](size_t, void* p) noexcept { return p; }
};
struct Texture final : public GPUResource
@@ -914,13 +914,13 @@ namespace wi::graphics
constexpr const TextureDesc& GetDesc() const { return desc; }
// Dynamic allocation and destruction of this object is not allowed because virtual table is not used
// Dynamic allocation and destruction of this object is not allowed because virtual table is not used. Placement new is allowed.
static void* operator new (size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete (void*) = delete;
static void operator delete[](void*) = delete;
static void* operator new (size_t, void*) = delete;
static void* operator new[](size_t, void*) = delete;
static void* operator new(size_t, void* p) noexcept { return p; }
static void* operator new[](size_t, void* p) noexcept { return p; }
};
struct VideoDecoder
@@ -1284,13 +1284,13 @@ namespace wi::graphics
constexpr const RaytracingAccelerationStructureDesc& GetDesc() const { return desc; }
// Dynamic allocation and destruction of this object is not allowed because virtual table is not used
// Dynamic allocation and destruction of this object is not allowed because virtual table is not used. Placement new is allowed.
static void* operator new (size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete (void*) = delete;
static void operator delete[](void*) = delete;
static void* operator new (size_t, void*) = delete;
static void* operator new[](size_t, void*) = delete;
static void* operator new(size_t, void* p) noexcept { return p; }
static void* operator new[](size_t, void* p) noexcept { return p; }
};
struct ShaderLibrary