diff options
author | Ian Romanick <[email protected]> | 2015-11-02 18:33:54 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2015-11-24 11:31:29 -0800 |
commit | 89a61afdd7346d6e36caccc4d6f2a2607dc4a1f6 (patch) | |
tree | eb6af954c8a6bd54925f0a6ed408527ba94289f1 /src/mesa/drivers | |
parent | 4e6b9c11fc545cc570ea0042af93e61bfb525d34 (diff) |
meta: Use DSA functions for PBO in create_texture_for_pbo
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/common/meta_tex_subimage.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c index 181dde9d045..b0ac6771cb2 100644 --- a/src/mesa/drivers/common/meta_tex_subimage.c +++ b/src/mesa/drivers/common/meta_tex_subimage.c @@ -109,32 +109,24 @@ create_texture_for_pbo(struct gl_context *ctx, assert(create_pbo); - _mesa_GenBuffers(1, tmp_pbo); - - /* We are not doing this inside meta_begin/end. However, we know the - * client doesn't have the given target bound, so we can go ahead and - * squash it. We'll set it back when we're done. - */ - _mesa_BindBuffer(pbo_target, *tmp_pbo); + _mesa_CreateBuffers(1, tmp_pbo); /* In case of GL_PIXEL_PACK_BUFFER, pass null pointer for the pixel - * data to avoid unnecessary data copying in _mesa_BufferData(). + * data to avoid unnecessary data copying in _mesa_NamedBufferData(). */ if (is_pixel_pack) - _mesa_BufferData(pbo_target, - last_pixel - first_pixel, - NULL, - GL_STREAM_READ); + _mesa_NamedBufferData(*tmp_pbo, + last_pixel - first_pixel, + NULL, + GL_STREAM_READ); else - _mesa_BufferData(pbo_target, - last_pixel - first_pixel, - (char *)pixels + first_pixel, - GL_STREAM_DRAW); + _mesa_NamedBufferData(*tmp_pbo, + last_pixel - first_pixel, + (char *)pixels + first_pixel, + GL_STREAM_DRAW); - buffer_obj = packing->BufferObj; + buffer_obj = _mesa_lookup_bufferobj(ctx, *tmp_pbo); first_pixel = 0; - - _mesa_BindBuffer(pbo_target, 0); } _mesa_GenTextures(1, tmp_tex); |