Module: wine
Branch: master
Commit: 7ee4bda63efbc635ec4456feeed4f45c888ca4a7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7ee4bda63efbc635ec4456fee…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Fri Jul 15 01:14:50 2011 +0200
wined3d: Add stream offsets in device_stream_info_from_declaration().
They're not going to change until the next time the stream info is updated.
This would of course mainly be useful if we managed to do more than one or two
draws with the same stream info.
---
dlls/wined3d/buffer.c | 3 +-
dlls/wined3d/device.c | 7 ++++-
dlls/wined3d/drawprim.c | 17 ++++++--------
dlls/wined3d/state.c | 53 ++++++++++++++++++----------------------------
4 files changed, 34 insertions(+), 46 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=7ee4bda63efbc635ec445…
Module: wine
Branch: master
Commit: cf421e1b3f29c0df242f43bc235dab1f7410dd6b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=cf421e1b3f29c0df242f43bc2…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Fri Jul 15 01:14:49 2011 +0200
wined3d: Don't set GL_MAP_UNSYNCHRONIZED_BIT for WINED3D_BUFFER_DISCARD maps.
WINED3D_BUFFER_DISCARD means the (current) buffer contents are undefined for
subsequent operations. I.e., the map doesn't have to wait for any pending
operations to finish, and can just return a new buffer with undefined
contents. GL_MAP_UNSYNCHRONIZED_BIT means the driver doesn't wait for previous
operations to finish, and just maps a buffer that's potentially in use. Proper
synchronization is left to the application. Note that we set both
GL_MAP_INVALIDATE_BUFFER_BIT and GL_MAP_UNSYNCHRONIZED_BIT.
GL_MAP_INVALIDATE_BUFFER_BIT corresponds to WINED3D_BUFFER_DISCARD, and might
cause the driver to return a new buffer, but it's not required to make that
optimization.
---
dlls/wined3d/buffer.c | 24 +++++++++---------------
1 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 12cbd7e..74864bb 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -683,13 +683,9 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined
GLbitfield mapflags;
mapflags = GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT;
if (flags & WINED3D_BUFFER_DISCARD)
- {
- mapflags |= GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT;
- }
- else if (flags & WINED3D_BUFFER_NOSYNC)
- {
+ mapflags |= GL_MAP_INVALIDATE_BUFFER_BIT;
+ if (flags & WINED3D_BUFFER_NOSYNC)
mapflags |= GL_MAP_UNSYNCHRONIZED_BIT;
- }
map = GL_EXTCALL(glMapBufferRange(This->buffer_type_hint, 0,
This->resource.size, mapflags));
checkGLcall("glMapBufferRange");
@@ -976,17 +972,15 @@ static GLbitfield buffer_gl_map_flags(DWORD d3d_flags)
{
GLbitfield ret = 0;
- if (!(d3d_flags & WINED3DLOCK_READONLY)) ret = GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT;
+ if (!(d3d_flags & WINED3DLOCK_READONLY))
+ ret |= GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT;
+ if (!(d3d_flags & (WINED3DLOCK_DISCARD | WINED3DLOCK_NOOVERWRITE)))
+ ret |= GL_MAP_READ_BIT;
- if (d3d_flags & (WINED3DLOCK_DISCARD | WINED3DLOCK_NOOVERWRITE))
- {
- if(d3d_flags & WINED3DLOCK_DISCARD) ret |= GL_MAP_INVALIDATE_BUFFER_BIT;
+ if (d3d_flags & WINED3DLOCK_DISCARD)
+ ret |= GL_MAP_INVALIDATE_BUFFER_BIT;
+ if (d3d_flags & WINED3DLOCK_NOOVERWRITE)
ret |= GL_MAP_UNSYNCHRONIZED_BIT;
- }
- else
- {
- ret |= GL_MAP_READ_BIT;
- }
return ret;
}