Commit 8b4f8f84 by Jamie Madill

Fix D3D11 resource leaks.

A few bugs, like missing destructors or Release calls were leaking D3D resources in a few places on exit. This patch should fix all the unreleased D3D object warnings on exit when running a sample app. BUG=angle:589 Change-Id: Ib50df3229998938cddc2859d6f2d19ddd3a4db47 Reviewed-on: https://chromium-review.googlesource.com/190079Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 0979e7aa
...@@ -92,6 +92,11 @@ ProgramBinary::VertexExecutable::VertexExecutable(rx::Renderer *const renderer, ...@@ -92,6 +92,11 @@ ProgramBinary::VertexExecutable::VertexExecutable(rx::Renderer *const renderer,
} }
} }
ProgramBinary::VertexExecutable::~VertexExecutable()
{
delete mShaderExecutable;
}
bool ProgramBinary::VertexExecutable::matchesInputLayout(const VertexFormat attributes[]) const bool ProgramBinary::VertexExecutable::matchesInputLayout(const VertexFormat attributes[]) const
{ {
for (size_t attributeIndex = 0; attributeIndex < gl::MAX_VERTEX_ATTRIBS; attributeIndex++) for (size_t attributeIndex = 0; attributeIndex < gl::MAX_VERTEX_ATTRIBS; attributeIndex++)
......
...@@ -219,6 +219,8 @@ class ProgramBinary : public RefCountObject ...@@ -219,6 +219,8 @@ class ProgramBinary : public RefCountObject
VertexExecutable(rx::Renderer *const renderer, VertexExecutable(rx::Renderer *const renderer,
const VertexFormat inputLayout[gl::MAX_VERTEX_ATTRIBS], const VertexFormat inputLayout[gl::MAX_VERTEX_ATTRIBS],
rx::ShaderExecutable *shaderExecutable); rx::ShaderExecutable *shaderExecutable);
~VertexExecutable();
bool matchesInputLayout(const VertexFormat attributes[gl::MAX_VERTEX_ATTRIBS]) const; bool matchesInputLayout(const VertexFormat attributes[gl::MAX_VERTEX_ATTRIBS]) const;
const VertexFormat *inputs() const { return mInputs; } const VertexFormat *inputs() const { return mInputs; }
......
...@@ -99,6 +99,7 @@ class Renderer ...@@ -99,6 +99,7 @@ class Renderer
{ {
public: public:
explicit Renderer(egl::Display *display); explicit Renderer(egl::Display *display);
virtual ~Renderer() {}
virtual EGLint initialize() = 0; virtual EGLint initialize() = 0;
virtual bool resetDevice() = 0; virtual bool resetDevice() = 0;
......
...@@ -78,6 +78,7 @@ void SwapChain11::releaseOffscreenTexture() ...@@ -78,6 +78,7 @@ void SwapChain11::releaseOffscreenTexture()
SafeRelease(mOffscreenSRView); SafeRelease(mOffscreenSRView);
SafeRelease(mDepthStencilTexture); SafeRelease(mDepthStencilTexture);
SafeRelease(mDepthStencilDSView); SafeRelease(mDepthStencilDSView);
SafeRelease(mDepthStencilSRView);
} }
EGLint SwapChain11::resetOffscreenTexture(int backbufferWidth, int backbufferHeight) EGLint SwapChain11::resetOffscreenTexture(int backbufferWidth, int backbufferHeight)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment