Revert "Destroy backend implementation for Buffers"

This reverts commit b6a80b321e.

Reason for revert: dawn_end2end_tests are failing on the Chromium GPU FYI bots. Example here: https://ci.chromium.org/p/chromium/builders/ci/Win10%20FYI%20Release%20%28NVIDIA%29/4226

Original change's description:
> Destroy backend implementation for Buffers
> 
> Destroy can be used to free the GPU memory associated with resources
> without waiting for javascript garbage collection to occur.
> The buffer is validated at submission to the queue.
> So any buffer that has been destroyed before submission, will then
> invalidate the submit and result in an error.
> 
> Bug: dawn:46
> Change-Id: I40df56ce97baef01deea7552d7a6d40b558fc985
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5320
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Natasha Lee <natlee@microsoft.com>

TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org,rafael.cintron@microsoft.com,natlee@microsoft.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dawn:46
Change-Id: Iadf37a8a6675c744207ec7daaa3fd2fde7da3714
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5480
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng
2019-03-09 00:06:38 +00:00
committed by Commit Bot service account
parent 8c1a90199a
commit 9bf529ec94
14 changed files with 11 additions and 179 deletions

View File

@@ -27,10 +27,6 @@ namespace dawn_native { namespace opengl {
glBufferData(GL_ARRAY_BUFFER, GetSize(), nullptr, GL_STATIC_DRAW);
}
Buffer::~Buffer() {
DestroyImpl();
}
GLuint Buffer::GetHandle() const {
return mBuffer;
}
@@ -62,9 +58,4 @@ namespace dawn_native { namespace opengl {
glUnmapBuffer(GL_ARRAY_BUFFER);
}
void Buffer::DestroyImpl() {
glDeleteBuffers(1, &mBuffer);
mBuffer = 0;
}
}} // namespace dawn_native::opengl

View File

@@ -26,7 +26,6 @@ namespace dawn_native { namespace opengl {
class Buffer : public BufferBase {
public:
Buffer(Device* device, const BufferDescriptor* descriptor);
~Buffer();
GLuint GetHandle() const;
@@ -35,7 +34,6 @@ namespace dawn_native { namespace opengl {
void MapReadAsyncImpl(uint32_t serial) override;
void MapWriteAsyncImpl(uint32_t serial) override;
void UnmapImpl() override;
void DestroyImpl() override;
GLuint mBuffer = 0;
};