Mesa (main): bufferobj: inline page commitment
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Dec 15 14:02:49 UTC 2021
Module: Mesa
Branch: main
Commit: 955ddc02e433ef7d9e41412134d4725f4a4b3451
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=955ddc02e433ef7d9e41412134d4725f4a4b3451
Author: Dave Airlie <airlied at redhat.com>
Date: Thu Dec 9 13:38:14 2021 +1000
bufferobj: inline page commitment
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
---
src/mesa/main/bufferobj.c | 26 ++++++++------------------
1 file changed, 8 insertions(+), 18 deletions(-)
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 8ee45be7ed2..cd387a61a7b 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -611,23 +611,6 @@ clear_buffer_subdata_sw(struct gl_context *ctx,
_mesa_bufferobj_unmap(ctx, bufObj, MAP_INTERNAL);
}
-static void
-bufferobj_page_commitment(struct gl_context *ctx,
- struct gl_buffer_object *bufferObj,
- GLintptr offset, GLsizeiptr size,
- GLboolean commit)
-{
- struct pipe_context *pipe = ctx->pipe;
- struct pipe_box box;
-
- u_box_1d(offset, size, &box);
-
- if (!pipe->resource_commit(pipe, bufferObj->buffer, 0, &box, commit)) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBufferPageCommitmentARB(out of memory)");
- return;
- }
-}
-
/**
* Helper to warn of possible performance issues, such as frequently
* updating a buffer created with GL_STATIC_DRAW. Called via the macro
@@ -5356,7 +5339,14 @@ buffer_page_commitment(struct gl_context *ctx,
return;
}
- bufferobj_page_commitment(ctx, bufferObj, offset, size, commit);
+ struct pipe_context *pipe = ctx->pipe;
+ struct pipe_box box;
+
+ u_box_1d(offset, size, &box);
+
+ if (!pipe->resource_commit(pipe, bufferObj->buffer, 0, &box, commit)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBufferPageCommitmentARB(out of memory)");
+ }
}
void GLAPIENTRY
More information about the mesa-commit
mailing list