summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Nilsson <marcus.nilsson@genarp.com>2022-12-06 20:37:53 +0100
committerAndreas Kling <kling@serenityos.org>2022-12-07 11:46:37 +0100
commitf76c7f3788242e8b486c51cd251e6c59179e33dd (patch)
tree724ec24c03ac6dc8a65560e64479bc0a8c95cce9
parent54abfcf835eb168eddbc4dd1395b3e8a6f688fe6 (diff)
downloadserenity-f76c7f3788242e8b486c51cd251e6c59179e33dd.zip
LibGL: Generate GL_OUT_OF_MEMORY error in `glBufferData` when OOM
-rw-r--r--Userland/Libraries/LibGL/Buffer.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGL/Buffer.cpp b/Userland/Libraries/LibGL/Buffer.cpp
index 2cd15423ec..b7d5676187 100644
--- a/Userland/Libraries/LibGL/Buffer.cpp
+++ b/Userland/Libraries/LibGL/Buffer.cpp
@@ -51,8 +51,7 @@ void GLContext::gl_buffer_data(GLenum target, GLsizeiptr size, void const* data,
auto& target_buffer = target == GL_ELEMENT_ARRAY_BUFFER ? m_element_array_buffer : m_array_buffer;
RETURN_WITH_ERROR_IF(!target_buffer, GL_INVALID_OPERATION);
- // FIXME: Report GL_OUT_OF_MEMORY or other errors as needed here
- MUST(target_buffer->set_data(data, size));
+ RETURN_WITH_ERROR_IF(target_buffer->set_data(data, size).is_error(), GL_OUT_OF_MEMORY);
}
void GLContext::gl_buffer_sub_data(GLenum target, GLintptr offset, GLsizeiptr size, void const* data)