From acf2f3adbac07ff91d280e9e2358d4bead0f0e67 Mon Sep 17 00:00:00 2001 From: Jamie Madill Date: Tue, 21 Nov 2017 19:22:44 -0500 Subject: [PATCH] Apply Chromium style fixes. This addresses several minor code quality issues that are validated in Chromium, but not yet applied to ANGLE: * constructors and destructors must be defined out-of-line * auto is not allowed for simple pointer types * use override everywhere instead of virtual * virtual functions must also be defined out-of-line Slightly reduces binary size for me (~2k on Win, 150k on Linux). Bug: angleproject:1569 Change-Id: I073ca3365188caf5f29fb28d9eb207903c1843e6 Reviewed-on: https://chromium-review.googlesource.com/779959 Commit-Queue: Jamie Madill Reviewed-by: Jamie Madill --- src/compiler/preprocessor/DirectiveParser.cpp | 4 + src/compiler/preprocessor/DirectiveParser.h | 1 + src/compiler/preprocessor/Input.cpp | 4 + src/compiler/preprocessor/Input.h | 1 + src/compiler/preprocessor/Macro.cpp | 8 ++ src/compiler/preprocessor/Macro.h | 3 +- src/compiler/preprocessor/MacroExpander.cpp | 4 + src/compiler/preprocessor/MacroExpander.h | 1 + src/compiler/preprocessor/Tokenizer.h | 2 +- src/compiler/translator/Cache.cpp | 4 + src/compiler/translator/Cache.h | 2 +- src/compiler/translator/Types.cpp | 6 ++ src/compiler/translator/Types.h | 3 +- src/compiler/translator/blocklayoutHLSL.h | 24 ++--- src/gpu_info_util/SystemInfo.cpp | 12 +++ src/gpu_info_util/SystemInfo.h | 10 ++ src/image_util/loadimage_etc.cpp | 11 ++- src/libANGLE/AttributeMap.cpp | 4 + src/libANGLE/AttributeMap.h | 2 + src/libANGLE/BinaryStream.h | 12 ++- src/libANGLE/Caps.cpp | 11 +++ src/libANGLE/Caps.h | 6 ++ src/libANGLE/Config.cpp | 16 ++++ src/libANGLE/Config.h | 10 +- src/libANGLE/Context.cpp | 4 +- src/libANGLE/ContextState.cpp | 4 + src/libANGLE/ContextState.h | 2 +- src/libANGLE/Debug.cpp | 24 +++++ src/libANGLE/Debug.h | 9 ++ src/libANGLE/Display.cpp | 8 ++ src/libANGLE/Display.h | 3 + src/libANGLE/Error.h | 2 + src/libANGLE/Fence.cpp | 5 + src/libANGLE/Fence.h | 4 +- src/libANGLE/Framebuffer.h | 2 +- src/libANGLE/HandleRangeAllocator.cpp | 4 + src/libANGLE/HandleRangeAllocator.h | 1 + src/libANGLE/Image.cpp | 6 +- src/libANGLE/Image.h | 5 +- src/libANGLE/ImageIndex.cpp | 2 + src/libANGLE/ImageIndex.h | 2 + src/libANGLE/IndexRangeCache.cpp | 8 ++ src/libANGLE/IndexRangeCache.h | 3 + src/libANGLE/LoggingAnnotator.cpp | 5 + src/libANGLE/LoggingAnnotator.h | 2 +- src/libANGLE/MemoryProgramCache.cpp | 6 +- src/libANGLE/Program.cpp | 38 +++++++- src/libANGLE/Program.h | 23 ++--- src/libANGLE/ProgramLinkedResources.cpp | 2 + src/libANGLE/ProgramLinkedResources.h | 5 +- src/libANGLE/ProgramPipeline.cpp | 5 + src/libANGLE/ProgramPipeline.h | 2 +- src/libANGLE/Query.h | 2 +- src/libANGLE/RefCountObject.h | 14 ++- src/libANGLE/Renderbuffer.cpp | 15 +++ src/libANGLE/Renderbuffer.h | 15 +-- src/libANGLE/ResourceManager.cpp | 10 +- src/libANGLE/ResourceManager.h | 4 + src/libANGLE/Sampler.cpp | 5 + src/libANGLE/Sampler.h | 2 +- src/libANGLE/Shader.h | 2 +- src/libANGLE/State.h | 2 +- src/libANGLE/Surface.cpp | 5 + src/libANGLE/Surface.h | 4 +- src/libANGLE/Texture.cpp | 4 + src/libANGLE/Texture.h | 1 + src/libANGLE/TransformFeedback.cpp | 4 + src/libANGLE/TransformFeedback.h | 3 +- src/libANGLE/Uniform.cpp | 2 + src/libANGLE/Uniform.h | 7 +- src/libANGLE/VaryingPacking.cpp | 2 + src/libANGLE/VaryingPacking.h | 1 + src/libANGLE/VertexArray.h | 2 +- src/libANGLE/VertexAttribute.cpp | 4 + src/libANGLE/VertexAttribute.h | 1 + src/libANGLE/angletypes.cpp | 11 +++ src/libANGLE/angletypes.h | 8 +- src/libANGLE/formatutils.cpp | 2 + src/libANGLE/formatutils.h | 1 + src/libANGLE/params.cpp | 5 + src/libANGLE/params.h | 5 +- src/libANGLE/renderer/ContextImpl.h | 2 +- src/libANGLE/renderer/DisplayImpl.h | 2 +- .../FramebufferAttachmentObjectImpl.h | 30 ++++-- src/libANGLE/renderer/RenderbufferImpl.h | 8 +- src/libANGLE/renderer/SurfaceImpl.h | 2 +- src/libANGLE/renderer/TextureImpl.cpp | 5 + src/libANGLE/renderer/TextureImpl.h | 4 +- src/libANGLE/renderer/d3d/BufferD3D.cpp | 4 +- src/libANGLE/renderer/d3d/BufferD3D.h | 2 +- src/libANGLE/renderer/d3d/CompilerD3D.cpp | 10 ++ src/libANGLE/renderer/d3d/CompilerD3D.h | 4 +- src/libANGLE/renderer/d3d/DeviceD3D.cpp | 4 + src/libANGLE/renderer/d3d/DeviceD3D.h | 2 +- src/libANGLE/renderer/d3d/DisplayD3D.cpp | 6 +- src/libANGLE/renderer/d3d/DisplayD3D.h | 2 +- src/libANGLE/renderer/d3d/DynamicHLSL.cpp | 7 ++ src/libANGLE/renderer/d3d/DynamicHLSL.h | 4 + src/libANGLE/renderer/d3d/FramebufferD3D.cpp | 4 + src/libANGLE/renderer/d3d/FramebufferD3D.h | 5 +- src/libANGLE/renderer/d3d/ImageD3D.cpp | 30 ++++++ src/libANGLE/renderer/d3d/ImageD3D.h | 20 +--- src/libANGLE/renderer/d3d/IndexBuffer.h | 4 +- src/libANGLE/renderer/d3d/ProgramD3D.cpp | 2 +- src/libANGLE/renderer/d3d/ProgramD3D.h | 2 +- src/libANGLE/renderer/d3d/RenderTargetD3D.h | 2 +- src/libANGLE/renderer/d3d/RenderbufferD3D.h | 2 +- src/libANGLE/renderer/d3d/RendererD3D.h | 2 +- src/libANGLE/renderer/d3d/ShaderD3D.h | 2 +- src/libANGLE/renderer/d3d/TextureD3D.h | 18 ++-- src/libANGLE/renderer/d3d/TextureStorage.h | 21 +++-- src/libANGLE/renderer/d3d/VertexBuffer.h | 4 +- .../renderer/d3d/VertexDataManager.cpp | 2 + src/libANGLE/renderer/d3d/VertexDataManager.h | 1 + src/libANGLE/renderer/d3d/d3d11/Blit11.cpp | 16 +++- src/libANGLE/renderer/d3d/d3d11/Blit11.h | 5 + src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp | 7 +- src/libANGLE/renderer/d3d/d3d11/Buffer11.h | 4 +- src/libANGLE/renderer/d3d/d3d11/Clear11.cpp | 2 +- .../renderer/d3d/d3d11/Framebuffer11.cpp | 8 +- .../renderer/d3d/d3d11/Framebuffer11.h | 2 +- src/libANGLE/renderer/d3d/d3d11/Image11.h | 2 +- .../renderer/d3d/d3d11/IndexBuffer11.h | 16 ++-- .../renderer/d3d/d3d11/InputLayoutCache.cpp | 2 + .../renderer/d3d/d3d11/InputLayoutCache.h | 1 + .../renderer/d3d/d3d11/PixelTransfer11.cpp | 2 +- .../renderer/d3d/d3d11/RenderTarget11.h | 6 +- .../renderer/d3d/d3d11/Renderer11.cpp | 15 ++- src/libANGLE/renderer/d3d/d3d11/Renderer11.h | 6 +- .../renderer/d3d/d3d11/ShaderExecutable11.h | 4 +- .../renderer/d3d/d3d11/StateManager11.cpp | 22 ++++- .../renderer/d3d/d3d11/StateManager11.h | 4 +- .../renderer/d3d/d3d11/SwapChain11.cpp | 17 +++- src/libANGLE/renderer/d3d/d3d11/SwapChain11.h | 8 +- .../renderer/d3d/d3d11/TextureStorage11.cpp | 8 +- .../renderer/d3d/d3d11/TextureStorage11.h | 5 +- .../renderer/d3d/d3d11/VertexArray11.cpp | 6 +- .../renderer/d3d/d3d11/VertexArray11.h | 1 + .../renderer/d3d/d3d11/renderer11_utils.cpp | 13 +++ .../renderer/d3d/d3d11/renderer11_utils.h | 22 ++--- src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp | 10 ++ src/libANGLE/renderer/d3d/d3d9/Buffer9.h | 6 +- src/libANGLE/renderer/d3d/d3d9/Framebuffer9.h | 2 +- src/libANGLE/renderer/d3d/d3d9/Image9.h | 2 +- src/libANGLE/renderer/d3d/d3d9/IndexBuffer9.h | 16 ++-- src/libANGLE/renderer/d3d/d3d9/Query9.h | 18 ++-- .../renderer/d3d/d3d9/RenderTarget9.h | 6 +- src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp | 16 +++- src/libANGLE/renderer/d3d/d3d9/Renderer9.h | 6 +- .../renderer/d3d/d3d9/ShaderExecutable9.h | 2 +- src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp | 9 ++ src/libANGLE/renderer/d3d/d3d9/SwapChain9.h | 6 +- .../renderer/d3d/d3d9/TextureStorage9.cpp | 2 +- .../renderer/d3d/d3d9/TextureStorage9.h | 4 +- src/libANGLE/renderer/d3d/d3d9/VertexArray9.h | 15 +-- .../renderer/d3d/d3d9/formatutils9.cpp | 94 +++++++++---------- src/libANGLE/renderer/d3d/d3d9/formatutils9.h | 24 ++--- src/libANGLE/renderer/gl/ClearMultiviewGL.cpp | 22 ++--- src/libANGLE/renderer/gl/CompilerGL.cpp | 10 ++ src/libANGLE/renderer/gl/CompilerGL.h | 4 +- src/libANGLE/renderer/gl/FunctionsGL.h | 4 +- src/libANGLE/renderer/gl/PathGL.h | 2 +- src/libANGLE/renderer/gl/QueryGL.cpp | 4 +- src/libANGLE/renderer/gl/RenderbufferGL.h | 21 ++--- src/libANGLE/renderer/gl/StateManagerGL.cpp | 4 + src/libANGLE/renderer/gl/StateManagerGL.h | 1 + src/libANGLE/renderer/gl/VertexArrayGL.cpp | 4 + src/libANGLE/renderer/gl/VertexArrayGL.h | 2 + src/libANGLE/renderer/gl/WorkaroundsGL.h | 5 + src/libANGLE/renderer/gl/formatutilsgl.cpp | 12 +++ src/libANGLE/renderer/gl/formatutilsgl.h | 4 + src/libANGLE/renderer/gl/wgl/FunctionsWGL.cpp | 4 + src/libANGLE/renderer/gl/wgl/FunctionsWGL.h | 1 + src/libANGLE/renderer/vulkan/BufferVk.cpp | 2 +- src/libANGLE/renderer/vulkan/ContextVk.cpp | 10 +- src/libANGLE/renderer/vulkan/ProgramVk.cpp | 4 + src/libANGLE/renderer/vulkan/ProgramVk.h | 1 + src/libANGLE/renderer/vulkan/RendererVk.cpp | 2 +- src/libANGLE/renderer/vulkan/SurfaceVk.cpp | 6 +- src/libANGLE/renderer/vulkan/SurfaceVk.h | 4 + .../renderer/vulkan/VertexArrayVk.cpp | 6 +- src/libANGLE/renderer/vulkan/VertexArrayVk.h | 2 + src/libANGLE/validationES.cpp | 4 +- src/libANGLE/validationES2.cpp | 2 +- src/libANGLE/validationES3.cpp | 2 +- util/OSWindow.cpp | 5 + util/OSWindow.h | 2 +- util/geometry_utils.cpp | 16 ++++ util/geometry_utils.h | 6 ++ 189 files changed, 956 insertions(+), 373 deletions(-) diff --git a/src/compiler/preprocessor/DirectiveParser.cpp b/src/compiler/preprocessor/DirectiveParser.cpp index 9cda72027..f6c576399 100644 --- a/src/compiler/preprocessor/DirectiveParser.cpp +++ b/src/compiler/preprocessor/DirectiveParser.cpp @@ -215,6 +215,10 @@ DirectiveParser::DirectiveParser(Tokenizer *tokenizer, { } +DirectiveParser::~DirectiveParser() +{ +} + void DirectiveParser::lex(Token *token) { do diff --git a/src/compiler/preprocessor/DirectiveParser.h b/src/compiler/preprocessor/DirectiveParser.h index 4229cba5a..29c30a823 100644 --- a/src/compiler/preprocessor/DirectiveParser.h +++ b/src/compiler/preprocessor/DirectiveParser.h @@ -26,6 +26,7 @@ class DirectiveParser : public Lexer Diagnostics *diagnostics, DirectiveHandler *directiveHandler, int maxMacroExpansionDepth); + ~DirectiveParser() override; void lex(Token *token) override; diff --git a/src/compiler/preprocessor/Input.cpp b/src/compiler/preprocessor/Input.cpp index 3a473f779..0f2327b82 100644 --- a/src/compiler/preprocessor/Input.cpp +++ b/src/compiler/preprocessor/Input.cpp @@ -18,6 +18,10 @@ Input::Input() : mCount(0), mString(0) { } +Input::~Input() +{ +} + Input::Input(size_t count, const char *const string[], const int length[]) : mCount(count), mString(string) { diff --git a/src/compiler/preprocessor/Input.h b/src/compiler/preprocessor/Input.h index d5f385832..8c7c7ee19 100644 --- a/src/compiler/preprocessor/Input.h +++ b/src/compiler/preprocessor/Input.h @@ -18,6 +18,7 @@ class Input { public: Input(); + ~Input(); Input(size_t count, const char *const string[], const int length[]); size_t count() const { return mCount; } diff --git a/src/compiler/preprocessor/Macro.cpp b/src/compiler/preprocessor/Macro.cpp index 6162767da..52e2312fe 100644 --- a/src/compiler/preprocessor/Macro.cpp +++ b/src/compiler/preprocessor/Macro.cpp @@ -12,6 +12,14 @@ namespace pp { +Macro::Macro() : predefined(false), disabled(false), expansionCount(0), type(kTypeObj) +{ +} + +Macro::~Macro() +{ +} + bool Macro::equals(const Macro &other) const { return (type == other.type) && (name == other.name) && (parameters == other.parameters) && diff --git a/src/compiler/preprocessor/Macro.h b/src/compiler/preprocessor/Macro.h index f835c42e6..c42e172ef 100644 --- a/src/compiler/preprocessor/Macro.h +++ b/src/compiler/preprocessor/Macro.h @@ -27,7 +27,8 @@ struct Macro typedef std::vector Parameters; typedef std::vector Replacements; - Macro() : predefined(false), disabled(false), expansionCount(0), type(kTypeObj) {} + Macro(); + ~Macro(); bool equals(const Macro &other) const; bool predefined; diff --git a/src/compiler/preprocessor/MacroExpander.cpp b/src/compiler/preprocessor/MacroExpander.cpp index cc115f911..d88d3a685 100644 --- a/src/compiler/preprocessor/MacroExpander.cpp +++ b/src/compiler/preprocessor/MacroExpander.cpp @@ -458,6 +458,10 @@ MacroExpander::MacroContext::MacroContext() : macro(0), index(0) { } +MacroExpander::MacroContext::~MacroContext() +{ +} + bool MacroExpander::MacroContext::empty() const { return index == replacements.size(); diff --git a/src/compiler/preprocessor/MacroExpander.h b/src/compiler/preprocessor/MacroExpander.h index 7a4f5a9c2..fae7676fb 100644 --- a/src/compiler/preprocessor/MacroExpander.h +++ b/src/compiler/preprocessor/MacroExpander.h @@ -52,6 +52,7 @@ class MacroExpander : public Lexer struct MacroContext { MacroContext(); + ~MacroContext(); bool empty() const; const Token &get(); void unget(); diff --git a/src/compiler/preprocessor/Tokenizer.h b/src/compiler/preprocessor/Tokenizer.h index ce030a15c..af4fd7ce7 100644 --- a/src/compiler/preprocessor/Tokenizer.h +++ b/src/compiler/preprocessor/Tokenizer.h @@ -34,7 +34,7 @@ class Tokenizer : public Lexer }; Tokenizer(Diagnostics *diagnostics); - ~Tokenizer(); + ~Tokenizer() override; bool init(size_t count, const char *const string[], const int length[]); diff --git a/src/compiler/translator/Cache.cpp b/src/compiler/translator/Cache.cpp index 07cc5b244..417e82403 100644 --- a/src/compiler/translator/Cache.cpp +++ b/src/compiler/translator/Cache.cpp @@ -57,6 +57,10 @@ TCache::TypeKey::TypeKey(TBasicType basicType, TCache *TCache::sCache = nullptr; +TCache::TCache() +{ +} + void TCache::initialize() { if (sCache == nullptr) diff --git a/src/compiler/translator/Cache.h b/src/compiler/translator/Cache.h index a45ada487..a182b07f5 100644 --- a/src/compiler/translator/Cache.h +++ b/src/compiler/translator/Cache.h @@ -49,7 +49,7 @@ class TCache unsigned char secondarySize); private: - TCache() {} + TCache(); union TypeKey { TypeKey(TBasicType basicType, diff --git a/src/compiler/translator/Types.cpp b/src/compiler/translator/Types.cpp index d54196fae..04e885aa1 100644 --- a/src/compiler/translator/Types.cpp +++ b/src/compiler/translator/Types.cpp @@ -223,6 +223,12 @@ TType::TType(TInterfaceBlock *interfaceBlockIn, { } +TType::TType(const TType &) = default; + +TType::~TType() +{ +} + bool TType::canBeConstructed() const { switch (type) diff --git a/src/compiler/translator/Types.h b/src/compiler/translator/Types.h index fe9f25cce..0ca83c758 100644 --- a/src/compiler/translator/Types.h +++ b/src/compiler/translator/Types.h @@ -194,8 +194,9 @@ class TType TType(TInterfaceBlock *interfaceBlockIn, TQualifier qualifierIn, TLayoutQualifier layoutQualifierIn); + ~TType(); - TType(const TType &) = default; + TType(const TType &); TType &operator=(const TType &) = default; TBasicType getBasicType() const { return type; } diff --git a/src/compiler/translator/blocklayoutHLSL.h b/src/compiler/translator/blocklayoutHLSL.h index a0220dccb..d1a98c8ef 100644 --- a/src/compiler/translator/blocklayoutHLSL.h +++ b/src/compiler/translator/blocklayoutHLSL.h @@ -35,8 +35,8 @@ class HLSLBlockEncoder : public BlockLayoutEncoder HLSLBlockEncoder(HLSLBlockEncoderStrategy strategy, bool transposeMatrices); - virtual void enterAggregateType(); - virtual void exitAggregateType(); + void enterAggregateType() override; + void exitAggregateType() override; void skipRegisters(unsigned int numRegisters); bool isPacked() const { return mEncoderStrategy == ENCODE_PACKED; } @@ -44,16 +44,16 @@ class HLSLBlockEncoder : public BlockLayoutEncoder static HLSLBlockEncoderStrategy GetStrategyFor(ShShaderOutput outputType); protected: - virtual void getBlockLayoutInfo(GLenum type, - unsigned int arraySize, - bool isRowMajorMatrix, - int *arrayStrideOut, - int *matrixStrideOut); - virtual void advanceOffset(GLenum type, - unsigned int arraySize, - bool isRowMajorMatrix, - int arrayStride, - int matrixStride); + void getBlockLayoutInfo(GLenum type, + unsigned int arraySize, + bool isRowMajorMatrix, + int *arrayStrideOut, + int *matrixStrideOut) override; + void advanceOffset(GLenum type, + unsigned int arraySize, + bool isRowMajorMatrix, + int arrayStride, + int matrixStride) override; HLSLBlockEncoderStrategy mEncoderStrategy; bool mTransposeMatrices; diff --git a/src/gpu_info_util/SystemInfo.cpp b/src/gpu_info_util/SystemInfo.cpp index dd384c66d..f8d744342 100644 --- a/src/gpu_info_util/SystemInfo.cpp +++ b/src/gpu_info_util/SystemInfo.cpp @@ -17,6 +17,18 @@ namespace angle { +GPUDeviceInfo::GPUDeviceInfo() = default; + +GPUDeviceInfo::~GPUDeviceInfo() = default; + +GPUDeviceInfo::GPUDeviceInfo(const GPUDeviceInfo &other) = default; + +SystemInfo::SystemInfo() = default; + +SystemInfo::~SystemInfo() = default; + +SystemInfo::SystemInfo(const SystemInfo &other) = default; + bool IsAMD(VendorID vendorId) { return vendorId == kVendorID_AMD; diff --git a/src/gpu_info_util/SystemInfo.h b/src/gpu_info_util/SystemInfo.h index 81df6d3fe..ada43f0a1 100644 --- a/src/gpu_info_util/SystemInfo.h +++ b/src/gpu_info_util/SystemInfo.h @@ -26,6 +26,11 @@ constexpr VendorID kVendorID_Qualcomm = 0x5143; struct GPUDeviceInfo { + GPUDeviceInfo(); + ~GPUDeviceInfo(); + + GPUDeviceInfo(const GPUDeviceInfo &other); + VendorID vendorId = 0; DeviceID deviceId = 0; @@ -36,6 +41,11 @@ struct GPUDeviceInfo struct SystemInfo { + SystemInfo(); + ~SystemInfo(); + + SystemInfo(const SystemInfo &other); + std::vector gpus; int primaryGPUIndex = -1; int activeGPUIndex = -1; diff --git a/src/image_util/loadimage_etc.cpp b/src/image_util/loadimage_etc.cpp index 7c7e8dd5e..67f73837c 100644 --- a/src/image_util/loadimage_etc.cpp +++ b/src/image_util/loadimage_etc.cpp @@ -16,9 +16,12 @@ namespace angle { namespace { + +using IntensityModifier = const int[4]; + // Table 3.17.2 sorted according to table 3.17.3 // clang-format off -static const int intensityModifierDefault[][4] = +static IntensityModifier intensityModifierDefault[] = { { 2, 8, -2, -8 }, { 5, 17, -5, -17 }, @@ -33,7 +36,7 @@ static const int intensityModifierDefault[][4] = // Table C.12, intensity modifier for non opaque punchthrough alpha // clang-format off -static const int intensityModifierNonOpaque[][4] = +static IntensityModifier intensityModifierNonOpaque[] = { { 0, 8, 0, -8 }, { 0, 17, 0, -17 }, @@ -400,7 +403,7 @@ struct ETC2Block const uint8_t alphaValues[4][4], bool nonOpaquePunchThroughAlpha) const { - const auto intensityModifier = + const IntensityModifier *intensityModifier = nonOpaquePunchThroughAlpha ? intensityModifierNonOpaque : intensityModifierDefault; R8G8B8A8 subblockColors0[4]; @@ -1078,7 +1081,7 @@ struct ETC2Block static const size_t kNumColors = 8; - const auto intensityModifier = + const IntensityModifier *intensityModifier = nonOpaquePunchThroughAlpha ? intensityModifierNonOpaque : intensityModifierDefault; // Compute the colors that pixels can have in each subblock both for diff --git a/src/libANGLE/AttributeMap.cpp b/src/libANGLE/AttributeMap.cpp index d90f596f4..e10d3add7 100644 --- a/src/libANGLE/AttributeMap.cpp +++ b/src/libANGLE/AttributeMap.cpp @@ -15,6 +15,10 @@ AttributeMap::AttributeMap() { } +AttributeMap::AttributeMap(const AttributeMap &other) = default; + +AttributeMap::~AttributeMap() = default; + void AttributeMap::insert(EGLAttrib key, EGLAttrib value) { mAttributes[key] = value; diff --git a/src/libANGLE/AttributeMap.h b/src/libANGLE/AttributeMap.h index 6c1245866..eddc1b72d 100644 --- a/src/libANGLE/AttributeMap.h +++ b/src/libANGLE/AttributeMap.h @@ -20,6 +20,8 @@ class AttributeMap final { public: AttributeMap(); + AttributeMap(const AttributeMap &other); + ~AttributeMap(); void insert(EGLAttrib key, EGLAttrib value); bool contains(EGLAttrib key) const; diff --git a/src/libANGLE/BinaryStream.h b/src/libANGLE/BinaryStream.h index c42381f0f..3e4c0934c 100644 --- a/src/libANGLE/BinaryStream.h +++ b/src/libANGLE/BinaryStream.h @@ -180,9 +180,8 @@ class BinaryInputStream : angle::NonCopyable class BinaryOutputStream : angle::NonCopyable { public: - BinaryOutputStream() - { - } + BinaryOutputStream(); + ~BinaryOutputStream(); // writeInt also handles bool types template @@ -250,6 +249,13 @@ class BinaryOutputStream : angle::NonCopyable } }; + +inline BinaryOutputStream::BinaryOutputStream() +{ +} + +inline BinaryOutputStream::~BinaryOutputStream() = default; + } // namespace gl #endif // LIBANGLE_BINARYSTREAM_H_ diff --git a/src/libANGLE/Caps.cpp b/src/libANGLE/Caps.cpp index 5a78d8d7d..44da2bbe2 100644 --- a/src/libANGLE/Caps.cpp +++ b/src/libANGLE/Caps.cpp @@ -35,6 +35,10 @@ TextureCaps::TextureCaps() { } +TextureCaps::TextureCaps(const TextureCaps &other) = default; + +TextureCaps::~TextureCaps() = default; + GLuint TextureCaps::getMaxSamples() const { return !sampleCounts.empty() ? *sampleCounts.rbegin() : 0; @@ -708,6 +712,8 @@ TypePrecision::TypePrecision() : range({{0, 0}}), precision(0) { } +TypePrecision::TypePrecision(const TypePrecision &other) = default; + void TypePrecision::setIEEEFloat() { range = {{127, 127}}; @@ -852,6 +858,9 @@ Caps::Caps() } } +Caps::Caps(const Caps &other) = default; +Caps::~Caps() = default; + Caps GenerateMinimumCaps(const Version &clientVersion, const Extensions &extensions) { Caps caps; @@ -1175,6 +1184,8 @@ ClientExtensions::ClientExtensions() { } +ClientExtensions::ClientExtensions(const ClientExtensions &other) = default; + std::vector ClientExtensions::getStrings() const { std::vector extensionStrings; diff --git a/src/libANGLE/Caps.h b/src/libANGLE/Caps.h index 256959750..64bdf9711 100644 --- a/src/libANGLE/Caps.h +++ b/src/libANGLE/Caps.h @@ -28,6 +28,8 @@ typedef std::set SupportedSampleSet; struct TextureCaps { TextureCaps(); + TextureCaps(const TextureCaps &other); + ~TextureCaps(); // Supports for basic texturing: glTexImage, glTexSubImage, etc bool texturable; @@ -418,6 +420,7 @@ struct Limitations struct TypePrecision { TypePrecision(); + TypePrecision(const TypePrecision &other); void setIEEEFloat(); void setTwosComplementInt(unsigned int bits); @@ -433,6 +436,8 @@ struct TypePrecision struct Caps { Caps(); + Caps(const Caps &other); + ~Caps(); // ES 3.1 (April 29, 2015) 20.39: implementation dependent values GLuint64 maxElementIndex; @@ -703,6 +708,7 @@ struct DeviceExtensions struct ClientExtensions { ClientExtensions(); + ClientExtensions(const ClientExtensions &other); // Generate a vector of supported extension strings std::vector getStrings() const; diff --git a/src/libANGLE/Config.cpp b/src/libANGLE/Config.cpp index 5bbd112e9..ccf64c8f8 100644 --- a/src/libANGLE/Config.cpp +++ b/src/libANGLE/Config.cpp @@ -63,6 +63,22 @@ Config::Config() { } +Config::~Config() +{ +} + +Config::Config(const Config &other) = default; + +Config &Config::operator=(const Config &other) = default; + +ConfigSet::ConfigSet() = default; + +ConfigSet::ConfigSet(const ConfigSet &other) = default; + +ConfigSet &ConfigSet::operator=(const ConfigSet &other) = default; + +ConfigSet::~ConfigSet() = default; + EGLint ConfigSet::add(const Config &config) { // Set the config's ID to a small number that starts at 1 ([EGL 1.5] section 3.4) diff --git a/src/libANGLE/Config.h b/src/libANGLE/Config.h index fb0147e69..f2fbe8b95 100644 --- a/src/libANGLE/Config.h +++ b/src/libANGLE/Config.h @@ -27,6 +27,9 @@ namespace egl struct Config { Config(); + ~Config(); + Config(const Config &other); + Config &operator=(const Config &other); GLenum renderTargetFormat; // TODO(geofflang): remove this GLenum depthStencilFormat; // TODO(geofflang): remove this @@ -71,6 +74,11 @@ struct Config class ConfigSet { public: + ConfigSet(); + ConfigSet(const ConfigSet &other); + ~ConfigSet(); + ConfigSet &operator=(const ConfigSet &other); + EGLint add(const Config &config); const Config &get(EGLint id) const; @@ -84,7 +92,7 @@ class ConfigSet std::vector filter(const AttributeMap &attributeMap) const; private: - typedef std::map ConfigMap; + typedef std::map ConfigMap; ConfigMap mConfigs; }; diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp index 930f6b6f0..6da22dab4 100644 --- a/src/libANGLE/Context.cpp +++ b/src/libANGLE/Context.cpp @@ -3936,8 +3936,8 @@ void Context::bufferSubData(BufferBinding target, void Context::attachShader(GLuint program, GLuint shader) { - auto programObject = mState.mShaderPrograms->getProgram(program); - auto shaderObject = mState.mShaderPrograms->getShader(shader); + Program *programObject = mState.mShaderPrograms->getProgram(program); + Shader *shaderObject = mState.mShaderPrograms->getShader(shader); ASSERT(programObject && shaderObject); programObject->attachShader(shaderObject); } diff --git a/src/libANGLE/ContextState.cpp b/src/libANGLE/ContextState.cpp index 174ffd0f1..d109cca76 100644 --- a/src/libANGLE/ContextState.cpp +++ b/src/libANGLE/ContextState.cpp @@ -136,6 +136,10 @@ ValidationContext::ValidationContext(const ValidationContext *shareContext, { } +ValidationContext::~ValidationContext() +{ +} + bool ValidationContext::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *numParams) { // Please note: the query type returned for DEPTH_CLEAR_VALUE in this implementation diff --git a/src/libANGLE/ContextState.h b/src/libANGLE/ContextState.h index 4c5e23e85..e6e9f4c6b 100644 --- a/src/libANGLE/ContextState.h +++ b/src/libANGLE/ContextState.h @@ -101,7 +101,7 @@ class ValidationContext : angle::NonCopyable const Extensions &extensions, const Limitations &limitations, bool skipValidation); - virtual ~ValidationContext() {} + virtual ~ValidationContext(); virtual void handleError(const Error &error) = 0; diff --git a/src/libANGLE/Debug.cpp b/src/libANGLE/Debug.cpp index 30321f416..96f30df98 100644 --- a/src/libANGLE/Debug.cpp +++ b/src/libANGLE/Debug.cpp @@ -16,6 +16,26 @@ namespace gl { +Debug::Control::Control() +{ +} + +Debug::Control::~Control() +{ +} + +Debug::Control::Control(const Control &other) = default; + +Debug::Group::Group() +{ +} + +Debug::Group::~Group() +{ +} + +Debug::Group::Group(const Group &other) = default; + Debug::Debug() : mOutputEnabled(false), mCallbackFunction(nullptr), @@ -28,6 +48,10 @@ Debug::Debug() pushDefaultGroup(); } +Debug::~Debug() +{ +} + void Debug::setMaxLoggedMessages(GLuint maxLoggedMessages) { mMaxLoggedMessages = maxLoggedMessages; diff --git a/src/libANGLE/Debug.h b/src/libANGLE/Debug.h index f545b815e..2c15c25e9 100644 --- a/src/libANGLE/Debug.h +++ b/src/libANGLE/Debug.h @@ -31,6 +31,7 @@ class Debug : angle::NonCopyable { public: Debug(); + ~Debug(); void setMaxLoggedMessages(GLuint maxLoggedMessages); @@ -91,6 +92,10 @@ class Debug : angle::NonCopyable struct Control { + Control(); + ~Control(); + Control(const Control &other); + GLenum source; GLenum type; GLenum severity; @@ -100,6 +105,10 @@ class Debug : angle::NonCopyable struct Group { + Group(); + ~Group(); + Group(const Group &other); + GLenum source; GLuint id; std::string message; diff --git a/src/libANGLE/Display.cpp b/src/libANGLE/Display.cpp index 879316bf1..735b47278 100644 --- a/src/libANGLE/Display.cpp +++ b/src/libANGLE/Display.cpp @@ -268,6 +268,14 @@ void ANGLESetDefaultDisplayPlatform(angle::EGLDisplayType display) } // anonymous namespace +DisplayState::DisplayState() +{ +} + +DisplayState::~DisplayState() +{ +} + // static Display *Display::GetDisplayFromNativeDisplay(EGLNativeDisplayType nativeDisplay, const AttributeMap &attribMap) diff --git a/src/libANGLE/Display.h b/src/libANGLE/Display.h index 9a00c3998..aa1d1c3b3 100644 --- a/src/libANGLE/Display.h +++ b/src/libANGLE/Display.h @@ -45,6 +45,9 @@ using SurfaceSet = std::set; struct DisplayState final : private angle::NonCopyable { + DisplayState(); + ~DisplayState(); + SurfaceSet surfaceSet; }; diff --git a/src/libANGLE/Error.h b/src/libANGLE/Error.h index b2270d0c9..1d57bb870 100644 --- a/src/libANGLE/Error.h +++ b/src/libANGLE/Error.h @@ -87,6 +87,7 @@ class ANGLE_NO_DISCARD Error final Error(GLenum errorCode, GLuint id, std::string &&message); inline Error(const Error &other); inline Error(Error &&other); + inline ~Error() = default; // automatic error type conversion inline Error(egl::Error &&eglErr); @@ -157,6 +158,7 @@ class ANGLE_NO_DISCARD Error final Error(EGLint errorCode, EGLint id, std::string &&message); inline Error(const Error &other); inline Error(Error &&other); + inline ~Error() = default; // automatic error type conversion inline Error(gl::Error &&glErr); diff --git a/src/libANGLE/Fence.cpp b/src/libANGLE/Fence.cpp index be663db75..9c4d38167 100644 --- a/src/libANGLE/Fence.cpp +++ b/src/libANGLE/Fence.cpp @@ -83,6 +83,11 @@ Sync::Sync(rx::SyncImpl *impl, GLuint id) { } +Error Sync::onDestroy(const Context *context) +{ + return NoError(); +} + Sync::~Sync() { SafeDelete(mFence); diff --git a/src/libANGLE/Fence.h b/src/libANGLE/Fence.h index b51222dcd..24bc689ca 100644 --- a/src/libANGLE/Fence.h +++ b/src/libANGLE/Fence.h @@ -52,9 +52,9 @@ class Sync final : public RefCountObject, public LabeledObject { public: Sync(rx::SyncImpl *impl, GLuint id); - virtual ~Sync(); + ~Sync() override; - Error onDestroy(const Context *context) override { return NoError(); } + Error onDestroy(const Context *context) override; void setLabel(const std::string &label) override; const std::string &getLabel() const override; diff --git a/src/libANGLE/Framebuffer.h b/src/libANGLE/Framebuffer.h index 712d55f92..70223f0bc 100644 --- a/src/libANGLE/Framebuffer.h +++ b/src/libANGLE/Framebuffer.h @@ -138,7 +138,7 @@ class Framebuffer final : public LabeledObject, public OnAttachmentDirtyReceiver // Constructor to build a fake default framebuffer when surfaceless Framebuffer(rx::GLImplFactory *factory); - virtual ~Framebuffer(); + ~Framebuffer() override; void onDestroy(const Context *context); void destroyDefault(const egl::Display *display); diff --git a/src/libANGLE/HandleRangeAllocator.cpp b/src/libANGLE/HandleRangeAllocator.cpp index 500a79629..2a97ce939 100644 --- a/src/libANGLE/HandleRangeAllocator.cpp +++ b/src/libANGLE/HandleRangeAllocator.cpp @@ -27,6 +27,10 @@ HandleRangeAllocator::HandleRangeAllocator() mUsed.insert(std::make_pair(0u, 0u)); } +HandleRangeAllocator::~HandleRangeAllocator() +{ +} + GLuint HandleRangeAllocator::allocate() { return allocateRange(1u); diff --git a/src/libANGLE/HandleRangeAllocator.h b/src/libANGLE/HandleRangeAllocator.h index 20f9a116b..4d4b6f4f6 100644 --- a/src/libANGLE/HandleRangeAllocator.h +++ b/src/libANGLE/HandleRangeAllocator.h @@ -25,6 +25,7 @@ class HandleRangeAllocator final : angle::NonCopyable static const GLuint kInvalidHandle; HandleRangeAllocator(); + ~HandleRangeAllocator(); // Allocates a new path handle. GLuint allocate(); diff --git a/src/libANGLE/Image.cpp b/src/libANGLE/Image.cpp index 5612b9bbd..04c757c2c 100644 --- a/src/libANGLE/Image.cpp +++ b/src/libANGLE/Image.cpp @@ -78,7 +78,7 @@ gl::Error ImageSibling::orphanImages(const gl::Context *context) } else { - for (auto &sourceImage : mSourcesOf) + for (egl::Image *sourceImage : mSourcesOf) { ANGLE_TRY(sourceImage->orphanSibling(context, this)); } @@ -122,6 +122,10 @@ ImageState::ImageState(EGLenum target, ImageSibling *buffer, const AttributeMap { } +ImageState::~ImageState() +{ +} + Image::Image(rx::EGLImplFactory *factory, EGLenum target, ImageSibling *buffer, diff --git a/src/libANGLE/Image.h b/src/libANGLE/Image.h index e3449b00e..d2f1b875c 100644 --- a/src/libANGLE/Image.h +++ b/src/libANGLE/Image.h @@ -35,7 +35,7 @@ class ImageSibling : public gl::RefCountObject, public gl::FramebufferAttachment { public: ImageSibling(GLuint id); - virtual ~ImageSibling(); + ~ImageSibling() override; bool isEGLImageTarget() const; gl::InitState sourceEGLImageInitState() const; @@ -64,6 +64,7 @@ class ImageSibling : public gl::RefCountObject, public gl::FramebufferAttachment struct ImageState : private angle::NonCopyable { ImageState(EGLenum target, ImageSibling *buffer, const AttributeMap &attribs); + ~ImageState(); gl::ImageIndex imageIndex; gl::BindingPointer source; @@ -79,7 +80,7 @@ class Image final : public gl::RefCountObject const AttributeMap &attribs); gl::Error onDestroy(const gl::Context *context) override; - ~Image(); + ~Image() override; const gl::Format &getFormat() const; size_t getWidth() const; diff --git a/src/libANGLE/ImageIndex.cpp b/src/libANGLE/ImageIndex.cpp index f2af70d5b..6f99f8ab5 100644 --- a/src/libANGLE/ImageIndex.cpp +++ b/src/libANGLE/ImageIndex.cpp @@ -120,6 +120,8 @@ ImageIndex::ImageIndex(GLenum typeIn, GLint mipIndexIn, GLint layerIndexIn, GLin : type(typeIn), mipIndex(mipIndexIn), layerIndex(layerIndexIn), numLayers(numLayersIn) {} +ImageIndexIterator::ImageIndexIterator(const ImageIndexIterator &other) = default; + ImageIndexIterator ImageIndexIterator::Make2D(GLint minMip, GLint maxMip) { return ImageIndexIterator(GL_TEXTURE_2D, Range(minMip, maxMip), diff --git a/src/libANGLE/ImageIndex.h b/src/libANGLE/ImageIndex.h index 46934933b..8e1b01032 100644 --- a/src/libANGLE/ImageIndex.h +++ b/src/libANGLE/ImageIndex.h @@ -57,6 +57,8 @@ struct ImageIndex class ImageIndexIterator { public: + ImageIndexIterator(const ImageIndexIterator &other); + static ImageIndexIterator Make2D(GLint minMip, GLint maxMip); static ImageIndexIterator MakeRectangle(GLint minMip, GLint maxMip); static ImageIndexIterator MakeCube(GLint minMip, GLint maxMip); diff --git a/src/libANGLE/IndexRangeCache.cpp b/src/libANGLE/IndexRangeCache.cpp index 4f165c1b2..71a1392b1 100644 --- a/src/libANGLE/IndexRangeCache.cpp +++ b/src/libANGLE/IndexRangeCache.cpp @@ -15,6 +15,14 @@ namespace gl { +IndexRangeCache::IndexRangeCache() +{ +} + +IndexRangeCache::~IndexRangeCache() +{ +} + void IndexRangeCache::addRange(GLenum type, size_t offset, size_t count, diff --git a/src/libANGLE/IndexRangeCache.h b/src/libANGLE/IndexRangeCache.h index 69de421c1..3b183448e 100644 --- a/src/libANGLE/IndexRangeCache.h +++ b/src/libANGLE/IndexRangeCache.h @@ -23,6 +23,9 @@ namespace gl class IndexRangeCache { public: + IndexRangeCache(); + ~IndexRangeCache(); + void addRange(GLenum type, size_t offset, size_t count, diff --git a/src/libANGLE/LoggingAnnotator.cpp b/src/libANGLE/LoggingAnnotator.cpp index 4a79ce076..799399e45 100644 --- a/src/libANGLE/LoggingAnnotator.cpp +++ b/src/libANGLE/LoggingAnnotator.cpp @@ -13,6 +13,11 @@ namespace angle { +bool LoggingAnnotator::getStatus() +{ + return false; +} + void LoggingAnnotator::logMessage(const gl::LogMessage &msg) const { auto *plat = ANGLEPlatformCurrent(); diff --git a/src/libANGLE/LoggingAnnotator.h b/src/libANGLE/LoggingAnnotator.h index 3617dd5b0..5bec68e18 100644 --- a/src/libANGLE/LoggingAnnotator.h +++ b/src/libANGLE/LoggingAnnotator.h @@ -22,7 +22,7 @@ class LoggingAnnotator : public gl::DebugAnnotator void beginEvent(const wchar_t *eventName) override {} void endEvent() override {} void setMarker(const wchar_t *markerName) override {} - bool getStatus() override { return false; } + bool getStatus() override; void logMessage(const gl::LogMessage &msg) const override; }; diff --git a/src/libANGLE/MemoryProgramCache.cpp b/src/libANGLE/MemoryProgramCache.cpp index 5fa6f64a6..e3953f8f4 100644 --- a/src/libANGLE/MemoryProgramCache.cpp +++ b/src/libANGLE/MemoryProgramCache.cpp @@ -581,9 +581,9 @@ void MemoryProgramCache::ComputeHash(const Context *context, const Program *program, ProgramHash *hashOut) { - auto vertexShader = program->getAttachedVertexShader(); - auto fragmentShader = program->getAttachedFragmentShader(); - auto computeShader = program->getAttachedComputeShader(); + const Shader *vertexShader = program->getAttachedVertexShader(); + const Shader *fragmentShader = program->getAttachedFragmentShader(); + const Shader *computeShader = program->getAttachedComputeShader(); // Compute the program hash. Start with the shader hashes and resource strings. HashStream hashStream; diff --git a/src/libANGLE/Program.cpp b/src/libANGLE/Program.cpp index 8296d504d..c5a379cba 100644 --- a/src/libANGLE/Program.cpp +++ b/src/libANGLE/Program.cpp @@ -404,6 +404,23 @@ VariableLocation::VariableLocation(unsigned int arrayIndex, unsigned int index) ASSERT(arrayIndex != GL_INVALID_INDEX); } +SamplerBinding::SamplerBinding(GLenum textureTypeIn, size_t elementCount, bool unreferenced) + : textureType(textureTypeIn), boundTextureUnits(elementCount, 0), unreferenced(unreferenced) +{ +} + +SamplerBinding::SamplerBinding(const SamplerBinding &other) = default; + +SamplerBinding::~SamplerBinding() = default; + +Program::Bindings::Bindings() +{ +} + +Program::Bindings::~Bindings() +{ +} + void Program::Bindings::bindLocation(GLuint index, const std::string &name) { mBindings[name] = index; @@ -425,6 +442,21 @@ Program::Bindings::const_iterator Program::Bindings::end() const return mBindings.end(); } +ImageBinding::ImageBinding(size_t count) : boundImageUnits(count, 0) +{ +} +ImageBinding::ImageBinding(GLuint imageUnit, size_t count) +{ + for (size_t index = 0; index < count; ++index) + { + boundImageUnits.push_back(imageUnit + static_cast(index)); + } +} + +ImageBinding::ImageBinding(const ImageBinding &other) = default; + +ImageBinding::~ImageBinding() = default; + ProgramState::ProgramState() : mLabel(), mAttachedFragmentShader(nullptr), @@ -770,9 +802,9 @@ Error Program::link(const gl::Context *context) const Caps &caps = data.getCaps(); - auto vertexShader = mState.mAttachedVertexShader; - auto fragmentShader = mState.mAttachedFragmentShader; - auto computeShader = mState.mAttachedComputeShader; + Shader *vertexShader = mState.mAttachedVertexShader; + Shader *fragmentShader = mState.mAttachedFragmentShader; + Shader *computeShader = mState.mAttachedComputeShader; bool isComputeShaderAttached = (computeShader != nullptr); bool nonComputeShadersAttached = (vertexShader != nullptr || fragmentShader != nullptr); diff --git a/src/libANGLE/Program.h b/src/libANGLE/Program.h index 0b50e15c1..9c815ec64 100644 --- a/src/libANGLE/Program.h +++ b/src/libANGLE/Program.h @@ -178,10 +178,9 @@ struct BindingInfo // This small structure encapsulates binding sampler uniforms to active GL textures. struct SamplerBinding { - SamplerBinding(GLenum textureTypeIn, size_t elementCount, bool unreferenced) - : textureType(textureTypeIn), boundTextureUnits(elementCount, 0), unreferenced(unreferenced) - { - } + SamplerBinding(GLenum textureTypeIn, size_t elementCount, bool unreferenced); + SamplerBinding(const SamplerBinding &other); + ~SamplerBinding(); // Necessary for retrieving active textures from the GL state. GLenum textureType; @@ -218,14 +217,10 @@ struct TransformFeedbackVarying : public sh::Varying struct ImageBinding { - ImageBinding(size_t count) : boundImageUnits(count, 0) {} - ImageBinding(GLuint imageUnit, size_t count) - { - for (size_t index = 0; index < count; ++index) - { - boundImageUnits.push_back(imageUnit + static_cast(index)); - } - } + ImageBinding(size_t count); + ImageBinding(GLuint imageUnit, size_t count); + ImageBinding(const ImageBinding &other); + ~ImageBinding(); std::vector boundImageUnits; }; @@ -588,6 +583,8 @@ class Program final : angle::NonCopyable, public LabeledObject class Bindings final : angle::NonCopyable { public: + Bindings(); + ~Bindings(); void bindLocation(GLuint index, const std::string &name); int getBinding(const std::string &name) const; @@ -616,7 +613,7 @@ class Program final : angle::NonCopyable, public LabeledObject using MergedVaryings = std::map; private: - ~Program(); + ~Program() override; void unlink(); diff --git a/src/libANGLE/ProgramLinkedResources.cpp b/src/libANGLE/ProgramLinkedResources.cpp index 7a2a5db71..5787c2b27 100644 --- a/src/libANGLE/ProgramLinkedResources.cpp +++ b/src/libANGLE/ProgramLinkedResources.cpp @@ -54,6 +54,8 @@ UniformLinker::UniformLinker(const ProgramState &state) : mState(state) { } +UniformLinker::~UniformLinker() = default; + void UniformLinker::getResults(std::vector *uniforms, std::vector *uniformLocations) { diff --git a/src/libANGLE/ProgramLinkedResources.h b/src/libANGLE/ProgramLinkedResources.h index 1d1fb9863..75975e894 100644 --- a/src/libANGLE/ProgramLinkedResources.h +++ b/src/libANGLE/ProgramLinkedResources.h @@ -24,6 +24,7 @@ class UniformLinker { public: UniformLinker(const ProgramState &state); + ~UniformLinker(); bool link(const Context *context, InfoLog &infoLog, @@ -170,7 +171,7 @@ class UniformBlockLinker final : public InterfaceBlockLinker public: UniformBlockLinker(std::vector *blocksOut, std::vector *uniformsOut); - virtual ~UniformBlockLinker(); + ~UniformBlockLinker() override; private: void defineBlockMember(const sh::ShaderVariable &field, @@ -188,7 +189,7 @@ class ShaderStorageBlockLinker final : public InterfaceBlockLinker public: ShaderStorageBlockLinker(std::vector *blocksOut, std::vector *bufferVariablesOut); - virtual ~ShaderStorageBlockLinker(); + ~ShaderStorageBlockLinker() override; private: void defineBlockMember(const sh::ShaderVariable &field, diff --git a/src/libANGLE/ProgramPipeline.cpp b/src/libANGLE/ProgramPipeline.cpp index cf3dc0231..044551209 100644 --- a/src/libANGLE/ProgramPipeline.cpp +++ b/src/libANGLE/ProgramPipeline.cpp @@ -42,6 +42,11 @@ ProgramPipeline::~ProgramPipeline() mProgramPipeline.release(); } +Error ProgramPipeline::onDestroy(const Context *context) +{ + return NoError(); +} + void ProgramPipeline::setLabel(const std::string &label) { mState.mLabel = label; diff --git a/src/libANGLE/ProgramPipeline.h b/src/libANGLE/ProgramPipeline.h index 2755fd9ca..2aac87c7b 100644 --- a/src/libANGLE/ProgramPipeline.h +++ b/src/libANGLE/ProgramPipeline.h @@ -48,7 +48,7 @@ class ProgramPipeline final : public RefCountObject, public LabeledObject ProgramPipeline(rx::GLImplFactory *factory, GLuint handle); ~ProgramPipeline() override; - Error onDestroy(const Context *context) override { return NoError(); } + Error onDestroy(const Context *context) override; void setLabel(const std::string &label) override; const std::string &getLabel() const override; diff --git a/src/libANGLE/Query.h b/src/libANGLE/Query.h index 7a5191780..c307eaaf0 100644 --- a/src/libANGLE/Query.h +++ b/src/libANGLE/Query.h @@ -30,7 +30,7 @@ class Query final : public RefCountObject, public LabeledObject public: Query(rx::QueryImpl *impl, GLuint id); void destroy(const gl::Context *context) {} - virtual ~Query(); + ~Query() override; void setLabel(const std::string &label) override; const std::string &getLabel() const override; diff --git a/src/libANGLE/RefCountObject.h b/src/libANGLE/RefCountObject.h index 342077236..cb41cc27f 100644 --- a/src/libANGLE/RefCountObject.h +++ b/src/libANGLE/RefCountObject.h @@ -26,7 +26,7 @@ class RefCountObjectNoID : angle::NonCopyable { public: RefCountObjectNoID() : mRefCount(0) {} - virtual Error onDestroy(const Context *context) { return NoError(); } + virtual Error onDestroy(const Context *context); void addRef() const { ++mRefCount; } @@ -43,7 +43,7 @@ class RefCountObjectNoID : angle::NonCopyable size_t getRefCount() const { return mRefCount; } protected: - virtual ~RefCountObjectNoID() { ASSERT(mRefCount == 0); } + virtual ~RefCountObjectNoID(); // A specialized release method for objects which need a destroy context. void release(const gl::Context *context) @@ -61,6 +61,16 @@ class RefCountObjectNoID : angle::NonCopyable mutable std::size_t mRefCount; }; +inline RefCountObjectNoID::~RefCountObjectNoID() +{ + ASSERT(mRefCount == 0); +} + +inline Error RefCountObjectNoID::onDestroy(const Context *context) +{ + return NoError(); +} + template class BindingPointer; diff --git a/src/libANGLE/Renderbuffer.cpp b/src/libANGLE/Renderbuffer.cpp index 7303a2d25..8310f1abd 100644 --- a/src/libANGLE/Renderbuffer.cpp +++ b/src/libANGLE/Renderbuffer.cpp @@ -195,6 +195,16 @@ Extents Renderbuffer::getAttachmentSize(const gl::ImageIndex & /*imageIndex*/) c return Extents(mWidth, mHeight, 1); } +const Format &Renderbuffer::getAttachmentFormat(GLenum /*binding*/, + const ImageIndex & /*imageIndex*/) const +{ + return getFormat(); +} +GLsizei Renderbuffer::getAttachmentSamples(const ImageIndex & /*imageIndex*/) const +{ + return getSamples(); +} + InitState Renderbuffer::initState(const gl::ImageIndex & /*imageIndex*/) const { if (isEGLImageTarget()) @@ -217,4 +227,9 @@ void Renderbuffer::setInitState(const gl::ImageIndex & /*imageIndex*/, InitState } } +rx::FramebufferAttachmentObjectImpl *Renderbuffer::getAttachmentImpl() const +{ + return mRenderbuffer; +} + } // namespace gl diff --git a/src/libANGLE/Renderbuffer.h b/src/libANGLE/Renderbuffer.h index 55245cfeb..def18e6ff 100644 --- a/src/libANGLE/Renderbuffer.h +++ b/src/libANGLE/Renderbuffer.h @@ -32,7 +32,7 @@ class Renderbuffer final : public egl::ImageSibling, { public: Renderbuffer(rx::RenderbufferImpl *impl, GLuint id); - virtual ~Renderbuffer(); + ~Renderbuffer() override; Error onDestroy(const Context *context) override; @@ -62,15 +62,8 @@ class Renderbuffer final : public egl::ImageSibling, // FramebufferAttachmentObject Impl Extents getAttachmentSize(const ImageIndex &imageIndex) const override; - const Format &getAttachmentFormat(GLenum /*binding*/, - const ImageIndex & /*imageIndex*/) const override - { - return getFormat(); - } - GLsizei getAttachmentSamples(const ImageIndex & /*imageIndex*/) const override - { - return getSamples(); - } + const Format &getAttachmentFormat(GLenum binding, const ImageIndex &imageIndex) const override; + GLsizei getAttachmentSamples(const ImageIndex &imageIndex) const override; void onAttach(const Context *context) override; void onDetach(const Context *context) override; @@ -80,7 +73,7 @@ class Renderbuffer final : public egl::ImageSibling, void setInitState(const ImageIndex &imageIndex, InitState initState) override; private: - rx::FramebufferAttachmentObjectImpl *getAttachmentImpl() const override { return mRenderbuffer; } + rx::FramebufferAttachmentObjectImpl *getAttachmentImpl() const override; rx::RenderbufferImpl *mRenderbuffer; diff --git a/src/libANGLE/ResourceManager.cpp b/src/libANGLE/ResourceManager.cpp index 1b7e966e5..79eb7e5f4 100644 --- a/src/libANGLE/ResourceManager.cpp +++ b/src/libANGLE/ResourceManager.cpp @@ -135,6 +135,10 @@ Buffer *BufferManager::getBuffer(GLuint handle) const // ShaderProgramManager Implementation. +ShaderProgramManager::ShaderProgramManager() +{ +} + ShaderProgramManager::~ShaderProgramManager() { ASSERT(mPrograms.empty()); @@ -337,6 +341,10 @@ Sync *SyncManager::getSync(GLuint handle) const // PathManager Implementation. +PathManager::PathManager() +{ +} + ErrorOrResult PathManager::createPaths(rx::GLImplFactory *factory, GLsizei range) { // Allocate client side handles. @@ -353,7 +361,7 @@ ErrorOrResult PathManager::createPaths(rx::GLImplFactory *factory, GLsiz for (GLsizei i = 0; i < range; ++i) { - const auto impl = paths[static_cast(i)]; + rx::PathImpl *impl = paths[static_cast(i)]; const auto id = client + i; mPaths.assign(id, new Path(impl)); } diff --git a/src/libANGLE/ResourceManager.h b/src/libANGLE/ResourceManager.h index 16d0445be..2dfeff523 100644 --- a/src/libANGLE/ResourceManager.h +++ b/src/libANGLE/ResourceManager.h @@ -126,6 +126,8 @@ class BufferManager : public TypedResourceManager { public: + ShaderProgramManager(); + GLuint createShader(rx::GLImplFactory *factory, const Limitations &rendererLimitations, GLenum type); @@ -222,6 +224,8 @@ class SyncManager : public TypedResourceManager { public: + PathManager(); + ErrorOrResult createPaths(rx::GLImplFactory *factory, GLsizei range); void deletePaths(GLuint first, GLsizei range); Path *getPath(GLuint handle) const; diff --git a/src/libANGLE/Sampler.cpp b/src/libANGLE/Sampler.cpp index 17ad70afc..0f05b697a 100644 --- a/src/libANGLE/Sampler.cpp +++ b/src/libANGLE/Sampler.cpp @@ -25,6 +25,11 @@ Sampler::~Sampler() SafeDelete(mImpl); } +Error Sampler::onDestroy(const Context *context) +{ + return NoError(); +} + void Sampler::setLabel(const std::string &label) { mLabel = label; diff --git a/src/libANGLE/Sampler.h b/src/libANGLE/Sampler.h index 5f85eb290..cd34273b4 100644 --- a/src/libANGLE/Sampler.h +++ b/src/libANGLE/Sampler.h @@ -29,7 +29,7 @@ class Sampler final : public RefCountObject, public LabeledObject Sampler(rx::GLImplFactory *factory, GLuint id); ~Sampler() override; - Error onDestroy(const Context *context) override { return NoError(); } + Error onDestroy(const Context *context) override; void setLabel(const std::string &label) override; const std::string &getLabel() const override; diff --git a/src/libANGLE/Shader.h b/src/libANGLE/Shader.h index 2ebafaa60..4b6be4696 100644 --- a/src/libANGLE/Shader.h +++ b/src/libANGLE/Shader.h @@ -180,7 +180,7 @@ class Shader final : angle::NonCopyable, public LabeledObject const std::string &getCompilerResourcesString() const; private: - virtual ~Shader(); + ~Shader() override; static void GetSourceImpl(const std::string &source, GLsizei bufSize, GLsizei *length, diff --git a/src/libANGLE/State.h b/src/libANGLE/State.h index 390602e26..0af840631 100644 --- a/src/libANGLE/State.h +++ b/src/libANGLE/State.h @@ -38,7 +38,7 @@ class State : public OnAttachmentDirtyReceiver, angle::NonCopyable { public: State(); - ~State(); + ~State() override; void initialize(const Context *context, bool debug, diff --git a/src/libANGLE/Surface.cpp b/src/libANGLE/Surface.cpp index 712f7a02d..746da0377 100644 --- a/src/libANGLE/Surface.cpp +++ b/src/libANGLE/Surface.cpp @@ -103,6 +103,11 @@ Surface::~Surface() { } +rx::FramebufferAttachmentObjectImpl *Surface::getAttachmentImpl() const +{ + return mImplementation; +} + Error Surface::destroyImpl(const Display *display) { if (mState.defaultFramebuffer) diff --git a/src/libANGLE/Surface.h b/src/libANGLE/Surface.h index 3289606a4..b3188ff90 100644 --- a/src/libANGLE/Surface.h +++ b/src/libANGLE/Surface.h @@ -127,8 +127,8 @@ class Surface : public gl::FramebufferAttachmentObject protected: Surface(EGLint surfaceType, const egl::Config *config, const AttributeMap &attributes); - virtual ~Surface(); - rx::FramebufferAttachmentObjectImpl *getAttachmentImpl() const override { return mImplementation; } + ~Surface() override; + rx::FramebufferAttachmentObjectImpl *getAttachmentImpl() const override; gl::Framebuffer *createDefaultFramebuffer(const Display *display); diff --git a/src/libANGLE/Texture.cpp b/src/libANGLE/Texture.cpp index 8003200a8..c927b43a9 100644 --- a/src/libANGLE/Texture.cpp +++ b/src/libANGLE/Texture.cpp @@ -126,6 +126,10 @@ TextureState::TextureState(GLenum target) { } +TextureState::~TextureState() +{ +} + bool TextureState::swizzleRequired() const { return mSwizzleState.swizzleRequired(); diff --git a/src/libANGLE/Texture.h b/src/libANGLE/Texture.h index d6ac4d871..f7f20000f 100644 --- a/src/libANGLE/Texture.h +++ b/src/libANGLE/Texture.h @@ -91,6 +91,7 @@ struct SwizzleState final struct TextureState final : private angle::NonCopyable { TextureState(GLenum target); + ~TextureState(); bool swizzleRequired() const; GLuint getEffectiveBaseLevel() const; diff --git a/src/libANGLE/TransformFeedback.cpp b/src/libANGLE/TransformFeedback.cpp index eb7f76021..99235debd 100644 --- a/src/libANGLE/TransformFeedback.cpp +++ b/src/libANGLE/TransformFeedback.cpp @@ -27,6 +27,10 @@ TransformFeedbackState::TransformFeedbackState(size_t maxIndexedBuffers) { } +TransformFeedbackState::~TransformFeedbackState() +{ +} + const BindingPointer &TransformFeedbackState::getGenericBuffer() const { return mGenericBuffer; diff --git a/src/libANGLE/TransformFeedback.h b/src/libANGLE/TransformFeedback.h index 2cb8a8103..2b35d43f9 100644 --- a/src/libANGLE/TransformFeedback.h +++ b/src/libANGLE/TransformFeedback.h @@ -31,6 +31,7 @@ class TransformFeedbackState final : angle::NonCopyable { public: TransformFeedbackState(size_t maxIndexedBuffers); + ~TransformFeedbackState(); const BindingPointer &getGenericBuffer() const; const OffsetBindingPointer &getIndexedBuffer(size_t idx) const; @@ -55,7 +56,7 @@ class TransformFeedback final : public RefCountObject, public LabeledObject { public: TransformFeedback(rx::GLImplFactory *implFactory, GLuint id, const Caps &caps); - virtual ~TransformFeedback(); + ~TransformFeedback() override; Error onDestroy(const Context *context) override; void setLabel(const std::string &label) override; diff --git a/src/libANGLE/Uniform.cpp b/src/libANGLE/Uniform.cpp index 1e7a077bf..b7c8301d5 100644 --- a/src/libANGLE/Uniform.cpp +++ b/src/libANGLE/Uniform.cpp @@ -171,6 +171,8 @@ ShaderVariableBuffer::ShaderVariableBuffer() : binding(0), dataSize(0) { } +ShaderVariableBuffer::ShaderVariableBuffer(const ShaderVariableBuffer &other) = default; + ShaderVariableBuffer::~ShaderVariableBuffer() { } diff --git a/src/libANGLE/Uniform.h b/src/libANGLE/Uniform.h index 01f019e56..5d463f2cd 100644 --- a/src/libANGLE/Uniform.h +++ b/src/libANGLE/Uniform.h @@ -52,7 +52,7 @@ struct LinkedUniform : public sh::Uniform, public StaticallyUsed LinkedUniform(const sh::Uniform &uniform); LinkedUniform(const LinkedUniform &uniform); LinkedUniform &operator=(const LinkedUniform &uniform); - ~LinkedUniform(); + ~LinkedUniform() override; bool isSampler() const; bool isImage() const; @@ -78,7 +78,7 @@ struct BufferVariable : public sh::ShaderVariable, public StaticallyUsed unsigned int arraySize, const int bufferIndex, const sh::BlockMemberInfo &blockInfo); - ~BufferVariable(); + ~BufferVariable() override; int bufferIndex; sh::BlockMemberInfo blockInfo; @@ -91,7 +91,8 @@ struct BufferVariable : public sh::ShaderVariable, public StaticallyUsed struct ShaderVariableBuffer : public StaticallyUsed { ShaderVariableBuffer(); - virtual ~ShaderVariableBuffer(); + ShaderVariableBuffer(const ShaderVariableBuffer &other); + ~ShaderVariableBuffer() override; int numActiveVariables() const; int binding; diff --git a/src/libANGLE/VaryingPacking.cpp b/src/libANGLE/VaryingPacking.cpp index 836895ba0..6b74d4c78 100644 --- a/src/libANGLE/VaryingPacking.cpp +++ b/src/libANGLE/VaryingPacking.cpp @@ -61,6 +61,8 @@ VaryingPacking::VaryingPacking(GLuint maxVaryingVectors, PackMode packMode) { } +VaryingPacking::~VaryingPacking() = default; + // Packs varyings into generic varying registers, using the algorithm from // See [OpenGL ES Shading Language 1.00 rev. 17] appendix A section 7 page 111 // Also [OpenGL ES Shading Language 3.00 rev. 4] Section 11 page 119 diff --git a/src/libANGLE/VaryingPacking.h b/src/libANGLE/VaryingPacking.h index 95e2c4896..14b25f929 100644 --- a/src/libANGLE/VaryingPacking.h +++ b/src/libANGLE/VaryingPacking.h @@ -131,6 +131,7 @@ class VaryingPacking final : angle::NonCopyable { public: VaryingPacking(GLuint maxVaryingVectors, PackMode packMode); + ~VaryingPacking(); bool packUserVaryings(gl::InfoLog &infoLog, const std::vector &packedVaryings, diff --git a/src/libANGLE/VertexArray.h b/src/libANGLE/VertexArray.h index c749032e7..f82ec789f 100644 --- a/src/libANGLE/VertexArray.h +++ b/src/libANGLE/VertexArray.h @@ -190,7 +190,7 @@ class VertexArray final : public LabeledObject bool hasAnyDirtyBit() const { return mDirtyBits.any(); } private: - ~VertexArray(); + ~VertexArray() override; GLuint mId; diff --git a/src/libANGLE/VertexAttribute.cpp b/src/libANGLE/VertexAttribute.cpp index 0c0fbc8ac..20f7452fa 100644 --- a/src/libANGLE/VertexAttribute.cpp +++ b/src/libANGLE/VertexAttribute.cpp @@ -22,6 +22,10 @@ VertexBinding::VertexBinding(VertexBinding &&binding) *this = std::move(binding); } +VertexBinding::~VertexBinding() +{ +} + VertexBinding &VertexBinding::operator=(VertexBinding &&binding) { if (this != &binding) diff --git a/src/libANGLE/VertexAttribute.h b/src/libANGLE/VertexAttribute.h index fca22211c..c531bece7 100644 --- a/src/libANGLE/VertexAttribute.h +++ b/src/libANGLE/VertexAttribute.h @@ -24,6 +24,7 @@ class VertexBinding final : angle::NonCopyable public: VertexBinding(); VertexBinding(VertexBinding &&binding); + ~VertexBinding(); VertexBinding &operator=(VertexBinding &&binding); GLuint getStride() const { return mStride; } diff --git a/src/libANGLE/angletypes.cpp b/src/libANGLE/angletypes.cpp index 278f21156..702d391e4 100644 --- a/src/libANGLE/angletypes.cpp +++ b/src/libANGLE/angletypes.cpp @@ -148,6 +148,8 @@ SamplerState::SamplerState() sRGBDecode = GL_DECODE_EXT; } +SamplerState::SamplerState(const SamplerState &other) = default; + // static SamplerState SamplerState::CreateDefaultForTarget(GLenum target) { @@ -165,6 +167,15 @@ SamplerState SamplerState::CreateDefaultForTarget(GLenum target) return state; } +ImageUnit::ImageUnit() + : texture(), level(0), layered(false), layer(0), access(GL_READ_ONLY), format(GL_R32UI) +{ +} + +ImageUnit::ImageUnit(const ImageUnit &other) = default; + +ImageUnit::~ImageUnit() = default; + static void MinMax(int a, int b, int *minimum, int *maximum) { if (a < b) diff --git a/src/libANGLE/angletypes.h b/src/libANGLE/angletypes.h index e4e684c2a..811764c3f 100644 --- a/src/libANGLE/angletypes.h +++ b/src/libANGLE/angletypes.h @@ -200,6 +200,7 @@ struct SamplerState final { // This will zero-initialize the struct, including padding. SamplerState(); + SamplerState(const SamplerState &other); static SamplerState CreateDefaultForTarget(GLenum target); @@ -248,10 +249,9 @@ static_assert(sizeof(DrawElementsIndirectCommand) == 20, struct ImageUnit { - ImageUnit() - : texture(), level(0), layered(false), layer(0), access(GL_READ_ONLY), format(GL_R32UI) - { - } + ImageUnit(); + ImageUnit(const ImageUnit &other); + ~ImageUnit(); BindingPointer texture; GLint level; diff --git a/src/libANGLE/formatutils.cpp b/src/libANGLE/formatutils.cpp index 8e316c451..67bb2efde 100644 --- a/src/libANGLE/formatutils.cpp +++ b/src/libANGLE/formatutils.cpp @@ -301,6 +301,8 @@ InternalFormat::InternalFormat() { } +InternalFormat::InternalFormat(const InternalFormat &other) = default; + bool InternalFormat::isLUMA() const { return ((redBits + greenBits + blueBits + depthBits + stencilBits) == 0 && diff --git a/src/libANGLE/formatutils.h b/src/libANGLE/formatutils.h index 2f65e4983..dbfe59084 100644 --- a/src/libANGLE/formatutils.h +++ b/src/libANGLE/formatutils.h @@ -51,6 +51,7 @@ const Type &GetTypeInfo(GLenum type); struct InternalFormat { InternalFormat(); + InternalFormat(const InternalFormat &other); GLuint computePixelBytes(GLenum formatType) const; diff --git a/src/libANGLE/params.cpp b/src/libANGLE/params.cpp index 71fe491b9..a89d87e0a 100644 --- a/src/libANGLE/params.cpp +++ b/src/libANGLE/params.cpp @@ -25,6 +25,11 @@ HasIndexRange::HasIndexRange() { } +HasIndexRange::HasIndexRange(Context *context, GLsizei count, GLenum type, const void *indices) + : ParamsBase(context), mContext(context), mCount(count), mType(type), mIndices(indices) +{ +} + const Optional &HasIndexRange::getIndexRange() const { if (mIndexRange.valid() || !mContext) diff --git a/src/libANGLE/params.h b/src/libANGLE/params.h index dee4c51f9..27dba640f 100644 --- a/src/libANGLE/params.h +++ b/src/libANGLE/params.h @@ -73,10 +73,7 @@ class HasIndexRange : public ParamsBase public: // Dummy placeholder that can't generate an index range. HasIndexRange(); - HasIndexRange(Context *context, GLsizei count, GLenum type, const void *indices) - : ParamsBase(context), mContext(context), mCount(count), mType(type), mIndices(indices) - { - } + HasIndexRange(Context *context, GLsizei count, GLenum type, const void *indices); template static void Factory(HasIndexRange *objBuffer, ArgsT... args); diff --git a/src/libANGLE/renderer/ContextImpl.h b/src/libANGLE/renderer/ContextImpl.h index 4b08f93a2..68f9ddb63 100644 --- a/src/libANGLE/renderer/ContextImpl.h +++ b/src/libANGLE/renderer/ContextImpl.h @@ -29,7 +29,7 @@ class ContextImpl : public GLImplFactory { public: ContextImpl(const gl::ContextState &state); - virtual ~ContextImpl(); + ~ContextImpl() override; virtual void onDestroy(const gl::Context *context) {} diff --git a/src/libANGLE/renderer/DisplayImpl.h b/src/libANGLE/renderer/DisplayImpl.h index 5089a7d98..b1c49d9bc 100644 --- a/src/libANGLE/renderer/DisplayImpl.h +++ b/src/libANGLE/renderer/DisplayImpl.h @@ -48,7 +48,7 @@ class DisplayImpl : public EGLImplFactory { public: DisplayImpl(const egl::DisplayState &state); - virtual ~DisplayImpl(); + ~DisplayImpl() override; virtual egl::Error initialize(egl::Display *display) = 0; virtual void terminate() = 0; diff --git a/src/libANGLE/renderer/FramebufferAttachmentObjectImpl.h b/src/libANGLE/renderer/FramebufferAttachmentObjectImpl.h index 35684cb5d..056ddc833 100644 --- a/src/libANGLE/renderer/FramebufferAttachmentObjectImpl.h +++ b/src/libANGLE/renderer/FramebufferAttachmentObjectImpl.h @@ -25,20 +25,30 @@ class FramebufferAttachmentObjectImpl : angle::NonCopyable virtual gl::Error getAttachmentRenderTarget(const gl::Context *context, GLenum binding, const gl::ImageIndex &imageIndex, - FramebufferAttachmentRenderTarget **rtOut) - { - UNIMPLEMENTED(); - return gl::OutOfMemory() << "getAttachmentRenderTarget not supported."; - } + FramebufferAttachmentRenderTarget **rtOut); virtual gl::Error initializeContents(const gl::Context *context, - const gl::ImageIndex &imageIndex) - { - UNIMPLEMENTED(); - return gl::OutOfMemory() << "initialize not supported."; - } + const gl::ImageIndex &imageIndex); }; +inline gl::Error FramebufferAttachmentObjectImpl::getAttachmentRenderTarget( + const gl::Context *context, + GLenum binding, + const gl::ImageIndex &imageIndex, + FramebufferAttachmentRenderTarget **rtOut) +{ + UNIMPLEMENTED(); + return gl::OutOfMemory() << "getAttachmentRenderTarget not supported."; +} + +inline gl::Error FramebufferAttachmentObjectImpl::initializeContents( + const gl::Context *context, + const gl::ImageIndex &imageIndex) +{ + UNIMPLEMENTED(); + return gl::OutOfMemory() << "initialize not supported."; +} + } // namespace rx #endif // LIBANGLE_RENDERER_FRAMEBUFFER_ATTACHMENT_OBJECT_IMPL_H_ diff --git a/src/libANGLE/renderer/RenderbufferImpl.h b/src/libANGLE/renderer/RenderbufferImpl.h index 5932a6f4c..a70ab1d0f 100644 --- a/src/libANGLE/renderer/RenderbufferImpl.h +++ b/src/libANGLE/renderer/RenderbufferImpl.h @@ -26,8 +26,8 @@ class RenderbufferImpl : public FramebufferAttachmentObjectImpl { public: RenderbufferImpl() {} - virtual ~RenderbufferImpl() {} - virtual gl::Error onDestroy(const gl::Context *context) { return gl::NoError(); } + ~RenderbufferImpl() override {} + virtual gl::Error onDestroy(const gl::Context *context); virtual gl::Error setStorage(const gl::Context *context, GLenum internalformat, @@ -41,6 +41,10 @@ class RenderbufferImpl : public FramebufferAttachmentObjectImpl virtual gl::Error setStorageEGLImageTarget(const gl::Context *context, egl::Image *image) = 0; }; +inline gl::Error RenderbufferImpl::onDestroy(const gl::Context *context) +{ + return gl::NoError(); +} } #endif // LIBANGLE_RENDERER_RENDERBUFFERIMPL_H_ diff --git a/src/libANGLE/renderer/SurfaceImpl.h b/src/libANGLE/renderer/SurfaceImpl.h index 7ce4056c8..eaa27de28 100644 --- a/src/libANGLE/renderer/SurfaceImpl.h +++ b/src/libANGLE/renderer/SurfaceImpl.h @@ -38,7 +38,7 @@ class SurfaceImpl : public FramebufferAttachmentObjectImpl { public: SurfaceImpl(const egl::SurfaceState &surfaceState); - virtual ~SurfaceImpl(); + ~SurfaceImpl() override; virtual void destroy(const egl::Display *display) {} virtual egl::Error initialize(const egl::Display *display) = 0; diff --git a/src/libANGLE/renderer/TextureImpl.cpp b/src/libANGLE/renderer/TextureImpl.cpp index 34480d80e..830d30e6d 100644 --- a/src/libANGLE/renderer/TextureImpl.cpp +++ b/src/libANGLE/renderer/TextureImpl.cpp @@ -19,6 +19,11 @@ TextureImpl::~TextureImpl() { } +gl::Error TextureImpl::onDestroy(const gl::Context *context) +{ + return gl::NoError(); +} + gl::Error TextureImpl::copyTexture(const gl::Context *context, GLenum target, size_t level, diff --git a/src/libANGLE/renderer/TextureImpl.h b/src/libANGLE/renderer/TextureImpl.h index 8cf78c386..3b4f28f5f 100644 --- a/src/libANGLE/renderer/TextureImpl.h +++ b/src/libANGLE/renderer/TextureImpl.h @@ -44,9 +44,9 @@ class TextureImpl : public FramebufferAttachmentObjectImpl { public: TextureImpl(const gl::TextureState &state); - virtual ~TextureImpl(); + ~TextureImpl() override; - virtual gl::Error onDestroy(const gl::Context *context) { return gl::NoError(); } + virtual gl::Error onDestroy(const gl::Context *context); virtual gl::Error setImage(const gl::Context *context, GLenum target, diff --git a/src/libANGLE/renderer/d3d/BufferD3D.cpp b/src/libANGLE/renderer/d3d/BufferD3D.cpp index f75bd9ef0..7769ab2b7 100644 --- a/src/libANGLE/renderer/d3d/BufferD3D.cpp +++ b/src/libANGLE/renderer/d3d/BufferD3D.cpp @@ -75,7 +75,7 @@ void BufferD3D::initializeStaticData(const gl::Context *context) { if (mStaticVertexBuffers.empty()) { - auto newStaticBuffer = new StaticVertexBufferInterface(mFactory); + StaticVertexBufferInterface *newStaticBuffer = new StaticVertexBufferInterface(mFactory); mStaticVertexBuffers.push_back( std::unique_ptr(newStaticBuffer)); } @@ -134,7 +134,7 @@ StaticVertexBufferInterface *BufferD3D::getStaticVertexBuffer(const gl::VertexAt } // At this point, we must create a new static buffer for the attribute data. - auto newStaticBuffer = new StaticVertexBufferInterface(mFactory); + StaticVertexBufferInterface *newStaticBuffer = new StaticVertexBufferInterface(mFactory); newStaticBuffer->setAttribute(attribute, binding); mStaticVertexBuffers.push_back(std::unique_ptr(newStaticBuffer)); return newStaticBuffer; diff --git a/src/libANGLE/renderer/d3d/BufferD3D.h b/src/libANGLE/renderer/d3d/BufferD3D.h index 93c43b0af..60153748e 100644 --- a/src/libANGLE/renderer/d3d/BufferD3D.h +++ b/src/libANGLE/renderer/d3d/BufferD3D.h @@ -37,7 +37,7 @@ class BufferD3D : public BufferImpl { public: BufferD3D(const gl::BufferState &state, BufferFactoryD3D *factory); - virtual ~BufferD3D(); + ~BufferD3D() override; unsigned int getSerial() const { return mSerial; } diff --git a/src/libANGLE/renderer/d3d/CompilerD3D.cpp b/src/libANGLE/renderer/d3d/CompilerD3D.cpp index 6f8d1717c..8ceeec3c3 100644 --- a/src/libANGLE/renderer/d3d/CompilerD3D.cpp +++ b/src/libANGLE/renderer/d3d/CompilerD3D.cpp @@ -17,4 +17,14 @@ CompilerD3D::CompilerD3D(ShShaderOutput translatorOutputType) { } +gl::Error CompilerD3D::release() +{ + return gl::NoError(); +} + +ShShaderOutput CompilerD3D::getTranslatorOutputType() const +{ + return mTranslatorOutputType; +} + } // namespace rx diff --git a/src/libANGLE/renderer/d3d/CompilerD3D.h b/src/libANGLE/renderer/d3d/CompilerD3D.h index 7ad6f0740..bcfe810d0 100644 --- a/src/libANGLE/renderer/d3d/CompilerD3D.h +++ b/src/libANGLE/renderer/d3d/CompilerD3D.h @@ -21,8 +21,8 @@ class CompilerD3D : public CompilerImpl CompilerD3D(ShShaderOutput translatorOutputType); ~CompilerD3D() override {} - gl::Error release() override { return gl::NoError(); } - ShShaderOutput getTranslatorOutputType() const override { return mTranslatorOutputType; } + gl::Error release() override; + ShShaderOutput getTranslatorOutputType() const override; private: ShShaderOutput mTranslatorOutputType; diff --git a/src/libANGLE/renderer/d3d/DeviceD3D.cpp b/src/libANGLE/renderer/d3d/DeviceD3D.cpp index 7123ac801..5a06b1527 100644 --- a/src/libANGLE/renderer/d3d/DeviceD3D.cpp +++ b/src/libANGLE/renderer/d3d/DeviceD3D.cpp @@ -98,4 +98,8 @@ void DeviceD3D::generateExtensions(egl::DeviceExtensions *outExtensions) const outExtensions->deviceD3D = true; } +bool DeviceD3D::deviceExternallySourced() +{ + return mDeviceExternallySourced; +} } diff --git a/src/libANGLE/renderer/d3d/DeviceD3D.h b/src/libANGLE/renderer/d3d/DeviceD3D.h index 1dd997970..15eaf9210 100644 --- a/src/libANGLE/renderer/d3d/DeviceD3D.h +++ b/src/libANGLE/renderer/d3d/DeviceD3D.h @@ -25,7 +25,7 @@ class DeviceD3D : public DeviceImpl egl::Error getDevice(void **outValue) override; EGLint getType() override; void generateExtensions(egl::DeviceExtensions *outExtensions) const override; - bool deviceExternallySourced() override { return mDeviceExternallySourced; } + bool deviceExternallySourced() override; private: void *mDevice; diff --git a/src/libANGLE/renderer/d3d/DisplayD3D.cpp b/src/libANGLE/renderer/d3d/DisplayD3D.cpp index 512570c30..0edda9c58 100644 --- a/src/libANGLE/renderer/d3d/DisplayD3D.cpp +++ b/src/libANGLE/renderer/d3d/DisplayD3D.cpp @@ -247,7 +247,7 @@ bool DisplayD3D::testDeviceLost() egl::Error DisplayD3D::restoreLostDevice(const egl::Display *display) { // Release surface resources to make the Reset() succeed - for (auto &surface : mState.surfaceSet) + for (egl::Surface *surface : mState.surfaceSet) { if (surface->getBoundTexture()) { @@ -263,7 +263,7 @@ egl::Error DisplayD3D::restoreLostDevice(const egl::Display *display) } // Restore any surfaces that may have been lost - for (const auto &surface : mState.surfaceSet) + for (const egl::Surface *surface : mState.surfaceSet) { SurfaceD3D *surfaceD3D = GetImplAs(surface); @@ -324,7 +324,7 @@ void DisplayD3D::generateCaps(egl::Caps *outCaps) const egl::Error DisplayD3D::waitClient(const gl::Context *context) const { - for (auto &surface : mState.surfaceSet) + for (egl::Surface *surface : mState.surfaceSet) { SurfaceD3D *surfaceD3D = GetImplAs(surface); ANGLE_TRY(surfaceD3D->checkForOutOfDateSwapChain(context)); diff --git a/src/libANGLE/renderer/d3d/DisplayD3D.h b/src/libANGLE/renderer/d3d/DisplayD3D.h index ecad1319d..709052231 100644 --- a/src/libANGLE/renderer/d3d/DisplayD3D.h +++ b/src/libANGLE/renderer/d3d/DisplayD3D.h @@ -22,7 +22,7 @@ class DisplayD3D : public DisplayImpl DisplayD3D(const egl::DisplayState &state); egl::Error initialize(egl::Display *display) override; - virtual void terminate() override; + void terminate() override; // Surface creation SurfaceImpl *createWindowSurface(const egl::SurfaceState &state, diff --git a/src/libANGLE/renderer/d3d/DynamicHLSL.cpp b/src/libANGLE/renderer/d3d/DynamicHLSL.cpp index b1db8c91a..55c3846db 100644 --- a/src/libANGLE/renderer/d3d/DynamicHLSL.cpp +++ b/src/libANGLE/renderer/d3d/DynamicHLSL.cpp @@ -149,6 +149,11 @@ constexpr const char *VERTEX_ATTRIBUTE_STUB_STRING = "@@ VERTEX ATTRIBUTES @@"; constexpr const char *PIXEL_OUTPUT_STUB_STRING = "@@ PIXEL OUTPUT @@"; } // anonymous namespace +// BuiltinInfo implementation + +BuiltinInfo::BuiltinInfo() = default; +BuiltinInfo::~BuiltinInfo() = default; + // DynamicHLSL implementation DynamicHLSL::DynamicHLSL(RendererD3D *const renderer) : mRenderer(renderer) @@ -1332,6 +1337,8 @@ BuiltinVaryingsD3D::BuiltinVaryingsD3D(const ProgramD3DMetadata &metadata, } } +BuiltinVaryingsD3D::~BuiltinVaryingsD3D() = default; + void BuiltinVaryingsD3D::updateBuiltins(ShaderType shaderType, const ProgramD3DMetadata &metadata, const VaryingPacking &packing) diff --git a/src/libANGLE/renderer/d3d/DynamicHLSL.h b/src/libANGLE/renderer/d3d/DynamicHLSL.h index dd111d22c..b64c15f83 100644 --- a/src/libANGLE/renderer/d3d/DynamicHLSL.h +++ b/src/libANGLE/renderer/d3d/DynamicHLSL.h @@ -71,6 +71,9 @@ struct BuiltinVarying final : private angle::NonCopyable struct BuiltinInfo { + BuiltinInfo(); + ~BuiltinInfo(); + BuiltinVarying dxPosition; BuiltinVarying glPosition; BuiltinVarying glFragCoord; @@ -92,6 +95,7 @@ class BuiltinVaryingsD3D { public: BuiltinVaryingsD3D(const ProgramD3DMetadata &metadata, const gl::VaryingPacking &packing); + ~BuiltinVaryingsD3D(); bool usesPointSize() const { return mBuiltinInfo[SHADER_VERTEX].glPointSize.enabled; } diff --git a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp index 0c85ccfc0..3d73b2c84 100644 --- a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp +++ b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp @@ -87,6 +87,10 @@ ClearParameters GetClearParameters(const gl::State &state, GLbitfield mask) } } +ClearParameters::ClearParameters() = default; + +ClearParameters::ClearParameters(const ClearParameters &other) = default; + FramebufferD3D::FramebufferD3D(const gl::FramebufferState &data, RendererD3D *renderer) : FramebufferImpl(data), mRenderer(renderer) { diff --git a/src/libANGLE/renderer/d3d/FramebufferD3D.h b/src/libANGLE/renderer/d3d/FramebufferD3D.h index 9a04d046e..a7312fdef 100644 --- a/src/libANGLE/renderer/d3d/FramebufferD3D.h +++ b/src/libANGLE/renderer/d3d/FramebufferD3D.h @@ -32,6 +32,9 @@ class RenderTargetD3D; struct ClearParameters { + ClearParameters(); + ClearParameters(const ClearParameters &other); + bool clearColor[gl::IMPLEMENTATION_MAX_DRAW_BUFFERS]; gl::ColorF colorF; gl::ColorI colorI; @@ -57,7 +60,7 @@ class FramebufferD3D : public FramebufferImpl { public: FramebufferD3D(const gl::FramebufferState &data, RendererD3D *renderer); - virtual ~FramebufferD3D(); + ~FramebufferD3D() override; gl::Error clear(const gl::Context *context, GLbitfield mask) override; gl::Error clearBufferfv(const gl::Context *context, diff --git a/src/libANGLE/renderer/d3d/ImageD3D.cpp b/src/libANGLE/renderer/d3d/ImageD3D.cpp index ead5db645..dbbcbbed2 100644 --- a/src/libANGLE/renderer/d3d/ImageD3D.cpp +++ b/src/libANGLE/renderer/d3d/ImageD3D.cpp @@ -29,4 +29,34 @@ ImageD3D::ImageD3D() { } +gl::Error ImageD3D::setManagedSurface2D(const gl::Context *context, + TextureStorage *storage, + int level) +{ + return gl::NoError(); +} + +gl::Error ImageD3D::setManagedSurfaceCube(const gl::Context *context, + TextureStorage *storage, + int face, + int level) +{ + return gl::NoError(); +} + +gl::Error ImageD3D::setManagedSurface3D(const gl::Context *context, + TextureStorage *storage, + int level) +{ + return gl::NoError(); +} + +gl::Error ImageD3D::setManagedSurface2DArray(const gl::Context *context, + TextureStorage *storage, + int layer, + int level) +{ + return gl::NoError(); +} + } // namespace rx diff --git a/src/libANGLE/renderer/d3d/ImageD3D.h b/src/libANGLE/renderer/d3d/ImageD3D.h index 9d559da7a..1b7235fba 100644 --- a/src/libANGLE/renderer/d3d/ImageD3D.h +++ b/src/libANGLE/renderer/d3d/ImageD3D.h @@ -64,30 +64,18 @@ class ImageD3D : angle::NonCopyable virtual gl::Error setManagedSurface2D(const gl::Context *context, TextureStorage *storage, - int level) - { - return gl::NoError(); - } + int level); virtual gl::Error setManagedSurfaceCube(const gl::Context *context, TextureStorage *storage, int face, - int level) - { - return gl::NoError(); - } + int level); virtual gl::Error setManagedSurface3D(const gl::Context *context, TextureStorage *storage, - int level) - { - return gl::NoError(); - } + int level); virtual gl::Error setManagedSurface2DArray(const gl::Context *context, TextureStorage *storage, int layer, - int level) - { - return gl::NoError(); - } + int level); virtual gl::Error copyToStorage(const gl::Context *context, TextureStorage *storage, const gl::ImageIndex &index, diff --git a/src/libANGLE/renderer/d3d/IndexBuffer.h b/src/libANGLE/renderer/d3d/IndexBuffer.h index 0b7b28ddf..969cf6ae6 100644 --- a/src/libANGLE/renderer/d3d/IndexBuffer.h +++ b/src/libANGLE/renderer/d3d/IndexBuffer.h @@ -81,7 +81,7 @@ class StreamingIndexBufferInterface : public IndexBufferInterface { public: explicit StreamingIndexBufferInterface(BufferFactoryD3D *factory); - ~StreamingIndexBufferInterface(); + ~StreamingIndexBufferInterface() override; gl::Error reserveBufferSpace(unsigned int size, GLenum indexType) override; }; @@ -90,7 +90,7 @@ class StaticIndexBufferInterface : public IndexBufferInterface { public: explicit StaticIndexBufferInterface(BufferFactoryD3D *factory); - ~StaticIndexBufferInterface(); + ~StaticIndexBufferInterface() override; gl::Error reserveBufferSpace(unsigned int size, GLenum indexType) override; }; diff --git a/src/libANGLE/renderer/d3d/ProgramD3D.cpp b/src/libANGLE/renderer/d3d/ProgramD3D.cpp index 150ffa3c1..851ad7e72 100644 --- a/src/libANGLE/renderer/d3d/ProgramD3D.cpp +++ b/src/libANGLE/renderer/d3d/ProgramD3D.cpp @@ -2242,7 +2242,7 @@ void ProgramD3D::setUniformInternal(GLint location, GLsizei count, const T *v, G { ASSERT(uniformType == GL_INT); size_t size = count * sizeof(T); - auto dest = &targetUniform->mSamplerData[locationInfo.arrayIndex]; + GLint *dest = &targetUniform->mSamplerData[locationInfo.arrayIndex]; if (memcmp(dest, v, size) != 0) { memcpy(dest, v, size); diff --git a/src/libANGLE/renderer/d3d/ProgramD3D.h b/src/libANGLE/renderer/d3d/ProgramD3D.h index c9634d3b2..c5d8be49b 100644 --- a/src/libANGLE/renderer/d3d/ProgramD3D.h +++ b/src/libANGLE/renderer/d3d/ProgramD3D.h @@ -151,7 +151,7 @@ class ProgramD3D : public ProgramImpl { public: ProgramD3D(const gl::ProgramState &data, RendererD3D *renderer); - virtual ~ProgramD3D(); + ~ProgramD3D() override; const std::vector &getPixelShaderKey() { return mPixelShaderKey; } diff --git a/src/libANGLE/renderer/d3d/RenderTargetD3D.h b/src/libANGLE/renderer/d3d/RenderTargetD3D.h index cb82225f9..fde96133b 100644 --- a/src/libANGLE/renderer/d3d/RenderTargetD3D.h +++ b/src/libANGLE/renderer/d3d/RenderTargetD3D.h @@ -21,7 +21,7 @@ class RenderTargetD3D : public FramebufferAttachmentRenderTarget { public: RenderTargetD3D(); - virtual ~RenderTargetD3D(); + ~RenderTargetD3D() override; virtual GLsizei getWidth() const = 0; virtual GLsizei getHeight() const = 0; diff --git a/src/libANGLE/renderer/d3d/RenderbufferD3D.h b/src/libANGLE/renderer/d3d/RenderbufferD3D.h index 63f679a4a..b50eff7db 100644 --- a/src/libANGLE/renderer/d3d/RenderbufferD3D.h +++ b/src/libANGLE/renderer/d3d/RenderbufferD3D.h @@ -25,7 +25,7 @@ class RenderbufferD3D : public RenderbufferImpl { public: RenderbufferD3D(RendererD3D *renderer); - virtual ~RenderbufferD3D(); + ~RenderbufferD3D() override; gl::Error onDestroy(const gl::Context *context) override; diff --git a/src/libANGLE/renderer/d3d/RendererD3D.h b/src/libANGLE/renderer/d3d/RendererD3D.h index fdc572aee..1834ab795 100644 --- a/src/libANGLE/renderer/d3d/RendererD3D.h +++ b/src/libANGLE/renderer/d3d/RendererD3D.h @@ -110,7 +110,7 @@ class RendererD3D : public BufferFactoryD3D, public MultisampleTextureInitialize { public: explicit RendererD3D(egl::Display *display); - virtual ~RendererD3D(); + ~RendererD3D() override; virtual egl::Error initialize() = 0; diff --git a/src/libANGLE/renderer/d3d/ShaderD3D.h b/src/libANGLE/renderer/d3d/ShaderD3D.h index ed6b5ecfa..2065f1242 100644 --- a/src/libANGLE/renderer/d3d/ShaderD3D.h +++ b/src/libANGLE/renderer/d3d/ShaderD3D.h @@ -36,7 +36,7 @@ class ShaderD3D : public ShaderImpl ShaderD3D(const gl::ShaderState &data, const angle::WorkaroundsD3D &workarounds, const gl::Extensions &extensions); - virtual ~ShaderD3D(); + ~ShaderD3D() override; // ShaderImpl implementation ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream, diff --git a/src/libANGLE/renderer/d3d/TextureD3D.h b/src/libANGLE/renderer/d3d/TextureD3D.h index 8ae2b6872..eb206a6cc 100644 --- a/src/libANGLE/renderer/d3d/TextureD3D.h +++ b/src/libANGLE/renderer/d3d/TextureD3D.h @@ -36,7 +36,7 @@ class TextureD3D : public TextureImpl { public: TextureD3D(const gl::TextureState &data, RendererD3D *renderer); - virtual ~TextureD3D(); + ~TextureD3D() override; gl::Error onDestroy(const gl::Context *context) override; @@ -190,7 +190,7 @@ class TextureD3D_2D : public TextureD3D { public: TextureD3D_2D(const gl::TextureState &data, RendererD3D *renderer); - virtual ~TextureD3D_2D(); + ~TextureD3D_2D() override; gl::Error onDestroy(const gl::Context *context) override; @@ -310,7 +310,7 @@ class TextureD3D_2D : public TextureD3D bool isValidLevel(int level) const; bool isLevelComplete(int level) const; - virtual bool isImageComplete(const gl::ImageIndex &index) const override; + bool isImageComplete(const gl::ImageIndex &index) const override; gl::Error updateStorageLevel(const gl::Context *context, int level); @@ -328,7 +328,7 @@ class TextureD3D_Cube : public TextureD3D { public: TextureD3D_Cube(const gl::TextureState &data, RendererD3D *renderer); - virtual ~TextureD3D_Cube(); + ~TextureD3D_Cube() override; gl::Error onDestroy(const gl::Context *context) override; @@ -446,7 +446,7 @@ class TextureD3D_Cube : public TextureD3D bool isValidFaceLevel(int faceIndex, int level) const; bool isFaceLevelComplete(int faceIndex, int level) const; bool isCubeComplete() const; - virtual bool isImageComplete(const gl::ImageIndex &index) const override; + bool isImageComplete(const gl::ImageIndex &index) const override; gl::Error updateStorageFaceLevel(const gl::Context *context, int faceIndex, int level); gl::Error redefineImage(const gl::Context *context, @@ -463,7 +463,7 @@ class TextureD3D_3D : public TextureD3D { public: TextureD3D_3D(const gl::TextureState &data, RendererD3D *renderer); - virtual ~TextureD3D_3D(); + ~TextureD3D_3D() override; gl::Error onDestroy(const gl::Context *context) override; @@ -562,7 +562,7 @@ class TextureD3D_3D : public TextureD3D bool isValidLevel(int level) const; bool isLevelComplete(int level) const; - virtual bool isImageComplete(const gl::ImageIndex &index) const override; + bool isImageComplete(const gl::ImageIndex &index) const override; gl::Error updateStorageLevel(const gl::Context *context, int level); gl::Error redefineImage(const gl::Context *context, @@ -578,7 +578,7 @@ class TextureD3D_2DArray : public TextureD3D { public: TextureD3D_2DArray(const gl::TextureState &data, RendererD3D *renderer); - virtual ~TextureD3D_2DArray(); + ~TextureD3D_2DArray() override; gl::Error onDestroy(const gl::Context *context) override; @@ -675,7 +675,7 @@ class TextureD3D_2DArray : public TextureD3D bool isValidLevel(int level) const; bool isLevelComplete(int level) const; - virtual bool isImageComplete(const gl::ImageIndex &index) const override; + bool isImageComplete(const gl::ImageIndex &index) const override; gl::Error updateStorageLevel(const gl::Context *context, int level); void deleteImages(); diff --git a/src/libANGLE/renderer/d3d/TextureStorage.h b/src/libANGLE/renderer/d3d/TextureStorage.h index f1d876b57..383fbc214 100644 --- a/src/libANGLE/renderer/d3d/TextureStorage.h +++ b/src/libANGLE/renderer/d3d/TextureStorage.h @@ -35,10 +35,7 @@ class TextureStorage : angle::NonCopyable TextureStorage() {} virtual ~TextureStorage() {} - virtual gl::Error onDestroy(const gl::Context *context) - { - return gl::NoError(); - } + virtual gl::Error onDestroy(const gl::Context *context); virtual int getTopLevel() const = 0; virtual bool isRenderTarget() const = 0; @@ -64,12 +61,20 @@ class TextureStorage : angle::NonCopyable // This is a no-op for most implementations of TextureStorage. Some (e.g. TextureStorage11_2D) might override it. virtual gl::Error useLevelZeroWorkaroundTexture(const gl::Context *context, - bool useLevelZeroTexture) - { - return gl::NoError(); - } + bool useLevelZeroTexture); }; +inline gl::Error TextureStorage::onDestroy(const gl::Context *context) +{ + return gl::NoError(); +} + +inline gl::Error TextureStorage::useLevelZeroWorkaroundTexture(const gl::Context *context, + bool useLevelZeroTexture) +{ + return gl::NoError(); +} + using TexStoragePointer = angle::UniqueObjectPointer; } // namespace rx diff --git a/src/libANGLE/renderer/d3d/VertexBuffer.h b/src/libANGLE/renderer/d3d/VertexBuffer.h index 36297d9d5..df8085d3c 100644 --- a/src/libANGLE/renderer/d3d/VertexBuffer.h +++ b/src/libANGLE/renderer/d3d/VertexBuffer.h @@ -104,7 +104,7 @@ class StreamingVertexBufferInterface : public VertexBufferInterface { public: StreamingVertexBufferInterface(BufferFactoryD3D *factory, std::size_t initialSize); - ~StreamingVertexBufferInterface(); + ~StreamingVertexBufferInterface() override; gl::Error storeDynamicAttribute(const gl::VertexAttribute &attrib, const gl::VertexBinding &binding, @@ -131,7 +131,7 @@ class StaticVertexBufferInterface : public VertexBufferInterface { public: explicit StaticVertexBufferInterface(BufferFactoryD3D *factory); - ~StaticVertexBufferInterface(); + ~StaticVertexBufferInterface() override; // Warning: you should ensure binding really matches attrib.bindingIndex before using these // functions. diff --git a/src/libANGLE/renderer/d3d/VertexDataManager.cpp b/src/libANGLE/renderer/d3d/VertexDataManager.cpp index 518fcd382..54ad5e54f 100644 --- a/src/libANGLE/renderer/d3d/VertexDataManager.cpp +++ b/src/libANGLE/renderer/d3d/VertexDataManager.cpp @@ -126,6 +126,8 @@ TranslatedAttribute::TranslatedAttribute() { } +TranslatedAttribute::TranslatedAttribute(const TranslatedAttribute &other) = default; + gl::ErrorOrResult TranslatedAttribute::computeOffset(GLint startVertex) const { if (!usesFirstVertexOffset) diff --git a/src/libANGLE/renderer/d3d/VertexDataManager.h b/src/libANGLE/renderer/d3d/VertexDataManager.h index c10b28058..694366deb 100644 --- a/src/libANGLE/renderer/d3d/VertexDataManager.h +++ b/src/libANGLE/renderer/d3d/VertexDataManager.h @@ -48,6 +48,7 @@ class VertexBufferBinding final struct TranslatedAttribute { TranslatedAttribute(); + TranslatedAttribute(const TranslatedAttribute &other); // Computes the correct offset from baseOffset, usesFirstVertexOffset, stride and startVertex. // Can throw an error on integer overflow. diff --git a/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp b/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp index 5b3f2a6b6..f032e888f 100644 --- a/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp @@ -558,6 +558,14 @@ DXGI_FORMAT GetStencilSRVFormat(const d3d11::Format &formatSet) } // namespace +Blit11::Shader::Shader() = default; + +Blit11::Shader::Shader(Shader &&other) = default; + +Blit11::Shader::~Shader() = default; + +Blit11::Shader &Blit11::Shader::operator=(Blit11::Shader &&other) = default; + Blit11::Blit11(Renderer11 *renderer) : mRenderer(renderer), mResourcesInitialized(false), @@ -1079,7 +1087,7 @@ gl::Error Blit11::swizzleTexture(const gl::Context *context, deviceContext->Unmap(mSwizzleCB.get(), 0); - auto stateManager = mRenderer->getStateManager(); + StateManager11 *stateManager = mRenderer->getStateManager(); // Apply vertex buffer stateManager->setSingleVertexBuffer(&mVertexBuffer, stride, 0); @@ -1174,7 +1182,7 @@ gl::Error Blit11::copyTexture(const gl::Context *context, deviceContext->Unmap(mVertexBuffer.get(), 0); - auto stateManager = mRenderer->getStateManager(); + StateManager11 *stateManager = mRenderer->getStateManager(); // Apply vertex buffer stateManager->setSingleVertexBuffer(&mVertexBuffer, stride, 0); @@ -1283,7 +1291,7 @@ gl::Error Blit11::copyDepth(const gl::Context *context, deviceContext->Unmap(mVertexBuffer.get(), 0); - auto stateManager = mRenderer->getStateManager(); + StateManager11 *stateManager = mRenderer->getStateManager(); // Apply vertex buffer stateManager->setSingleVertexBuffer(&mVertexBuffer, stride, 0); @@ -1995,7 +2003,7 @@ gl::Error Blit11::initResolveDepthOnly(const d3d11::Format &format, const gl::Ex // Possibly D3D11 bug or undefined behaviour: Clear the DSV so that our first render // works as expected. Otherwise the results of the first use seem to be incorrect. - auto context = mRenderer->getDeviceContext(); + ID3D11DeviceContext *context = mRenderer->getDeviceContext(); context->ClearDepthStencilView(mResolvedDepthDSView.get(), D3D11_CLEAR_DEPTH, 1.0f, 0); return gl::NoError(); diff --git a/src/libANGLE/renderer/d3d/d3d11/Blit11.h b/src/libANGLE/renderer/d3d/d3d11/Blit11.h index 5dce05328..14078f9db 100644 --- a/src/libANGLE/renderer/d3d/d3d11/Blit11.h +++ b/src/libANGLE/renderer/d3d/d3d11/Blit11.h @@ -194,6 +194,11 @@ class Blit11 : angle::NonCopyable struct Shader { + Shader(); + Shader(Shader &&other); + ~Shader(); + Shader &operator=(Shader &&other); + ShaderDimension dimension; d3d11::PixelShader pixelShader; }; diff --git a/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp b/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp index 49a03b394..3f876038d 100644 --- a/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp @@ -305,7 +305,7 @@ Buffer11::Buffer11(const gl::BufferState &state, Renderer11 *renderer) Buffer11::~Buffer11() { - for (auto &storage : mBufferStorages) + for (BufferStorage *&storage : mBufferStorages) { SafeDelete(storage); } @@ -902,6 +902,11 @@ gl::ErrorOrResult Buffer11::getPackStorage(const gl::Co return GetAs(packStorage); } +size_t Buffer11::getSize() const +{ + return mSize; +} + bool Buffer11::supportsDirectBinding() const { // Do not support direct buffers for dynamic data. The streaming buffer diff --git a/src/libANGLE/renderer/d3d/d3d11/Buffer11.h b/src/libANGLE/renderer/d3d/d3d11/Buffer11.h index 7d370430a..ddbeeb90d 100644 --- a/src/libANGLE/renderer/d3d/d3d11/Buffer11.h +++ b/src/libANGLE/renderer/d3d/d3d11/Buffer11.h @@ -51,7 +51,7 @@ class Buffer11 : public BufferD3D { public: Buffer11(const gl::BufferState &state, Renderer11 *renderer); - virtual ~Buffer11(); + ~Buffer11() override; gl::ErrorOrResult getBuffer(const gl::Context *context, BufferUsage usage); gl::ErrorOrResult getEmulatedIndexedBuffer(const gl::Context *context, @@ -73,7 +73,7 @@ class Buffer11 : public BufferD3D size_t getTotalCPUBufferMemoryBytes() const; // BufferD3D implementation - size_t getSize() const override { return mSize; } + size_t getSize() const override; bool supportsDirectBinding() const override; gl::Error getData(const gl::Context *context, const uint8_t **outData) override; void initializeStaticData(const gl::Context *context) override; diff --git a/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp b/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp index bc96f30be..f9dda0aeb 100644 --- a/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp @@ -422,7 +422,7 @@ gl::Error Clear11::clearFramebuffer(const gl::Context *context, } else { - const auto colorAttachment = fboData.getFirstColorAttachment(); + const gl::FramebufferAttachment *colorAttachment = fboData.getFirstColorAttachment(); if (!colorAttachment) { diff --git a/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp b/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp index 63e47f2c7..02326d7b5 100644 --- a/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp @@ -71,7 +71,8 @@ void UpdateCachedRenderTarget(const gl::Context *context, } if (newRenderTarget != cachedRenderTarget) { - auto channel = (newRenderTarget ? newRenderTarget->getBroadcastChannel() : nullptr); + OnRenderTargetDirtyChannel *channel = + (newRenderTarget ? newRenderTarget->getBroadcastChannel() : nullptr); channelBinding->bind(channel); cachedRenderTarget = newRenderTarget; } @@ -106,7 +107,7 @@ gl::Error Framebuffer11::markAttachmentsDirty(const gl::Context *context) const ANGLE_TRY(MarkAttachmentsDirty(context, &colorAttachment)); } - auto dsAttachment = mState.getDepthOrStencilAttachment(); + const gl::FramebufferAttachment *dsAttachment = mState.getDepthOrStencilAttachment(); if (dsAttachment) { ANGLE_TRY(MarkAttachmentsDirty(context, dsAttachment)); @@ -198,7 +199,8 @@ gl::Error Framebuffer11::invalidateBase(const gl::Context *context, size_t colorIndex = (attachments[i] == GL_COLOR ? 0u : (attachments[i] - GL_COLOR_ATTACHMENT0)); - auto colorAttachment = mState.getColorAttachment(colorIndex); + const gl::FramebufferAttachment *colorAttachment = + mState.getColorAttachment(colorIndex); if (colorAttachment) { ANGLE_TRY(invalidateAttachment(context, colorAttachment)); diff --git a/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h b/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h index b64354aa2..afdda299b 100644 --- a/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h +++ b/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h @@ -21,7 +21,7 @@ class Framebuffer11 : public FramebufferD3D, public OnRenderTargetDirtyReceiver { public: Framebuffer11(const gl::FramebufferState &data, Renderer11 *renderer); - virtual ~Framebuffer11(); + ~Framebuffer11() override; gl::Error discard(const gl::Context *context, size_t count, const GLenum *attachments) override; gl::Error invalidate(const gl::Context *context, diff --git a/src/libANGLE/renderer/d3d/d3d11/Image11.h b/src/libANGLE/renderer/d3d/d3d11/Image11.h index fc198dd95..584d231b3 100644 --- a/src/libANGLE/renderer/d3d/d3d11/Image11.h +++ b/src/libANGLE/renderer/d3d/d3d11/Image11.h @@ -31,7 +31,7 @@ class Image11 : public ImageD3D { public: Image11(Renderer11 *renderer); - virtual ~Image11(); + ~Image11() override; static gl::Error GenerateMipmap(const gl::Context *context, Image11 *dest, diff --git a/src/libANGLE/renderer/d3d/d3d11/IndexBuffer11.h b/src/libANGLE/renderer/d3d/d3d11/IndexBuffer11.h index 6c7260f26..7b5d744c0 100644 --- a/src/libANGLE/renderer/d3d/d3d11/IndexBuffer11.h +++ b/src/libANGLE/renderer/d3d/d3d11/IndexBuffer11.h @@ -20,18 +20,18 @@ class IndexBuffer11 : public IndexBuffer { public: explicit IndexBuffer11(Renderer11 *const renderer); - virtual ~IndexBuffer11(); + ~IndexBuffer11() override; - virtual gl::Error initialize(unsigned int bufferSize, GLenum indexType, bool dynamic); + gl::Error initialize(unsigned int bufferSize, GLenum indexType, bool dynamic) override; - virtual gl::Error mapBuffer(unsigned int offset, unsigned int size, void** outMappedMemory); - virtual gl::Error unmapBuffer(); + gl::Error mapBuffer(unsigned int offset, unsigned int size, void **outMappedMemory) override; + gl::Error unmapBuffer() override; - virtual GLenum getIndexType() const; - virtual unsigned int getBufferSize() const; - virtual gl::Error setSize(unsigned int bufferSize, GLenum indexType); + GLenum getIndexType() const override; + unsigned int getBufferSize() const override; + gl::Error setSize(unsigned int bufferSize, GLenum indexType) override; - virtual gl::Error discard(); + gl::Error discard() override; DXGI_FORMAT getIndexFormat() const; const d3d11::Buffer &getBuffer() const; diff --git a/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp b/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp index 12edb6572..61f901883 100644 --- a/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp @@ -74,6 +74,8 @@ PackedAttributeLayout::PackedAttributeLayout() : numAttributes(0), flags(0), att { } +PackedAttributeLayout::PackedAttributeLayout(const PackedAttributeLayout &other) = default; + void PackedAttributeLayout::addAttributeData(GLenum glType, UINT semanticIndex, gl::VertexFormatType vertexFormatType, diff --git a/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h b/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h index 7cc1a8e69..adf717581 100644 --- a/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h +++ b/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h @@ -31,6 +31,7 @@ class DrawCallVertexParams; struct PackedAttributeLayout { PackedAttributeLayout(); + PackedAttributeLayout(const PackedAttributeLayout &other); void addAttributeData(GLenum glType, UINT semanticIndex, diff --git a/src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.cpp b/src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.cpp index e9c8ca736..7d7ecb097 100644 --- a/src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.cpp @@ -188,7 +188,7 @@ gl::Error PixelTransfer11::copyBufferToTexture(const gl::Context *context, // Are we doing a 2D or 3D copy? const auto *geometryShader = ((destSize.depth > 1) ? &mBufferToTextureGS : nullptr); - auto stateManager = mRenderer->getStateManager(); + StateManager11 *stateManager = mRenderer->getStateManager(); stateManager->setDrawShaders(&mBufferToTextureVS, geometryShader, pixelShader); stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, bufferSRV); diff --git a/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.h b/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.h index 419e66935..db49cac9f 100644 --- a/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.h +++ b/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.h @@ -24,7 +24,7 @@ class RenderTarget11 : public RenderTargetD3D { public: RenderTarget11(const d3d11::Format &formatSet); - virtual ~RenderTarget11(); + ~RenderTarget11() override; virtual const TextureHelper11 &getTexture() const = 0; virtual const d3d11::RenderTargetView &getRenderTargetView() const = 0; @@ -67,7 +67,7 @@ class TextureRenderTarget11 : public RenderTarget11 GLsizei height, GLsizei depth, GLsizei samples); - virtual ~TextureRenderTarget11(); + ~TextureRenderTarget11() override; GLsizei getWidth() const override; GLsizei getHeight() const override; @@ -105,7 +105,7 @@ class SurfaceRenderTarget11 : public RenderTarget11 { public: SurfaceRenderTarget11(SwapChain11 *swapChain, Renderer11 *renderer, bool depth); - virtual ~SurfaceRenderTarget11(); + ~SurfaceRenderTarget11() override; GLsizei getWidth() const override; GLsizei getHeight() const override; diff --git a/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp index 393bcbbc5..979722dcd 100644 --- a/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp @@ -355,8 +355,8 @@ void GetTriFanIndices(const void *indices, bool DrawCallNeedsTranslation(const gl::Context *context, GLenum mode) { const auto &glState = context->getGLState(); - const auto &vertexArray = glState.getVertexArray(); - auto *vertexArray11 = GetImplAs(vertexArray); + const gl::VertexArray *vertexArray = glState.getVertexArray(); + VertexArray11 *vertexArray11 = GetImplAs(vertexArray); // Direct drawing doesn't support dynamic attribute storage since it needs the first and count // to translate when applyVertexBuffer. GL_LINE_LOOP and GL_TRIANGLE_FAN are not supported // either since we need to simulate them in D3D. @@ -438,6 +438,8 @@ bool CullsEverything(const gl::State &glState) } // anonymous namespace +Renderer11DeviceCaps::Renderer11DeviceCaps() = default; + Renderer11::Renderer11(egl::Display *display) : RendererD3D(display), mCreateDebugDevice(false), @@ -3657,7 +3659,12 @@ gl::Error Renderer11::blitRenderbufferRect(const gl::Context *context, bool Renderer11::isES3Capable() const { return (d3d11_gl::GetMaximumClientVersion(mRenderer11DeviceCaps.featureLevel).major > 2); -}; +} + +RendererClass Renderer11::getRendererClass() const +{ + return RENDERER_D3D11; +} void Renderer11::onSwap() { @@ -3680,7 +3687,7 @@ void Renderer11::updateHistograms() // Update the buffer CPU memory histogram { size_t sizeSum = 0; - for (auto &buffer : mAliveBuffers) + for (const Buffer11 *buffer : mAliveBuffers) { sizeSum += buffer->getTotalCPUBufferMemoryBytes(); } diff --git a/src/libANGLE/renderer/d3d/d3d11/Renderer11.h b/src/libANGLE/renderer/d3d/d3d11/Renderer11.h index 1b9cf10ef..c7ed4b3fa 100644 --- a/src/libANGLE/renderer/d3d/d3d11/Renderer11.h +++ b/src/libANGLE/renderer/d3d/d3d11/Renderer11.h @@ -45,6 +45,8 @@ class VertexDataManager; struct Renderer11DeviceCaps { + Renderer11DeviceCaps(); + D3D_FEATURE_LEVEL featureLevel; bool supportsDXGI1_2; // Support for DXGI 1.2 bool supportsClearView; // Support for ID3D11DeviceContext1::ClearView @@ -112,7 +114,7 @@ class Renderer11 : public RendererD3D { public: explicit Renderer11(egl::Display *display); - virtual ~Renderer11(); + ~Renderer11() override; egl::Error initialize() override; bool resetDevice() override; @@ -371,7 +373,7 @@ class Renderer11 : public RendererD3D bool isES3Capable() const; const Renderer11DeviceCaps &getRenderer11DeviceCaps() const { return mRenderer11DeviceCaps; }; - RendererClass getRendererClass() const override { return RENDERER_D3D11; } + RendererClass getRendererClass() const override; StateManager11 *getStateManager() { return &mStateManager; } void onSwap(); diff --git a/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.h b/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.h index c9a4b6101..3f417578a 100644 --- a/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.h +++ b/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.h @@ -29,7 +29,7 @@ class ShaderExecutable11 : public ShaderExecutableD3D ShaderExecutable11(const void *function, size_t length, d3d11::GeometryShader &&executable); ShaderExecutable11(const void *function, size_t length, d3d11::ComputeShader &&executable); - virtual ~ShaderExecutable11(); + ~ShaderExecutable11() override; const d3d11::PixelShader &getPixelShader() const; const d3d11::VertexShader &getVertexShader() const; @@ -49,7 +49,7 @@ class UniformStorage11 : public UniformStorageD3D { public: UniformStorage11(size_t initialSize); - virtual ~UniformStorage11(); + ~UniformStorage11() override; gl::Error getConstantBuffer(Renderer11 *renderer, const d3d11::Buffer **bufferOut); diff --git a/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp b/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp index f0ba55a0b..c95a9f5c3 100644 --- a/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp @@ -181,6 +181,14 @@ void UpdateUniformBuffer(ID3D11DeviceContext *deviceContext, // StateManager11::SRVCache Implementation. +StateManager11::SRVCache::SRVCache() : mHighestUsedSRV(0) +{ +} + +StateManager11::SRVCache::~SRVCache() +{ +} + void StateManager11::SRVCache::update(size_t resourceIndex, ID3D11ShaderResourceView *srv) { ASSERT(resourceIndex < mCurrentSRVs.size()); @@ -230,6 +238,10 @@ ShaderConstants11::ShaderConstants11() { } +ShaderConstants11::~ShaderConstants11() +{ +} + void ShaderConstants11::init(const gl::Caps &caps) { mSamplerMetadataVS.resize(caps.maxVertexTextureImageUnits); @@ -623,7 +635,7 @@ void StateManager11::setShaderResourceInternal(gl::SamplerType shaderType, if (record.srv != reinterpret_cast(srv)) { - auto deviceContext = mRenderer->getDeviceContext(); + ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext(); ID3D11ShaderResourceView *srvPtr = srv ? srv->get() : nullptr; if (shaderType == gl::SAMPLER_VERTEX) { @@ -1524,7 +1536,7 @@ gl::Error StateManager11::clearTextures(gl::SamplerType samplerType, return gl::NoError(); } - auto deviceContext = mRenderer->getDeviceContext(); + ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext(); if (samplerType == gl::SAMPLER_VERTEX) { deviceContext->VSSetShaderResources(static_cast(clearRange.low()), @@ -1751,7 +1763,7 @@ gl::Error StateManager11::syncCurrentValueAttribs(const gl::State &glState) const auto *attrib = &vertexAttributes[attribIndex]; const auto ¤tValue = glState.getVertexAttribCurrentValue(attribIndex); - auto currentValueAttrib = &mCurrentValueAttribs[attribIndex]; + TranslatedAttribute *currentValueAttrib = &mCurrentValueAttribs[attribIndex]; currentValueAttrib->currentValueType = currentValue.Type; currentValueAttrib->attribute = attrib; currentValueAttrib->binding = &vertexBindings[attrib->bindingIndex]; @@ -2477,8 +2489,8 @@ gl::Error StateManager11::applyVertexBuffer(const gl::Context *context, TranslatedIndexData *indexInfo) { const auto &state = context->getGLState(); - const auto &vertexArray = state.getVertexArray(); - auto *vertexArray11 = GetImplAs(vertexArray); + const gl::VertexArray *vertexArray = state.getVertexArray(); + VertexArray11 *vertexArray11 = GetImplAs(vertexArray); if (mVertexAttribsNeedTranslation) { diff --git a/src/libANGLE/renderer/d3d/d3d11/StateManager11.h b/src/libANGLE/renderer/d3d/d3d11/StateManager11.h index 9b4a07c3a..431f341f0 100644 --- a/src/libANGLE/renderer/d3d/d3d11/StateManager11.h +++ b/src/libANGLE/renderer/d3d/d3d11/StateManager11.h @@ -31,6 +31,7 @@ class ShaderConstants11 : angle::NonCopyable { public: ShaderConstants11(); + ~ShaderConstants11(); void init(const gl::Caps &caps); size_t getRequiredBufferSize(gl::SamplerType samplerType) const; @@ -436,7 +437,8 @@ class StateManager11 final : angle::NonCopyable class SRVCache : angle::NonCopyable { public: - SRVCache() : mHighestUsedSRV(0) {} + SRVCache(); + ~SRVCache(); void initialize(size_t size) { mCurrentSRVs.resize(size); } diff --git a/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp b/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp index fcac8a64e..19bcaae77 100644 --- a/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp @@ -823,7 +823,7 @@ EGLint SwapChain11::copyOffscreenToBackbuffer(const gl::Context *context, deviceContext->Unmap(mQuadVB.get(), 0); - auto stateManager = mRenderer->getStateManager(); + StateManager11 *stateManager = mRenderer->getStateManager(); constexpr UINT stride = sizeof(d3d11::PositionTexCoordVertex); stateManager->setSingleVertexBuffer(&mQuadVB, stride, 0); @@ -997,11 +997,26 @@ const TextureHelper11 &SwapChain11::getDepthStencilTexture() return mDepthStencilTexture; } +void *SwapChain11::getKeyedMutex() +{ + return mKeyedMutex; +} + void SwapChain11::recreate() { // possibly should use this method instead of reset } +RenderTargetD3D *SwapChain11::getColorRenderTarget() +{ + return &mColorRenderTarget; +} + +RenderTargetD3D *SwapChain11::getDepthStencilRenderTarget() +{ + return &mDepthStencilRenderTarget; +} + egl::Error SwapChain11::getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) { if (!mSwapChain) diff --git a/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h b/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h index 51da98903..5ce2af193 100644 --- a/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h +++ b/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h @@ -29,7 +29,7 @@ class SwapChain11 final : public SwapChainD3D GLenum depthBufferFormat, EGLint orientation, EGLint samples); - virtual ~SwapChain11(); + ~SwapChain11() override; EGLint resize(const gl::Context *context, EGLint backbufferWidth, @@ -45,8 +45,8 @@ class SwapChain11 final : public SwapChainD3D EGLint height) override; void recreate() override; - RenderTargetD3D *getColorRenderTarget() override { return &mColorRenderTarget; } - RenderTargetD3D *getDepthStencilRenderTarget() override { return &mDepthStencilRenderTarget; } + RenderTargetD3D *getColorRenderTarget() override; + RenderTargetD3D *getDepthStencilRenderTarget() override; const TextureHelper11 &getOffscreenTexture(); const d3d11::RenderTargetView &getRenderTarget(); @@ -58,7 +58,7 @@ class SwapChain11 final : public SwapChainD3D EGLint getWidth() const { return mWidth; } EGLint getHeight() const { return mHeight; } - void *getKeyedMutex() override { return mKeyedMutex; } + void *getKeyedMutex() override; EGLint getSamples() const { return mEGLSamples; } egl::Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) override; diff --git a/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp b/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp index c0922f369..8f76d16c3 100644 --- a/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp @@ -191,6 +191,12 @@ int TextureStorage11::getLevelDepth(int mipLevel) const return std::max(static_cast(mTextureDepth) >> mipLevel, 1); } +gl::Error TextureStorage11::getMippedResource(const gl::Context *context, + const TextureHelper11 **outResource) +{ + return getResource(context, outResource); +} + UINT TextureStorage11::getSubresourceIndex(const gl::ImageIndex &index) const { UINT mipSlice = static_cast(index.mipIndex + mTopLevel); @@ -570,7 +576,7 @@ gl::Error TextureStorage11::generateMipmap(const gl::Context *context, RenderTargetD3D *dest = nullptr; ANGLE_TRY(getRenderTarget(context, destIndex, &dest)); - auto rt11 = GetAs(source); + RenderTarget11 *rt11 = GetAs(source); const d3d11::SharedSRV &sourceSRV = rt11->getBlitShaderResourceView(); const d3d11::RenderTargetView &destRTV = rt11->getRenderTargetView(); diff --git a/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h b/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h index d3e3b3f04..336aa495a 100644 --- a/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h +++ b/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h @@ -111,10 +111,7 @@ class TextureStorage11 : public TextureStorage // Some classes (e.g. TextureStorage11_2D) will override getMippedResource. virtual gl::Error getMippedResource(const gl::Context *context, - const TextureHelper11 **outResource) - { - return getResource(context, outResource); - } + const TextureHelper11 **outResource); virtual gl::Error getSwizzleTexture(const TextureHelper11 **outTexture) = 0; virtual gl::Error getSwizzleRenderTarget(int mipLevel, diff --git a/src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp b/src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp index b7395f91f..4118e6007 100644 --- a/src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp @@ -32,6 +32,10 @@ VertexArray11::VertexArray11(const gl::VertexArrayState &data) } } +VertexArray11::~VertexArray11() +{ +} + void VertexArray11::destroy(const gl::Context *context) { for (auto &buffer : mCurrentBuffers) @@ -50,7 +54,7 @@ void VertexArray11::syncState(const gl::Context *context, // Generate a state serial. This serial is used in the program class to validate the cached // input layout, and skip recomputation in the fast path. - auto renderer = GetImplAs(context)->getRenderer(); + Renderer11 *renderer = GetImplAs(context)->getRenderer(); mCurrentStateSerial = renderer->generateSerial(); // TODO(jmadill): Individual attribute invalidation. diff --git a/src/libANGLE/renderer/d3d/d3d11/VertexArray11.h b/src/libANGLE/renderer/d3d/d3d11/VertexArray11.h index 69cde43c2..f9da64aed 100644 --- a/src/libANGLE/renderer/d3d/d3d11/VertexArray11.h +++ b/src/libANGLE/renderer/d3d/d3d11/VertexArray11.h @@ -22,6 +22,7 @@ class VertexArray11 : public VertexArrayImpl, public OnBufferDataDirtyReceiver { public: VertexArray11(const gl::VertexArrayState &data); + ~VertexArray11() override; void destroy(const gl::Context *context) override; void syncState(const gl::Context *context, diff --git a/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp b/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp index 23aaba15f..9c2a21465 100644 --- a/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp @@ -2129,6 +2129,19 @@ template gl::Error LazyResource::resolveImpl(Rendere void *initData, const char *name); +LazyInputLayout::LazyInputLayout(const D3D11_INPUT_ELEMENT_DESC *inputDesc, + size_t inputDescLen, + const BYTE *byteCode, + size_t byteCodeLen, + const char *debugName) + : mInputDesc(inputDesc, inputDescLen), mByteCode(byteCode, byteCodeLen), mDebugName(debugName) +{ +} + +LazyInputLayout::~LazyInputLayout() +{ +} + gl::Error LazyInputLayout::resolve(Renderer11 *renderer) { return resolveImpl(renderer, mInputDesc, &mByteCode, mDebugName); diff --git a/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h b/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h index e8eba6602..d74cf5bc7 100644 --- a/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h +++ b/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h @@ -242,16 +242,12 @@ class LazyShader final : public LazyResource { public: - constexpr LazyInputLayout(const D3D11_INPUT_ELEMENT_DESC *inputDesc, - size_t inputDescLen, - const BYTE *byteCode, - size_t byteCodeLen, - const char *debugName) - : mInputDesc(inputDesc, inputDescLen), - mByteCode(byteCode, byteCodeLen), - mDebugName(debugName) - { - } + LazyInputLayout(const D3D11_INPUT_ELEMENT_DESC *inputDesc, + size_t inputDescLen, + const BYTE *byteCode, + size_t byteCodeLen, + const char *debugName); + ~LazyInputLayout() override; gl::Error resolve(Renderer11 *renderer) override; @@ -266,7 +262,7 @@ class LazyBlendState final : public LazyResource public: LazyBlendState(const D3D11_BLEND_DESC &desc, const char *debugName); - gl::Error resolve(Renderer11 *renderer); + gl::Error resolve(Renderer11 *renderer) override; private: D3D11_BLEND_DESC mDesc; @@ -332,7 +328,7 @@ class TextureHelper11 : public Resource11Basemanager, texture.mData->manager); // Can't use std::swap because texture is typed, and here we use ID3D11Resource. - auto temp = mData->object; + ID3D11Resource *temp = mData->object; mData->object = texture.mData->object; texture.mData->object = static_cast(temp); diff --git a/src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp b/src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp index 5160c380e..dc308e775 100644 --- a/src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp +++ b/src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp @@ -22,6 +22,16 @@ Buffer9::~Buffer9() mSize = 0; } +size_t Buffer9::getSize() const +{ + return mSize; +} + +bool Buffer9::supportsDirectBinding() const +{ + return false; +} + gl::Error Buffer9::setData(const gl::Context *context, gl::BufferBinding /*target*/, const void *data, diff --git a/src/libANGLE/renderer/d3d/d3d9/Buffer9.h b/src/libANGLE/renderer/d3d/d3d9/Buffer9.h index ceb537cd5..960b2a247 100644 --- a/src/libANGLE/renderer/d3d/d3d9/Buffer9.h +++ b/src/libANGLE/renderer/d3d/d3d9/Buffer9.h @@ -21,11 +21,11 @@ class Buffer9 : public BufferD3D { public: Buffer9(const gl::BufferState &state, Renderer9 *renderer); - virtual ~Buffer9(); + ~Buffer9() override; // BufferD3D implementation - size_t getSize() const override { return mSize; } - bool supportsDirectBinding() const override { return false; } + size_t getSize() const override; + bool supportsDirectBinding() const override; gl::Error getData(const gl::Context *context, const uint8_t **outData) override; // BufferImpl implementation diff --git a/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.h b/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.h index 883e8df68..d2b46435e 100644 --- a/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.h +++ b/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.h @@ -19,7 +19,7 @@ class Framebuffer9 : public FramebufferD3D { public: Framebuffer9(const gl::FramebufferState &data, Renderer9 *renderer); - virtual ~Framebuffer9(); + ~Framebuffer9() override; gl::Error discard(const gl::Context *context, size_t count, const GLenum *attachments) override; gl::Error invalidate(const gl::Context *context, diff --git a/src/libANGLE/renderer/d3d/d3d9/Image9.h b/src/libANGLE/renderer/d3d/d3d9/Image9.h index 9021f102c..01c60dc4f 100644 --- a/src/libANGLE/renderer/d3d/d3d9/Image9.h +++ b/src/libANGLE/renderer/d3d/d3d9/Image9.h @@ -26,7 +26,7 @@ class Image9 : public ImageD3D { public: Image9(Renderer9 *renderer); - ~Image9(); + ~Image9() override; static gl::Error generateMipmap(Image9 *dest, Image9 *source); static gl::Error generateMip(IDirect3DSurface9 *destSurface, IDirect3DSurface9 *sourceSurface); diff --git a/src/libANGLE/renderer/d3d/d3d9/IndexBuffer9.h b/src/libANGLE/renderer/d3d/d3d9/IndexBuffer9.h index ba03ba703..5921d2a85 100644 --- a/src/libANGLE/renderer/d3d/d3d9/IndexBuffer9.h +++ b/src/libANGLE/renderer/d3d/d3d9/IndexBuffer9.h @@ -19,18 +19,18 @@ class IndexBuffer9 : public IndexBuffer { public: explicit IndexBuffer9(Renderer9 *const renderer); - virtual ~IndexBuffer9(); + ~IndexBuffer9() override; - virtual gl::Error initialize(unsigned int bufferSize, GLenum indexType, bool dynamic); + gl::Error initialize(unsigned int bufferSize, GLenum indexType, bool dynamic) override; - virtual gl::Error mapBuffer(unsigned int offset, unsigned int size, void** outMappedMemory); - virtual gl::Error unmapBuffer(); + gl::Error mapBuffer(unsigned int offset, unsigned int size, void **outMappedMemory) override; + gl::Error unmapBuffer() override; - virtual GLenum getIndexType() const; - virtual unsigned int getBufferSize() const; - virtual gl::Error setSize(unsigned int bufferSize, GLenum indexType); + GLenum getIndexType() const override; + unsigned int getBufferSize() const override; + gl::Error setSize(unsigned int bufferSize, GLenum indexType) override; - virtual gl::Error discard(); + gl::Error discard() override; D3DFORMAT getIndexFormat() const; IDirect3DIndexBuffer9 *getBuffer() const; diff --git a/src/libANGLE/renderer/d3d/d3d9/Query9.h b/src/libANGLE/renderer/d3d/d3d9/Query9.h index 9d17711a0..6c7c22f09 100644 --- a/src/libANGLE/renderer/d3d/d3d9/Query9.h +++ b/src/libANGLE/renderer/d3d/d3d9/Query9.h @@ -19,16 +19,16 @@ class Query9 : public QueryImpl { public: Query9(Renderer9 *renderer, GLenum type); - virtual ~Query9(); + ~Query9() override; - virtual gl::Error begin(); - virtual gl::Error end(); - virtual gl::Error queryCounter(); - virtual gl::Error getResult(GLint *params); - virtual gl::Error getResult(GLuint *params); - virtual gl::Error getResult(GLint64 *params); - virtual gl::Error getResult(GLuint64 *params); - virtual gl::Error isResultAvailable(bool *available); + gl::Error begin() override; + gl::Error end() override; + gl::Error queryCounter() override; + gl::Error getResult(GLint *params) override; + gl::Error getResult(GLuint *params) override; + gl::Error getResult(GLint64 *params) override; + gl::Error getResult(GLuint64 *params) override; + gl::Error isResultAvailable(bool *available) override; private: gl::Error testQuery(); diff --git a/src/libANGLE/renderer/d3d/d3d9/RenderTarget9.h b/src/libANGLE/renderer/d3d/d3d9/RenderTarget9.h index f19c54de7..bb3b5a4ee 100644 --- a/src/libANGLE/renderer/d3d/d3d9/RenderTarget9.h +++ b/src/libANGLE/renderer/d3d/d3d9/RenderTarget9.h @@ -21,7 +21,7 @@ class RenderTarget9 : public RenderTargetD3D { public: RenderTarget9() { } - virtual ~RenderTarget9() { } + ~RenderTarget9() override {} // Retrieve the texture that backs this render target, may be null for swap chain render // targets. virtual IDirect3DBaseTexture9 *getTexture() const = 0; @@ -43,7 +43,7 @@ class TextureRenderTarget9 : public RenderTarget9 GLsizei height, GLsizei depth, GLsizei samples); - virtual ~TextureRenderTarget9(); + ~TextureRenderTarget9() override; GLsizei getWidth() const override; GLsizei getHeight() const override; @@ -74,7 +74,7 @@ class SurfaceRenderTarget9 : public RenderTarget9 { public: SurfaceRenderTarget9(SwapChain9 *swapChain, bool depth); - virtual ~SurfaceRenderTarget9(); + ~SurfaceRenderTarget9() override; GLsizei getWidth() const override; GLsizei getHeight() const override; diff --git a/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp b/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp index 0ad01cba8..51b648142 100644 --- a/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp +++ b/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp @@ -1059,7 +1059,7 @@ gl::Error Renderer9::updateState(const gl::Context *context, GLenum drawMode) // the sample counts that we set in render target view, here we use renderTarget->getSamples to // get the actual samples. GLsizei samples = 0; - auto firstColorAttachment = framebuffer->getFirstColorbuffer(); + const gl::FramebufferAttachment *firstColorAttachment = framebuffer->getFirstColorbuffer(); if (firstColorAttachment) { ASSERT(firstColorAttachment->isAttached()); @@ -1087,13 +1087,13 @@ void Renderer9::setScissorRectangle(const gl::Rectangle &scissor, bool enabled) gl::Error Renderer9::setBlendDepthRasterStates(const gl::Context *context, GLenum drawMode) { const auto &glState = context->getGLState(); - auto drawFramebuffer = glState.getDrawFramebuffer(); + gl::Framebuffer *drawFramebuffer = glState.getDrawFramebuffer(); ASSERT(!drawFramebuffer->hasAnyDirtyBit()); // Since framebuffer->getSamples will return the original samples which may be different with // the sample counts that we set in render target view, here we use renderTarget->getSamples to // get the actual samples. GLsizei samples = 0; - auto firstColorAttachment = drawFramebuffer->getFirstColorbuffer(); + const gl::FramebufferAttachment *firstColorAttachment = drawFramebuffer->getFirstColorbuffer(); if (firstColorAttachment) { ASSERT(firstColorAttachment->isAttached()); @@ -2892,6 +2892,11 @@ gl::Error Renderer9::copyToRenderTarget(IDirect3DSurface9 *dest, return gl::NoError(); } +RendererClass Renderer9::getRendererClass() const +{ + return RENDERER_D3D9; +} + ImageD3D *Renderer9::createImage() { return new Image9(this); @@ -3230,6 +3235,11 @@ gl::Error Renderer9::clearRenderTarget(RenderTargetD3D *renderTarget, return gl::NoError(); } +bool Renderer9::canSelectViewInVertexShader() const +{ + return false; +} + // For each Direct3D sampler of either the pixel or vertex stage, // looks up the corresponding OpenGL texture image unit and texture type, // and sets the texture and its addressing/filtering state (or NULL when inactive). diff --git a/src/libANGLE/renderer/d3d/d3d9/Renderer9.h b/src/libANGLE/renderer/d3d/d3d9/Renderer9.h index 777cc01b3..17ee277e7 100644 --- a/src/libANGLE/renderer/d3d/d3d9/Renderer9.h +++ b/src/libANGLE/renderer/d3d/d3d9/Renderer9.h @@ -67,7 +67,7 @@ class Renderer9 : public RendererD3D { public: explicit Renderer9(egl::Display *display); - virtual ~Renderer9(); + ~Renderer9() override; egl::Error initialize() override; bool resetDevice() override; @@ -353,7 +353,7 @@ class Renderer9 : public RendererD3D IDirect3DSurface9 *source, bool fromManaged); - RendererClass getRendererClass() const override { return RENDERER_D3D9; } + RendererClass getRendererClass() const override; D3DDEVTYPE getD3D9DeviceType() const { return mDeviceType; } @@ -386,7 +386,7 @@ class Renderer9 : public RendererD3D const float clearDepthValue, const unsigned int clearStencilValue) override; - bool canSelectViewInVertexShader() const override { return false; } + bool canSelectViewInVertexShader() const override; private: gl::Error drawArraysImpl(const gl::Context *context, diff --git a/src/libANGLE/renderer/d3d/d3d9/ShaderExecutable9.h b/src/libANGLE/renderer/d3d/d3d9/ShaderExecutable9.h index 382a68c82..0b6b87947 100644 --- a/src/libANGLE/renderer/d3d/d3d9/ShaderExecutable9.h +++ b/src/libANGLE/renderer/d3d/d3d9/ShaderExecutable9.h @@ -20,7 +20,7 @@ class ShaderExecutable9 : public ShaderExecutableD3D public: ShaderExecutable9(const void *function, size_t length, IDirect3DPixelShader9 *executable); ShaderExecutable9(const void *function, size_t length, IDirect3DVertexShader9 *executable); - virtual ~ShaderExecutable9(); + ~ShaderExecutable9() override; IDirect3DPixelShader9 *getPixelShader() const; IDirect3DVertexShader9 *getVertexShader() const; diff --git a/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp b/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp index f9323ab68..bc81aa18e 100644 --- a/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp +++ b/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp @@ -455,4 +455,13 @@ void SwapChain9::recreate() ASSERT(SUCCEEDED(result)); } +RenderTargetD3D *SwapChain9::getColorRenderTarget() +{ + return &mColorRenderTarget; +} + +RenderTargetD3D *SwapChain9::getDepthStencilRenderTarget() +{ + return &mDepthStencilRenderTarget; +} } diff --git a/src/libANGLE/renderer/d3d/d3d9/SwapChain9.h b/src/libANGLE/renderer/d3d/d3d9/SwapChain9.h index 288eec557..5753637c4 100644 --- a/src/libANGLE/renderer/d3d/d3d9/SwapChain9.h +++ b/src/libANGLE/renderer/d3d/d3d9/SwapChain9.h @@ -28,7 +28,7 @@ class SwapChain9 : public SwapChainD3D GLenum backBufferFormat, GLenum depthBufferFormat, EGLint orientation); - virtual ~SwapChain9(); + ~SwapChain9() override; EGLint resize(const gl::Context *context, EGLint backbufferWidth, EGLint backbufferHeight) override; @@ -43,8 +43,8 @@ class SwapChain9 : public SwapChainD3D EGLint height) override; void recreate() override; - RenderTargetD3D *getColorRenderTarget() override { return &mColorRenderTarget; } - RenderTargetD3D *getDepthStencilRenderTarget() override { return &mDepthStencilRenderTarget; } + RenderTargetD3D *getColorRenderTarget() override; + RenderTargetD3D *getDepthStencilRenderTarget() override; virtual IDirect3DSurface9 *getRenderTarget(); virtual IDirect3DSurface9 *getDepthStencil(); diff --git a/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.cpp b/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.cpp index bb4fff7ae..6404af6bb 100644 --- a/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.cpp +++ b/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.cpp @@ -144,7 +144,7 @@ TextureStorage9_2D::TextureStorage9_2D(Renderer9 *renderer, GLenum internalforma TextureStorage9_2D::~TextureStorage9_2D() { SafeRelease(mTexture); - for (auto &renderTarget : mRenderTargets) + for (RenderTargetD3D *renderTarget : mRenderTargets) { SafeDelete(renderTarget); } diff --git a/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.h b/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.h index 9ea7e48f3..2f5190193 100644 --- a/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.h +++ b/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.h @@ -25,7 +25,7 @@ class RenderTarget9; class TextureStorage9 : public TextureStorage { public: - virtual ~TextureStorage9(); + ~TextureStorage9() override; static DWORD GetTextureUsage(GLenum internalformat, bool renderTarget); @@ -127,7 +127,7 @@ class TextureStorage9_Cube : public TextureStorage9 { public: TextureStorage9_Cube(Renderer9 *renderer, GLenum internalformat, bool renderTarget, int size, int levels, bool hintLevelZeroOnly); - virtual ~TextureStorage9_Cube(); + ~TextureStorage9_Cube() override; gl::Error getSurfaceLevel(const gl::Context *context, GLenum target, diff --git a/src/libANGLE/renderer/d3d/d3d9/VertexArray9.h b/src/libANGLE/renderer/d3d/d3d9/VertexArray9.h index 08c40e836..0f4410b8d 100644 --- a/src/libANGLE/renderer/d3d/d3d9/VertexArray9.h +++ b/src/libANGLE/renderer/d3d/d3d9/VertexArray9.h @@ -23,12 +23,8 @@ class VertexArray9 : public VertexArrayImpl public: VertexArray9(const gl::VertexArrayState &data) : VertexArrayImpl(data) {} - void syncState(const gl::Context *context, const gl::VertexArray::DirtyBits &dirtyBits) override - { - ASSERT(dirtyBits.any()); - Renderer9 *renderer = GetImplAs(context)->getRenderer(); - mCurrentStateSerial = renderer->generateSerial(); - } + void syncState(const gl::Context *context, + const gl::VertexArray::DirtyBits &dirtyBits) override; ~VertexArray9() override {} @@ -38,6 +34,13 @@ class VertexArray9 : public VertexArrayImpl Serial mCurrentStateSerial; }; +inline void VertexArray9::syncState(const gl::Context *context, + const gl::VertexArray::DirtyBits &dirtyBits) +{ + ASSERT(dirtyBits.any()); + Renderer9 *renderer = GetImplAs(context)->getRenderer(); + mCurrentStateSerial = renderer->generateSerial(); +} } #endif // LIBANGLE_RENDERER_D3D_D3D9_VERTEXARRAY9_H_ diff --git a/src/libANGLE/renderer/d3d/d3d9/formatutils9.cpp b/src/libANGLE/renderer/d3d/d3d9/formatutils9.cpp index 08c26e75c..d10fa1ee8 100644 --- a/src/libANGLE/renderer/d3d/d3d9/formatutils9.cpp +++ b/src/libANGLE/renderer/d3d/d3d9/formatutils9.cpp @@ -30,7 +30,7 @@ constexpr D3DFORMAT D3DFMT_NULL = ((D3DFORMAT)(MAKEFOURCC('N', 'U', 'L', 'L'))); // A map to determine the pixel size and mip generation function of a given D3D format typedef std::map D3D9FormatInfoMap; -constexpr D3DFormat::D3DFormat() +D3DFormat::D3DFormat() : pixelBytes(0), blockWidth(0), blockHeight(0), @@ -45,17 +45,17 @@ constexpr D3DFormat::D3DFormat() { } -constexpr D3DFormat::D3DFormat(GLuint bits, - GLuint blockWidth, - GLuint blockHeight, - GLuint redBits, - GLuint greenBits, - GLuint blueBits, - GLuint alphaBits, - GLuint lumBits, - GLuint depthBits, - GLuint stencilBits, - Format::ID formatID) +D3DFormat::D3DFormat(GLuint bits, + GLuint blockWidth, + GLuint blockHeight, + GLuint redBits, + GLuint greenBits, + GLuint blueBits, + GLuint alphaBits, + GLuint lumBits, + GLuint depthBits, + GLuint stencilBits, + Format::ID formatID) : pixelBytes(bits / 8), blockWidth(blockWidth), blockHeight(blockHeight), @@ -74,14 +74,13 @@ const D3DFormat &GetD3DFormatInfo(D3DFORMAT format) { if (format == D3DFMT_NULL) { - static constexpr D3DFormat info(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Format::ID::NONE); + static const D3DFormat info(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Format::ID::NONE); return info; } if (format == D3DFMT_INTZ) { - static constexpr D3DFormat info(32, 1, 1, 0, 0, 0, 0, 0, 24, 8, - Format::ID::D24_UNORM_S8_UINT); + static const D3DFormat info(32, 1, 1, 0, 0, 0, 0, 0, 24, 8, Format::ID::D24_UNORM_S8_UINT); return info; } @@ -89,136 +88,129 @@ const D3DFormat &GetD3DFormatInfo(D3DFORMAT format) { case D3DFMT_UNKNOWN: { - static constexpr D3DFormat info(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Format::ID::NONE); + static const D3DFormat info(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Format::ID::NONE); return info; } case D3DFMT_L8: { - static constexpr D3DFormat info(8, 1, 1, 0, 0, 0, 0, 8, 0, 0, Format::ID::L8_UNORM); + static const D3DFormat info(8, 1, 1, 0, 0, 0, 0, 8, 0, 0, Format::ID::L8_UNORM); return info; } case D3DFMT_A8: { - static constexpr D3DFormat info(8, 1, 1, 0, 0, 0, 8, 0, 0, 0, Format::ID::A8_UNORM); + static const D3DFormat info(8, 1, 1, 0, 0, 0, 8, 0, 0, 0, Format::ID::A8_UNORM); return info; } case D3DFMT_A8L8: { - static constexpr D3DFormat info(16, 1, 1, 0, 0, 0, 8, 8, 0, 0, Format::ID::L8A8_UNORM); + static const D3DFormat info(16, 1, 1, 0, 0, 0, 8, 8, 0, 0, Format::ID::L8A8_UNORM); return info; } case D3DFMT_A4R4G4B4: { - static constexpr D3DFormat info(16, 1, 1, 4, 4, 4, 4, 0, 0, 0, - Format::ID::B4G4R4A4_UNORM); + static const D3DFormat info(16, 1, 1, 4, 4, 4, 4, 0, 0, 0, Format::ID::B4G4R4A4_UNORM); return info; } case D3DFMT_A1R5G5B5: { - static constexpr D3DFormat info(16, 1, 1, 5, 5, 5, 1, 0, 0, 0, - Format::ID::B5G5R5A1_UNORM); + static const D3DFormat info(16, 1, 1, 5, 5, 5, 1, 0, 0, 0, Format::ID::B5G5R5A1_UNORM); return info; } case D3DFMT_R5G6B5: { - static constexpr D3DFormat info(16, 1, 1, 5, 6, 5, 0, 0, 0, 0, - Format::ID::R5G6B5_UNORM); + static const D3DFormat info(16, 1, 1, 5, 6, 5, 0, 0, 0, 0, Format::ID::R5G6B5_UNORM); return info; } case D3DFMT_X8R8G8B8: { - static constexpr D3DFormat info(32, 1, 1, 8, 8, 8, 0, 0, 0, 0, - Format::ID::B8G8R8X8_UNORM); + static const D3DFormat info(32, 1, 1, 8, 8, 8, 0, 0, 0, 0, Format::ID::B8G8R8X8_UNORM); return info; } case D3DFMT_A8R8G8B8: { - static constexpr D3DFormat info(32, 1, 1, 8, 8, 8, 8, 0, 0, 0, - Format::ID::B8G8R8A8_UNORM); + static const D3DFormat info(32, 1, 1, 8, 8, 8, 8, 0, 0, 0, Format::ID::B8G8R8A8_UNORM); return info; } case D3DFMT_R16F: { - static constexpr D3DFormat info(16, 1, 1, 16, 0, 0, 0, 0, 0, 0, Format::ID::R16_FLOAT); + static const D3DFormat info(16, 1, 1, 16, 0, 0, 0, 0, 0, 0, Format::ID::R16_FLOAT); return info; } case D3DFMT_G16R16F: { - static constexpr D3DFormat info(32, 1, 1, 16, 16, 0, 0, 0, 0, 0, - Format::ID::R16G16_FLOAT); + static const D3DFormat info(32, 1, 1, 16, 16, 0, 0, 0, 0, 0, Format::ID::R16G16_FLOAT); return info; } case D3DFMT_A16B16G16R16F: { - static constexpr D3DFormat info(64, 1, 1, 16, 16, 16, 16, 0, 0, 0, - Format::ID::R16G16B16A16_FLOAT); + static const D3DFormat info(64, 1, 1, 16, 16, 16, 16, 0, 0, 0, + Format::ID::R16G16B16A16_FLOAT); return info; } case D3DFMT_R32F: { - static constexpr D3DFormat info(32, 1, 1, 32, 0, 0, 0, 0, 0, 0, Format::ID::R32_FLOAT); + static const D3DFormat info(32, 1, 1, 32, 0, 0, 0, 0, 0, 0, Format::ID::R32_FLOAT); return info; } case D3DFMT_G32R32F: { - static constexpr D3DFormat info(64, 1, 1, 32, 32, 0, 0, 0, 0, 0, - Format::ID::R32G32_FLOAT); + static const D3DFormat info(64, 1, 1, 32, 32, 0, 0, 0, 0, 0, Format::ID::R32G32_FLOAT); return info; } case D3DFMT_A32B32G32R32F: { - static constexpr D3DFormat info(128, 1, 1, 32, 32, 32, 32, 0, 0, 0, - Format::ID::R32G32B32A32_FLOAT); + static const D3DFormat info(128, 1, 1, 32, 32, 32, 32, 0, 0, 0, + Format::ID::R32G32B32A32_FLOAT); return info; } case D3DFMT_D16: { - static constexpr D3DFormat info(16, 1, 1, 0, 0, 0, 0, 0, 16, 0, Format::ID::D16_UNORM); + static const D3DFormat info(16, 1, 1, 0, 0, 0, 0, 0, 16, 0, Format::ID::D16_UNORM); return info; } case D3DFMT_D24S8: { - static constexpr D3DFormat info(32, 1, 1, 0, 0, 0, 0, 0, 24, 8, - Format::ID::D24_UNORM_S8_UINT); + static const D3DFormat info(32, 1, 1, 0, 0, 0, 0, 0, 24, 8, + Format::ID::D24_UNORM_S8_UINT); return info; } case D3DFMT_D24X8: { - static constexpr D3DFormat info(32, 1, 1, 0, 0, 0, 0, 0, 24, 0, Format::ID::D16_UNORM); + static const D3DFormat info(32, 1, 1, 0, 0, 0, 0, 0, 24, 0, Format::ID::D16_UNORM); return info; } case D3DFMT_D32: { - static constexpr D3DFormat info(32, 1, 1, 0, 0, 0, 0, 0, 32, 0, Format::ID::D32_UNORM); + static const D3DFormat info(32, 1, 1, 0, 0, 0, 0, 0, 32, 0, Format::ID::D32_UNORM); return info; } case D3DFMT_DXT1: { - static constexpr D3DFormat info(64, 4, 4, 0, 0, 0, 0, 0, 0, 0, - Format::ID::BC1_RGBA_UNORM_BLOCK); + static const D3DFormat info(64, 4, 4, 0, 0, 0, 0, 0, 0, 0, + Format::ID::BC1_RGBA_UNORM_BLOCK); return info; } case D3DFMT_DXT3: { - static constexpr D3DFormat info(128, 4, 4, 0, 0, 0, 0, 0, 0, 0, - Format::ID::BC2_RGBA_UNORM_BLOCK); + static const D3DFormat info(128, 4, 4, 0, 0, 0, 0, 0, 0, 0, + Format::ID::BC2_RGBA_UNORM_BLOCK); return info; } case D3DFMT_DXT5: { - static constexpr D3DFormat info(128, 4, 4, 0, 0, 0, 0, 0, 0, 0, - Format::ID::BC3_RGBA_UNORM_BLOCK); + static const D3DFormat info(128, 4, 4, 0, 0, 0, 0, 0, 0, 0, + Format::ID::BC3_RGBA_UNORM_BLOCK); return info; } default: { - static constexpr D3DFormat defaultInfo; + static const D3DFormat defaultInfo; return defaultInfo; } } diff --git a/src/libANGLE/renderer/d3d/d3d9/formatutils9.h b/src/libANGLE/renderer/d3d/d3d9/formatutils9.h index 828252d33..1bef320b5 100644 --- a/src/libANGLE/renderer/d3d/d3d9/formatutils9.h +++ b/src/libANGLE/renderer/d3d/d3d9/formatutils9.h @@ -29,18 +29,18 @@ namespace d3d9 struct D3DFormat { - constexpr D3DFormat(); - constexpr D3DFormat(GLuint pixelBytes, - GLuint blockWidth, - GLuint blockHeight, - GLuint redBits, - GLuint greenBits, - GLuint blueBits, - GLuint alphaBits, - GLuint luminanceBits, - GLuint depthBits, - GLuint stencilBits, - angle::Format::ID formatID); + D3DFormat(); + D3DFormat(GLuint pixelBytes, + GLuint blockWidth, + GLuint blockHeight, + GLuint redBits, + GLuint greenBits, + GLuint blueBits, + GLuint alphaBits, + GLuint luminanceBits, + GLuint depthBits, + GLuint stencilBits, + angle::Format::ID formatID); const angle::Format &info() const { return angle::Format::Get(formatID); } diff --git a/src/libANGLE/renderer/gl/ClearMultiviewGL.cpp b/src/libANGLE/renderer/gl/ClearMultiviewGL.cpp index 0c9a3ba60..fb329781a 100644 --- a/src/libANGLE/renderer/gl/ClearMultiviewGL.cpp +++ b/src/libANGLE/renderer/gl/ClearMultiviewGL.cpp @@ -40,7 +40,7 @@ void ClearMultiviewGL::clearMultiviewFBO(const gl::FramebufferState &state, GLfloat depth, GLint stencil) { - const auto &firstAttachment = state.getFirstNonNullAttachment(); + const gl::FramebufferAttachment *firstAttachment = state.getFirstNonNullAttachment(); switch (firstAttachment->getMultiviewLayout()) { case GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE: @@ -69,7 +69,7 @@ void ClearMultiviewGL::clearLayeredFBO(const gl::FramebufferState &state, mStateManager->bindFramebuffer(GL_DRAW_FRAMEBUFFER, mFramebuffer); - const auto &firstAttachment = state.getFirstNonNullAttachment(); + const gl::FramebufferAttachment *firstAttachment = state.getFirstNonNullAttachment(); ASSERT(firstAttachment->getMultiviewLayout() == GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE); const auto &drawBuffers = state.getDrawBufferStates(); @@ -97,7 +97,7 @@ void ClearMultiviewGL::clearSideBySideFBO(const gl::FramebufferState &state, GLfloat depth, GLint stencil) { - const auto &firstAttachment = state.getFirstNonNullAttachment(); + const gl::FramebufferAttachment *firstAttachment = state.getFirstNonNullAttachment(); ASSERT(firstAttachment->getMultiviewLayout() == GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE); const auto &viewportOffsets = firstAttachment->getMultiviewViewportOffsets(); @@ -147,7 +147,7 @@ void ClearMultiviewGL::attachTextures(const gl::FramebufferState &state, int lay { for (auto drawBufferId : state.getEnabledDrawBuffers()) { - const auto &attachment = state.getColorAttachment(drawBufferId); + const gl::FramebufferAttachment *attachment = state.getColorAttachment(drawBufferId); if (attachment == nullptr) { continue; @@ -163,9 +163,9 @@ void ClearMultiviewGL::attachTextures(const gl::FramebufferState &state, int lay textureGL->getTextureID(), imageIndex.mipIndex, layer); } - const auto &depthStencilAttachment = state.getDepthStencilAttachment(); - const auto &depthAttachment = state.getDepthAttachment(); - const auto &stencilAttachment = state.getStencilAttachment(); + const gl::FramebufferAttachment *depthStencilAttachment = state.getDepthStencilAttachment(); + const gl::FramebufferAttachment *depthAttachment = state.getDepthAttachment(); + const gl::FramebufferAttachment *stencilAttachment = state.getStencilAttachment(); if (depthStencilAttachment != nullptr) { const auto &imageIndex = depthStencilAttachment->getTextureImageIndex(); @@ -199,7 +199,7 @@ void ClearMultiviewGL::detachTextures(const gl::FramebufferState &state) { for (auto drawBufferId : state.getEnabledDrawBuffers()) { - const auto &attachment = state.getColorAttachment(drawBufferId); + const gl::FramebufferAttachment *attachment = state.getColorAttachment(drawBufferId); if (attachment == nullptr) { continue; @@ -210,9 +210,9 @@ void ClearMultiviewGL::detachTextures(const gl::FramebufferState &state) mFunctions->framebufferTextureLayer(GL_DRAW_FRAMEBUFFER, colorAttachment, 0, 0, 0); } - const auto &depthStencilAttachment = state.getDepthStencilAttachment(); - const auto &depthAttachment = state.getDepthAttachment(); - const auto &stencilAttachment = state.getStencilAttachment(); + const gl::FramebufferAttachment *depthStencilAttachment = state.getDepthStencilAttachment(); + const gl::FramebufferAttachment *depthAttachment = state.getDepthAttachment(); + const gl::FramebufferAttachment *stencilAttachment = state.getStencilAttachment(); if (depthStencilAttachment != nullptr) { mFunctions->framebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, 0, 0, diff --git a/src/libANGLE/renderer/gl/CompilerGL.cpp b/src/libANGLE/renderer/gl/CompilerGL.cpp index 71be15611..7e643f929 100644 --- a/src/libANGLE/renderer/gl/CompilerGL.cpp +++ b/src/libANGLE/renderer/gl/CompilerGL.cpp @@ -88,4 +88,14 @@ CompilerGL::CompilerGL(const FunctionsGL *functions) { } +gl::Error CompilerGL::release() +{ + return gl::NoError(); +} + +ShShaderOutput CompilerGL::getTranslatorOutputType() const +{ + return mTranslatorOutputType; +} + } // namespace rx diff --git a/src/libANGLE/renderer/gl/CompilerGL.h b/src/libANGLE/renderer/gl/CompilerGL.h index 4c4104fa2..22e101b5b 100644 --- a/src/libANGLE/renderer/gl/CompilerGL.h +++ b/src/libANGLE/renderer/gl/CompilerGL.h @@ -21,8 +21,8 @@ class CompilerGL : public CompilerImpl CompilerGL(const FunctionsGL *functions); ~CompilerGL() override {} - gl::Error release() override { return gl::NoError(); } - ShShaderOutput getTranslatorOutputType() const override { return mTranslatorOutputType; } + gl::Error release() override; + ShShaderOutput getTranslatorOutputType() const override; private: ShShaderOutput mTranslatorOutputType; diff --git a/src/libANGLE/renderer/gl/FunctionsGL.h b/src/libANGLE/renderer/gl/FunctionsGL.h index ea4b948c9..77047c428 100644 --- a/src/libANGLE/renderer/gl/FunctionsGL.h +++ b/src/libANGLE/renderer/gl/FunctionsGL.h @@ -33,7 +33,7 @@ class FunctionsGL : public DispatchTableGL { public: FunctionsGL(); - virtual ~FunctionsGL(); + ~FunctionsGL() override; void initialize(const egl::AttributeMap &displayAttributes); @@ -53,7 +53,7 @@ class FunctionsGL : public DispatchTableGL bool hasGLESExtension(const std::string &ext) const; private: - virtual void *loadProcAddress(const std::string &function) const = 0; + void *loadProcAddress(const std::string &function) const override = 0; void initializeDummyFunctionsForNULLDriver(const std::set &extensionSet); }; diff --git a/src/libANGLE/renderer/gl/PathGL.h b/src/libANGLE/renderer/gl/PathGL.h index 461d39aec..74939d408 100644 --- a/src/libANGLE/renderer/gl/PathGL.h +++ b/src/libANGLE/renderer/gl/PathGL.h @@ -21,7 +21,7 @@ class PathGL : public PathImpl { public: PathGL(const FunctionsGL *functions, GLuint path); - ~PathGL(); + ~PathGL() override; gl::Error setCommands(GLsizei numCommands, const GLubyte *commands, diff --git a/src/libANGLE/renderer/gl/QueryGL.cpp b/src/libANGLE/renderer/gl/QueryGL.cpp index 9868724a9..ddbf2f847 100644 --- a/src/libANGLE/renderer/gl/QueryGL.cpp +++ b/src/libANGLE/renderer/gl/QueryGL.cpp @@ -245,7 +245,7 @@ class SyncProviderGLSync : public SyncProviderGL mSync = mFunctions->fenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); } - virtual ~SyncProviderGLSync() { mFunctions->deleteSync(mSync); } + ~SyncProviderGLSync() override { mFunctions->deleteSync(mSync); } gl::Error flush(bool force, bool *finished) override { @@ -284,7 +284,7 @@ class SyncProviderGLQuery : public SyncProviderGL ANGLE_SWALLOW_ERR(stateManager->resumeQuery(queryType)); } - virtual ~SyncProviderGLQuery() { mFunctions->deleteQueries(1, &mQuery); } + ~SyncProviderGLQuery() override { mFunctions->deleteQueries(1, &mQuery); } gl::Error flush(bool force, bool *finished) override { diff --git a/src/libANGLE/renderer/gl/RenderbufferGL.h b/src/libANGLE/renderer/gl/RenderbufferGL.h index 2f11b39d7..7aafec66c 100644 --- a/src/libANGLE/renderer/gl/RenderbufferGL.h +++ b/src/libANGLE/renderer/gl/RenderbufferGL.h @@ -32,17 +32,16 @@ class RenderbufferGL : public RenderbufferImpl const gl::TextureCapsMap &textureCaps); ~RenderbufferGL() override; - virtual gl::Error setStorage(const gl::Context *context, - GLenum internalformat, - size_t width, - size_t height) override; - virtual gl::Error setStorageMultisample(const gl::Context *context, - size_t samples, - GLenum internalformat, - size_t width, - size_t height) override; - virtual gl::Error setStorageEGLImageTarget(const gl::Context *context, - egl::Image *image) override; + gl::Error setStorage(const gl::Context *context, + GLenum internalformat, + size_t width, + size_t height) override; + gl::Error setStorageMultisample(const gl::Context *context, + size_t samples, + GLenum internalformat, + size_t width, + size_t height) override; + gl::Error setStorageEGLImageTarget(const gl::Context *context, egl::Image *image) override; gl::Error initializeContents(const gl::Context *context, const gl::ImageIndex &imageIndex) override; diff --git a/src/libANGLE/renderer/gl/StateManagerGL.cpp b/src/libANGLE/renderer/gl/StateManagerGL.cpp index 98bf94276..f35ef05e7 100644 --- a/src/libANGLE/renderer/gl/StateManagerGL.cpp +++ b/src/libANGLE/renderer/gl/StateManagerGL.cpp @@ -210,6 +210,10 @@ StateManagerGL::StateManagerGL(const FunctionsGL *functions, angle::Matrix::setToIdentity(mPathMatrixMV); } +StateManagerGL::~StateManagerGL() +{ +} + void StateManagerGL::deleteProgram(GLuint program) { if (program != 0) diff --git a/src/libANGLE/renderer/gl/StateManagerGL.h b/src/libANGLE/renderer/gl/StateManagerGL.h index c3a3a5ea7..91530674b 100644 --- a/src/libANGLE/renderer/gl/StateManagerGL.h +++ b/src/libANGLE/renderer/gl/StateManagerGL.h @@ -40,6 +40,7 @@ class StateManagerGL final : angle::NonCopyable StateManagerGL(const FunctionsGL *functions, const gl::Caps &rendererCaps, const gl::Extensions &extensions); + ~StateManagerGL(); void deleteProgram(GLuint program); void deleteVertexArray(GLuint vao); diff --git a/src/libANGLE/renderer/gl/VertexArrayGL.cpp b/src/libANGLE/renderer/gl/VertexArrayGL.cpp index 6dc1fe1cf..512baa563 100644 --- a/src/libANGLE/renderer/gl/VertexArrayGL.cpp +++ b/src/libANGLE/renderer/gl/VertexArrayGL.cpp @@ -83,6 +83,10 @@ VertexArrayGL::VertexArrayGL(const VertexArrayState &state, } } +VertexArrayGL::~VertexArrayGL() +{ +} + void VertexArrayGL::destroy(const gl::Context *context) { mStateManager->deleteVertexArray(mVertexArrayID); diff --git a/src/libANGLE/renderer/gl/VertexArrayGL.h b/src/libANGLE/renderer/gl/VertexArrayGL.h index 615809950..7010d69c3 100644 --- a/src/libANGLE/renderer/gl/VertexArrayGL.h +++ b/src/libANGLE/renderer/gl/VertexArrayGL.h @@ -23,6 +23,8 @@ class VertexArrayGL : public VertexArrayImpl VertexArrayGL(const gl::VertexArrayState &data, const FunctionsGL *functions, StateManagerGL *stateManager); + ~VertexArrayGL() override; + void destroy(const gl::Context *context) override; gl::Error syncDrawArraysState(const gl::Context *context, diff --git a/src/libANGLE/renderer/gl/WorkaroundsGL.h b/src/libANGLE/renderer/gl/WorkaroundsGL.h index b6cc62663..ab50022fa 100644 --- a/src/libANGLE/renderer/gl/WorkaroundsGL.h +++ b/src/libANGLE/renderer/gl/WorkaroundsGL.h @@ -14,6 +14,8 @@ namespace rx struct WorkaroundsGL { + WorkaroundsGL(); + // When writing a float to a normalized integer framebuffer, desktop OpenGL is allowed to write // one of the two closest normalized integer representations (although round to nearest is // preferred) (see section 2.3.5.2 of the GL 4.5 core specification). OpenGL ES requires that @@ -142,6 +144,9 @@ struct WorkaroundsGL // On some Android devices for loops used to initialize variables hit native GLSL compiler bugs. bool dontUseLoopsToInitializeVariables = false; }; + +inline WorkaroundsGL::WorkaroundsGL() = default; + } // namespace rx #endif // LIBANGLE_RENDERER_GL_WORKAROUNDSGL_H_ diff --git a/src/libANGLE/renderer/gl/formatutilsgl.cpp b/src/libANGLE/renderer/gl/formatutilsgl.cpp index 180e0a7a9..1829d4650 100644 --- a/src/libANGLE/renderer/gl/formatutilsgl.cpp +++ b/src/libANGLE/renderer/gl/formatutilsgl.cpp @@ -27,6 +27,12 @@ SupportRequirement::SupportRequirement() { } +SupportRequirement::SupportRequirement(const SupportRequirement &other) = default; + +SupportRequirement::~SupportRequirement() +{ +} + InternalFormat::InternalFormat() : texture(), filter(), @@ -35,6 +41,12 @@ InternalFormat::InternalFormat() { } +InternalFormat::InternalFormat(const InternalFormat &other) = default; + +InternalFormat::~InternalFormat() +{ +} + // supported = version || vertexExt static inline SupportRequirement VersionOrExts(GLuint major, GLuint minor, const std::string &versionExt) { diff --git a/src/libANGLE/renderer/gl/formatutilsgl.h b/src/libANGLE/renderer/gl/formatutilsgl.h index 616f37af2..b83e9bb7f 100644 --- a/src/libANGLE/renderer/gl/formatutilsgl.h +++ b/src/libANGLE/renderer/gl/formatutilsgl.h @@ -28,6 +28,8 @@ namespace nativegl struct SupportRequirement { SupportRequirement(); + SupportRequirement(const SupportRequirement &other); + ~SupportRequirement(); // Version that this format became supported without extensions gl::Version version; @@ -42,6 +44,8 @@ struct SupportRequirement struct InternalFormat { InternalFormat(); + InternalFormat(const InternalFormat &other); + ~InternalFormat(); SupportRequirement texture; SupportRequirement filter; diff --git a/src/libANGLE/renderer/gl/wgl/FunctionsWGL.cpp b/src/libANGLE/renderer/gl/wgl/FunctionsWGL.cpp index 2cfe6e9eb..b3a947398 100644 --- a/src/libANGLE/renderer/gl/wgl/FunctionsWGL.cpp +++ b/src/libANGLE/renderer/gl/wgl/FunctionsWGL.cpp @@ -97,6 +97,10 @@ FunctionsWGL::FunctionsWGL() { } +FunctionsWGL::~FunctionsWGL() +{ +} + void FunctionsWGL::initialize(HMODULE glModule, HDC context) { // First grab the wglGetProcAddress function from the gl module diff --git a/src/libANGLE/renderer/gl/wgl/FunctionsWGL.h b/src/libANGLE/renderer/gl/wgl/FunctionsWGL.h index 30cf9ebc0..9f09f6215 100644 --- a/src/libANGLE/renderer/gl/wgl/FunctionsWGL.h +++ b/src/libANGLE/renderer/gl/wgl/FunctionsWGL.h @@ -19,6 +19,7 @@ class FunctionsWGL : angle::NonCopyable { public: FunctionsWGL(); + ~FunctionsWGL(); // Loads all available wgl functions, may be called multiple times void initialize(HMODULE glModule, HDC context); diff --git a/src/libANGLE/renderer/vulkan/BufferVk.cpp b/src/libANGLE/renderer/vulkan/BufferVk.cpp index fb828c87e..4b35e0f10 100644 --- a/src/libANGLE/renderer/vulkan/BufferVk.cpp +++ b/src/libANGLE/renderer/vulkan/BufferVk.cpp @@ -47,7 +47,7 @@ gl::Error BufferVk::setData(const gl::Context *context, gl::BufferUsage usage) { ContextVk *contextVk = vk::GetImpl(context); - auto device = contextVk->getDevice(); + VkDevice device = contextVk->getDevice(); if (size > mCurrentRequiredSize) { diff --git a/src/libANGLE/renderer/vulkan/ContextVk.cpp b/src/libANGLE/renderer/vulkan/ContextVk.cpp index 6972e6f04..0ba2082f8 100644 --- a/src/libANGLE/renderer/vulkan/ContextVk.cpp +++ b/src/libANGLE/renderer/vulkan/ContextVk.cpp @@ -255,9 +255,9 @@ gl::Error ContextVk::initPipeline(const gl::Context *context) VkDevice device = mRenderer->getDevice(); const auto &state = mState.getState(); - const auto &programGL = state.getProgram(); - const auto &vao = state.getVertexArray(); - const auto *drawFBO = state.getDrawFramebuffer(); + const gl::Program *programGL = state.getProgram(); + const gl::VertexArray *vao = state.getVertexArray(); + const gl::Framebuffer *drawFBO = state.getDrawFramebuffer(); ProgramVk *programVk = vk::GetImpl(programGL); FramebufferVk *vkFBO = vk::GetImpl(drawFBO); VertexArrayVk *vkVAO = vk::GetImpl(vao); @@ -308,9 +308,9 @@ gl::Error ContextVk::setupDraw(const gl::Context *context, GLenum mode) } const auto &state = mState.getState(); - const auto &programGL = state.getProgram(); + const gl::Program *programGL = state.getProgram(); ProgramVk *programVk = vk::GetImpl(programGL); - const auto &vao = state.getVertexArray(); + const gl::VertexArray *vao = state.getVertexArray(); VertexArrayVk *vkVAO = vk::GetImpl(vao); const auto *drawFBO = state.getDrawFramebuffer(); FramebufferVk *vkFBO = vk::GetImpl(drawFBO); diff --git a/src/libANGLE/renderer/vulkan/ProgramVk.cpp b/src/libANGLE/renderer/vulkan/ProgramVk.cpp index 01d11a31b..c102ae97c 100644 --- a/src/libANGLE/renderer/vulkan/ProgramVk.cpp +++ b/src/libANGLE/renderer/vulkan/ProgramVk.cpp @@ -134,6 +134,10 @@ ProgramVk::DefaultUniformBlock::DefaultUniformBlock() { } +ProgramVk::DefaultUniformBlock::~DefaultUniformBlock() +{ +} + ProgramVk::ProgramVk(const gl::ProgramState &state) : ProgramImpl(state), mDefaultUniformBlocks(), mDescriptorSetOffset(0), mDirtyTextures(true) { diff --git a/src/libANGLE/renderer/vulkan/ProgramVk.h b/src/libANGLE/renderer/vulkan/ProgramVk.h index aa382ddb9..4da6d3806 100644 --- a/src/libANGLE/renderer/vulkan/ProgramVk.h +++ b/src/libANGLE/renderer/vulkan/ProgramVk.h @@ -135,6 +135,7 @@ class ProgramVk : public ProgramImpl struct DefaultUniformBlock final : private angle::NonCopyable { DefaultUniformBlock(); + ~DefaultUniformBlock(); vk::BufferAndMemory storage; diff --git a/src/libANGLE/renderer/vulkan/RendererVk.cpp b/src/libANGLE/renderer/vulkan/RendererVk.cpp index 7289f0db8..f98f24216 100644 --- a/src/libANGLE/renderer/vulkan/RendererVk.cpp +++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp @@ -41,7 +41,7 @@ VkResult VerifyExtensionsPresent(const std::vector &exten extensionNames.insert(extensionProp.extensionName); } - for (const auto &extensionName : enabledExtensionNames) + for (const char *extensionName : enabledExtensionNames) { if (extensionNames.count(extensionName) == 0) { diff --git a/src/libANGLE/renderer/vulkan/SurfaceVk.cpp b/src/libANGLE/renderer/vulkan/SurfaceVk.cpp index 76b52907f..ed2ed9508 100644 --- a/src/libANGLE/renderer/vulkan/SurfaceVk.cpp +++ b/src/libANGLE/renderer/vulkan/SurfaceVk.cpp @@ -157,6 +157,10 @@ gl::Error OffscreenSurfaceVk::initializeContents(const gl::Context *context, return gl::NoError(); } +WindowSurfaceVk::SwapchainImage::SwapchainImage() = default; +WindowSurfaceVk::SwapchainImage::SwapchainImage(WindowSurfaceVk::SwapchainImage &&other) = default; +WindowSurfaceVk::SwapchainImage::~SwapchainImage() = default; + WindowSurfaceVk::WindowSurfaceVk(const egl::SurfaceState &surfaceState, EGLNativeWindowType window, EGLint width, @@ -230,7 +234,7 @@ vk::Error WindowSurfaceVk::initializeImpl(RendererVk *renderer) uint32_t presentQueue = 0; ANGLE_TRY_RESULT(renderer->selectPresentQueueForSurface(mSurface), presentQueue); - const auto &physicalDevice = renderer->getPhysicalDevice(); + const VkPhysicalDevice &physicalDevice = renderer->getPhysicalDevice(); VkSurfaceCapabilitiesKHR surfaceCaps; ANGLE_VK_TRY(vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, mSurface, &surfaceCaps)); diff --git a/src/libANGLE/renderer/vulkan/SurfaceVk.h b/src/libANGLE/renderer/vulkan/SurfaceVk.h index 0388f0d05..531f5ea76 100644 --- a/src/libANGLE/renderer/vulkan/SurfaceVk.h +++ b/src/libANGLE/renderer/vulkan/SurfaceVk.h @@ -129,6 +129,10 @@ class WindowSurfaceVk : public SurfaceImpl, public ResourceVk struct SwapchainImage { + SwapchainImage(); + SwapchainImage(SwapchainImage &&other); + ~SwapchainImage(); + vk::Image image; vk::ImageView imageView; vk::Framebuffer framebuffer; diff --git a/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp b/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp index 02c24ad1c..eab97496e 100644 --- a/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp +++ b/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp @@ -29,6 +29,10 @@ VertexArrayVk::VertexArrayVk(const gl::VertexArrayState &state) mCurrentVertexAttribDescs.reserve(state.getMaxAttribs()); } +VertexArrayVk::~VertexArrayVk() +{ +} + void VertexArrayVk::destroy(const gl::Context *context) { } @@ -40,7 +44,7 @@ void VertexArrayVk::syncState(const gl::Context *context, // Invalidate current pipeline. // TODO(jmadill): Use pipeline cache. - auto contextVk = vk::GetImpl(context); + ContextVk *contextVk = vk::GetImpl(context); contextVk->invalidateCurrentPipeline(); // Invalidate the vertex descriptions. diff --git a/src/libANGLE/renderer/vulkan/VertexArrayVk.h b/src/libANGLE/renderer/vulkan/VertexArrayVk.h index b103d06ee..1c70abec3 100644 --- a/src/libANGLE/renderer/vulkan/VertexArrayVk.h +++ b/src/libANGLE/renderer/vulkan/VertexArrayVk.h @@ -21,6 +21,8 @@ class VertexArrayVk : public VertexArrayImpl { public: VertexArrayVk(const gl::VertexArrayState &state); + ~VertexArrayVk() override; + void destroy(const gl::Context *context) override; void syncState(const gl::Context *context, diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp index 21edfd903..dda802768 100644 --- a/src/libANGLE/validationES.cpp +++ b/src/libANGLE/validationES.cpp @@ -2361,7 +2361,7 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context, } const auto &state = context->getGLState(); - auto readFramebuffer = state.getReadFramebuffer(); + Framebuffer *readFramebuffer = state.getReadFramebuffer(); if (readFramebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE) { context->handleError(InvalidFramebufferOperation()); @@ -5154,7 +5154,7 @@ bool ValidateReadPixelsBase(Context *context, return false; } - auto readFramebuffer = context->getGLState().getReadFramebuffer(); + Framebuffer *readFramebuffer = context->getGLState().getReadFramebuffer(); if (readFramebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE) { diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp index cd835b3da..5e505aa60 100644 --- a/src/libANGLE/validationES2.cpp +++ b/src/libANGLE/validationES2.cpp @@ -2533,7 +2533,7 @@ bool ValidateBlitFramebufferANGLE(Context *context, bool ValidateClear(ValidationContext *context, GLbitfield mask) { - auto fbo = context->getGLState().getDrawFramebuffer(); + Framebuffer *fbo = context->getGLState().getDrawFramebuffer(); if (fbo->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE) { context->handleError(InvalidFramebufferOperation()); diff --git a/src/libANGLE/validationES3.cpp b/src/libANGLE/validationES3.cpp index e8167ebe5..1aadfc876 100644 --- a/src/libANGLE/validationES3.cpp +++ b/src/libANGLE/validationES3.cpp @@ -2152,7 +2152,7 @@ bool ValidateBeginTransformFeedback(Context *context, GLenum primitiveMode) } } - auto program = context->getGLState().getProgram(); + Program *program = context->getGLState().getProgram(); if (!program) { diff --git a/util/OSWindow.cpp b/util/OSWindow.cpp index abe8607af..33e7e95bc 100644 --- a/util/OSWindow.cpp +++ b/util/OSWindow.cpp @@ -271,6 +271,11 @@ int OSWindow::getHeight() const return mHeight; } +bool OSWindow::takeScreenshot(uint8_t *pixelData) +{ + return false; +} + bool OSWindow::popEvent(Event *event) { if (mEvents.size() > 0 && event) diff --git a/util/OSWindow.h b/util/OSWindow.h index 6cb239152..467179235 100644 --- a/util/OSWindow.h +++ b/util/OSWindow.h @@ -35,7 +35,7 @@ class ANGLE_EXPORT OSWindow // normalized unsigned byte BGRA array. Note that it will be used to test the window // manager's behavior so it needs to take an actual screenshot of the screen and not // just grab the pixels of the window. Returns if it was successful. - virtual bool takeScreenshot(uint8_t *pixelData) { return false; } + virtual bool takeScreenshot(uint8_t *pixelData); virtual EGLNativeWindowType getNativeWindow() const = 0; virtual EGLNativeDisplayType getNativeDisplay() const = 0; diff --git a/util/geometry_utils.cpp b/util/geometry_utils.cpp index f14f9d113..2f7593cbc 100644 --- a/util/geometry_utils.cpp +++ b/util/geometry_utils.cpp @@ -14,6 +14,22 @@ using namespace angle; +SphereGeometry::SphereGeometry() +{ +} + +SphereGeometry::~SphereGeometry() +{ +} + +CubeGeometry::CubeGeometry() +{ +} + +CubeGeometry::~CubeGeometry() +{ +} + void CreateSphereGeometry(size_t sliceCount, float radius, SphereGeometry *result) { size_t parellelCount = sliceCount / 2; diff --git a/util/geometry_utils.h b/util/geometry_utils.h index 057dd2520..70026476b 100644 --- a/util/geometry_utils.h +++ b/util/geometry_utils.h @@ -20,6 +20,9 @@ struct ANGLE_EXPORT SphereGeometry { + SphereGeometry(); + ~SphereGeometry(); + std::vector positions; std::vector normals; std::vector indices; @@ -29,6 +32,9 @@ ANGLE_EXPORT void CreateSphereGeometry(size_t sliceCount, float radius, SphereGe struct ANGLE_EXPORT CubeGeometry { + CubeGeometry(); + ~CubeGeometry(); + std::vector positions; std::vector normals; std::vector texcoords;