-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[opengl] [refactor] Fix memory leakages using modern C++ memory manag…
…ement features (#696) * [skip ci] fix memory leakage in create_glsl_root_buffer * [skip ci] use another way to test passing * I love C++! * [skip ci] minor changes * [skip ci] tmp work save * [skip ci] apply k-ye's suggestions * [skip ci] no gc * [skip ci] no a * add opengl::GLSLLauncher (like metal::KernelManager) * [skip ci] really done GLSLLauncher * try GLSLLaunchGuard * fix non-GL build * [skip ci] no dirty words * [skip ci] use resize * fix non-GL build again * nongl fix again * really fix * [skip ci] remove unused * [skip ci] enforce code format * [skip ci] apply reviews * fix non-GL build Co-authored-by: Taichi Gardener <taichigardener@gmail.com>
- Loading branch information
1 parent
213a3c7
commit 24e76a1
Showing
7 changed files
with
158 additions
and
99 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 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
#include "opengl_kernel_util.h" | ||
|
||
TLANG_NAMESPACE_BEGIN | ||
|
||
namespace opengl { | ||
|
||
struct GLSLLauncherImpl; | ||
|
||
struct GLSLLaunchGuard { | ||
GLSLLauncherImpl *impl; | ||
const std::vector<IOV> &iov; | ||
GLSLLaunchGuard(GLSLLauncherImpl *impl, const std::vector<IOV> &iov); | ||
~GLSLLaunchGuard(); | ||
}; | ||
|
||
struct GLSLLauncher { | ||
std::unique_ptr<GLSLLauncherImpl> impl; | ||
GLSLLauncher(size_t size); | ||
~GLSLLauncher(); | ||
GLSLLaunchGuard create_launch_guard(const std::vector<IOV> &iov) { | ||
return GLSLLaunchGuard(impl.get(), iov); | ||
} | ||
}; | ||
|
||
} // namespace opengl | ||
|
||
TLANG_NAMESPACE_END |
Oops, something went wrong.