Module: wine Branch: master Commit: d15042837a8a8c44d81d6bdc2449606a63aabfa1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d15042837a8a8c44d81d6bdc24...
Author: Stefan Dösinger stefan@codeweavers.com Date: Thu Sep 19 11:02:55 2013 +0200
wined3d: Pass a correct access flag to glMapBufferARB.
---
dlls/wined3d/resource.c | 9 +++++++++ dlls/wined3d/volume.c | 3 ++- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index a24db3c..6a0a29b 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -419,3 +419,12 @@ GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags)
return ret; } + +GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) +{ + if (d3d_flags & WINED3D_MAP_READONLY) + return GL_READ_ONLY_ARB; + if (d3d_flags & (WINED3D_MAP_DISCARD | WINED3D_MAP_NOOVERWRITE)) + return GL_WRITE_ONLY_ARB; + return GL_READ_WRITE_ARB; +} diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c index 9251a55..ea481a1 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -642,7 +642,8 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, } else { - base_memory = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); + GLenum access = wined3d_resource_gl_legacy_map_flags(flags); + base_memory = GL_EXTCALL(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, access)); }
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0)); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f85bfec..a590b31 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2025,6 +2025,7 @@ void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HI DWORD wined3d_resource_sanitize_map_flags(const struct wined3d_resource *resource, DWORD flags) DECLSPEC_HIDDEN; GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN; +GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
/* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 16