aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/bufferobj.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-02-22 14:31:16 +0100
committermarha <marha@users.sourceforge.net>2015-02-22 14:31:16 +0100
commitf1c2db43dcf35d2cf4715390bd2391c28e42a8c2 (patch)
tree46b537271afe0f6534231b1bd4cc4f91ae1fb446 /mesalib/src/mesa/main/bufferobj.c
parent5e5a48ff8cd08f123601cd0625ca62a86675aac9 (diff)
downloadvcxsrv-f1c2db43dcf35d2cf4715390bd2391c28e42a8c2.tar.gz
vcxsrv-f1c2db43dcf35d2cf4715390bd2391c28e42a8c2.tar.bz2
vcxsrv-f1c2db43dcf35d2cf4715390bd2391c28e42a8c2.zip
xwininfo fontconfig libX11 libXdmcp libfontenc libxcb libxcb/xcb-proto mesalib xserver xkeyboard-config mkfontscale git update 22 Feb 2015
xserver commit 3a06faf3fcdb7451125a46181f9152e8e59e9770 libxcb commit e3ec1f74637237ce500dfd0ca59f2e422da4e019 libxcb/xcb-proto commit 4c550465934164aab2449a125f75f4ca07816233 xkeyboard-config commit 26f344c93f8c6141e9233eb68088ba4fd56bc9ef libX11 commit c8e19b393defd53f046ddc2da3a16881221b3c34 libXdmcp commit 9f4cac7656b221ce2a8f97e7bd31e5e23126d001 libfontenc commit de1843aaf76015c9d99416f3122d169fe331b849 mkfontscale commit 87d628f8eec170ec13bb9feefb1ce05aed07d1d6 xwininfo commit 0c49f8f2bd56b1e77721e81030ea948386dcdf4e fontconfig commit d6d5adeb7940c0d0beb86489c2a1c2ce59e5c044 mesa commit 4359954d842caa2a9f8d4b50d70ecc789884b68b
Diffstat (limited to 'mesalib/src/mesa/main/bufferobj.c')
-rw-r--r--mesalib/src/mesa/main/bufferobj.c53
1 files changed, 41 insertions, 12 deletions
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c
index 2bae1bc72..b372c68f2 100644
--- a/mesalib/src/mesa/main/bufferobj.c
+++ b/mesalib/src/mesa/main/bufferobj.c
@@ -117,6 +117,11 @@ get_buffer_target(struct gl_context *ctx, GLenum target)
return &ctx->AtomicBuffer;
}
break;
+ case GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD:
+ if (ctx->Extensions.AMD_pinned_memory) {
+ return &ctx->ExternalVirtualMemoryBuffer;
+ }
+ break;
default:
return NULL;
}
@@ -1226,7 +1231,7 @@ _mesa_DeleteBuffers(GLsizei n, const GLuint *ids)
}
}
- if (ctx->UniformBuffer == bufObj) {
+ if (ctx->AtomicBuffer == bufObj) {
_mesa_BindBuffer( GL_ATOMIC_COUNTER_BUFFER, 0 );
}
@@ -1242,6 +1247,10 @@ _mesa_DeleteBuffers(GLsizei n, const GLuint *ids)
_mesa_BindBuffer( GL_TEXTURE_BUFFER, 0 );
}
+ if (ctx->ExternalVirtualMemoryBuffer == bufObj) {
+ _mesa_BindBuffer(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, 0);
+ }
+
/* The ID is immediately freed for re-use */
_mesa_HashRemove(ctx->Shared->BufferObjects, ids[i]);
/* Make sure we do not run into the classic ABA problem on bind.
@@ -1381,7 +1390,16 @@ _mesa_BufferStorage(GLenum target, GLsizeiptr size, const GLvoid *data,
ASSERT(ctx->Driver.BufferData);
if (!ctx->Driver.BufferData(ctx, target, size, data, GL_DYNAMIC_DRAW,
flags, bufObj)) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBufferStorage()");
+ if (target == GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD) {
+ /* Even though the interaction between AMD_pinned_memory and
+ * glBufferStorage is not described in the spec, Graham Sellers
+ * said that it should behave the same as glBufferData.
+ */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBufferStorage()");
+ }
+ else {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBufferStorage()");
+ }
}
}
@@ -1465,7 +1483,18 @@ _mesa_BufferData(GLenum target, GLsizeiptrARB size,
GL_MAP_WRITE_BIT |
GL_DYNAMIC_STORAGE_BIT,
bufObj)) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBufferDataARB()");
+ if (target == GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD) {
+ /* From GL_AMD_pinned_memory:
+ *
+ * INVALID_OPERATION is generated by BufferData if <target> is
+ * EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, and the store cannot be
+ * mapped to the GPU address space.
+ */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBufferData()");
+ }
+ else {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBufferData()");
+ }
}
}
@@ -2887,7 +2916,7 @@ static void
unbind_uniform_buffers(struct gl_context *ctx, GLuint first, GLsizei count)
{
struct gl_buffer_object *bufObj = ctx->Shared->NullBufferObj;
- GLuint i;
+ GLint i;
for (i = 0; i < count; i++)
set_ubo_binding(ctx, &ctx->UniformBufferBindings[first + i],
@@ -2898,7 +2927,7 @@ static void
bind_uniform_buffers_base(struct gl_context *ctx, GLuint first, GLsizei count,
const GLuint *buffers)
{
- GLuint i;
+ GLint i;
if (!error_check_bind_uniform_buffers(ctx, first, count, "glBindBuffersBase"))
return;
@@ -2965,7 +2994,7 @@ bind_uniform_buffers_range(struct gl_context *ctx, GLuint first, GLsizei count,
const GLuint *buffers,
const GLintptr *offsets, const GLsizeiptr *sizes)
{
- GLuint i;
+ GLint i;
if (!error_check_bind_uniform_buffers(ctx, first, count,
"glBindBuffersRange"))
@@ -3122,7 +3151,7 @@ unbind_xfb_buffers(struct gl_context *ctx,
GLuint first, GLsizei count)
{
struct gl_buffer_object * const bufObj = ctx->Shared->NullBufferObj;
- GLuint i;
+ GLint i;
for (i = 0; i < count; i++)
_mesa_set_transform_feedback_binding(ctx, tfObj, first + i,
@@ -3136,7 +3165,7 @@ bind_xfb_buffers_base(struct gl_context *ctx,
{
struct gl_transform_feedback_object *tfObj =
ctx->TransformFeedback.CurrentObject;
- GLuint i;
+ GLint i;
if (!error_check_bind_xfb_buffers(ctx, tfObj, first, count,
"glBindBuffersBase"))
@@ -3204,7 +3233,7 @@ bind_xfb_buffers_range(struct gl_context *ctx,
{
struct gl_transform_feedback_object *tfObj =
ctx->TransformFeedback.CurrentObject;
- GLuint i;
+ GLint i;
if (!error_check_bind_xfb_buffers(ctx, tfObj, first, count,
"glBindBuffersRange"))
@@ -3342,7 +3371,7 @@ static void
unbind_atomic_buffers(struct gl_context *ctx, GLuint first, GLsizei count)
{
struct gl_buffer_object * const bufObj = ctx->Shared->NullBufferObj;
- GLuint i;
+ GLint i;
for (i = 0; i < count; i++)
set_atomic_buffer_binding(ctx, &ctx->AtomicBufferBindings[first + i],
@@ -3355,7 +3384,7 @@ bind_atomic_buffers_base(struct gl_context *ctx,
GLsizei count,
const GLuint *buffers)
{
- GLuint i;
+ GLint i;
if (!error_check_bind_atomic_buffers(ctx, first, count,
"glBindBuffersBase"))
@@ -3422,7 +3451,7 @@ bind_atomic_buffers_range(struct gl_context *ctx,
const GLintptr *offsets,
const GLsizeiptr *sizes)
{
- GLuint i;
+ GLint i;
if (!error_check_bind_atomic_buffers(ctx, first, count,
"glBindBuffersRange"))