mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 17:05:31 +00:00
Eagerly destroy CommandBuffer commands after submission
Command buffers hold references to all encoded objects. Freeing them eagerly significantly reduces the amount memory held before the JS GC clears the command buffers. Bug: dawn:262, dawn:372 Change-Id: I68dfa973f980fba8d94611ed1de3c593bdb91a63 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26562 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
f7905c3cb5
commit
76d9e34bbc
@@ -442,11 +442,7 @@ namespace dawn_native { namespace opengl {
|
||||
} // namespace
|
||||
|
||||
CommandBuffer::CommandBuffer(CommandEncoder* encoder, const CommandBufferDescriptor* descriptor)
|
||||
: CommandBufferBase(encoder, descriptor), mCommands(encoder->AcquireCommands()) {
|
||||
}
|
||||
|
||||
CommandBuffer::~CommandBuffer() {
|
||||
FreeCommands(&mCommands);
|
||||
: CommandBufferBase(encoder, descriptor) {
|
||||
}
|
||||
|
||||
void CommandBuffer::Execute() {
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#ifndef DAWNNATIVE_OPENGL_COMMANDBUFFERGL_H_
|
||||
#define DAWNNATIVE_OPENGL_COMMANDBUFFERGL_H_
|
||||
|
||||
#include "dawn_native/CommandAllocator.h"
|
||||
#include "dawn_native/CommandBuffer.h"
|
||||
|
||||
namespace dawn_native {
|
||||
@@ -33,11 +32,8 @@ namespace dawn_native { namespace opengl {
|
||||
void Execute();
|
||||
|
||||
private:
|
||||
~CommandBuffer() override;
|
||||
void ExecuteComputePass();
|
||||
void ExecuteRenderPass(BeginRenderPassCmd* renderPass);
|
||||
|
||||
CommandIterator mCommands;
|
||||
};
|
||||
|
||||
}} // namespace dawn_native::opengl
|
||||
|
||||
Reference in New Issue
Block a user