forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement resource management for GL_EXT_memory_object
This implements glCreateMemoryObjectsEXT, glDeleteMemoryObjectsEXT, and glIsMemoryObjectEXT. It's not possible to do anything useful with them yet. Bug: angleproject:3289 Change-Id: I8882b657e9de564b5f97f8dea87838f67b1928f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552025 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
- Loading branch information
Showing
23 changed files
with
264 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Copyright 2019 The ANGLE Project Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
// | ||
// MemoryObject.h: Implements the gl::MemoryObject class [EXT_external_objects] | ||
|
||
#include "libANGLE/MemoryObject.h" | ||
|
||
#include "common/angleutils.h" | ||
#include "libANGLE/renderer/GLImplFactory.h" | ||
#include "libANGLE/renderer/MemoryObjectImpl.h" | ||
|
||
namespace gl | ||
{ | ||
|
||
MemoryObject::MemoryObject(rx::GLImplFactory *factory, GLuint id) | ||
: RefCountObject(id), mImplementation(factory->createMemoryObject()) | ||
{} | ||
|
||
MemoryObject::~MemoryObject() | ||
{ | ||
} | ||
|
||
void MemoryObject::onDestroy(const Context *context) | ||
{ | ||
mImplementation->onDestroy(context); | ||
} | ||
|
||
} // namespace gl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// Copyright 2019 The ANGLE Project Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
// | ||
// MemoryObject.h: Defines the gl::MemoryObject class [EXT_external_objects] | ||
|
||
#ifndef LIBANGLE_MEMORYOBJECT_H_ | ||
#define LIBANGLE_MEMORYOBJECT_H_ | ||
|
||
#include "angle_gl.h" | ||
#include "common/angleutils.h" | ||
#include "libANGLE/Error.h" | ||
#include "libANGLE/RefCountObject.h" | ||
|
||
namespace rx | ||
{ | ||
class GLImplFactory; | ||
class MemoryObjectImpl; | ||
} // namespace rx | ||
|
||
namespace gl | ||
{ | ||
|
||
class MemoryObject final : public RefCountObject | ||
{ | ||
public: | ||
MemoryObject(rx::GLImplFactory *factory, GLuint id); | ||
~MemoryObject() override; | ||
|
||
void onDestroy(const Context *context) override; | ||
|
||
private: | ||
std::unique_ptr<rx::MemoryObjectImpl> mImplementation; | ||
}; | ||
|
||
} // namespace gl | ||
|
||
#endif // LIBANGLE_MEMORYOBJECT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// Copyright 2019 The ANGLE Project Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
// | ||
// MemoryObjectImpl.h: Implements the rx::MemoryObjectImpl class [EXT_external_objects] | ||
|
||
#ifndef LIBANGLE_RENDERER_MEMORYOBJECTIMPL_H_ | ||
#define LIBANGLE_RENDERER_MEMORYOBJECTIMPL_H_ | ||
|
||
#include "angle_gl.h" | ||
#include "common/angleutils.h" | ||
#include "libANGLE/Error.h" | ||
|
||
namespace gl | ||
{ | ||
class Context; | ||
class MemoryObject; | ||
} // namespace gl | ||
|
||
namespace rx | ||
{ | ||
|
||
class MemoryObjectImpl : angle::NonCopyable | ||
{ | ||
public: | ||
virtual ~MemoryObjectImpl() {} | ||
|
||
virtual void onDestroy(const gl::Context *context) = 0; | ||
}; | ||
|
||
} // namespace rx | ||
|
||
#endif // LIBANGLE_RENDERER_MEMORYOBJECTIMPL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.