Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a6ffab3b
Commit
a6ffab3b
authored
Jun 18, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Rename WINED3DLOCK_* to WINED3D_MAP_*.
parent
60ff5906
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
50 deletions
+53
-50
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+4
-4
buffer.c
dlls/wined3d/buffer.c
+31
-25
device.c
dlls/wined3d/device.c
+5
-6
surface.c
dlls/wined3d/surface.c
+6
-8
volume.c
dlls/wined3d/volume.c
+1
-1
wined3d.h
include/wine/wined3d.h
+6
-6
No files found.
dlls/ddraw/vertexbuffer.c
View file @
a6ffab3b
...
...
@@ -219,13 +219,13 @@ static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface,
* nosyslock: Not applicable
*/
if
(
!
(
flags
&
DDLOCK_WAIT
))
wined3d_flags
|=
WINED3D
LOCK
_DONOTWAIT
;
wined3d_flags
|=
WINED3D
_MAP
_DONOTWAIT
;
if
(
flags
&
DDLOCK_READONLY
)
wined3d_flags
|=
WINED3D
LOCK
_READONLY
;
wined3d_flags
|=
WINED3D
_MAP
_READONLY
;
if
(
flags
&
DDLOCK_NOOVERWRITE
)
wined3d_flags
|=
WINED3D
LOCK
_NOOVERWRITE
;
wined3d_flags
|=
WINED3D
_MAP
_NOOVERWRITE
;
if
(
flags
&
DDLOCK_DISCARDCONTENTS
)
wined3d_flags
|=
WINED3D
LOCK
_DISCARD
;
wined3d_flags
|=
WINED3D
_MAP
_DISCARD
;
wined3d_mutex_lock
();
if
(
data_size
)
...
...
dlls/wined3d/buffer.c
View file @
a6ffab3b
...
...
@@ -604,9 +604,11 @@ static void buffer_sync_apple(struct wined3d_buffer *This, DWORD flags, const st
enum
wined3d_event_query_result
ret
;
/* No fencing needs to be done if the app promises not to overwrite
* existing data */
if
(
flags
&
WINED3DLOCK_NOOVERWRITE
)
return
;
if
(
flags
&
WINED3DLOCK_DISCARD
)
* existing data. */
if
(
flags
&
WINED3D_MAP_NOOVERWRITE
)
return
;
if
(
flags
&
WINED3D_MAP_DISCARD
)
{
ENTER_GL
();
GL_EXTCALL
(
glBufferDataARB
(
This
->
buffer_type_hint
,
This
->
resource
.
size
,
NULL
,
This
->
buffer_object_usage
));
...
...
@@ -698,8 +700,10 @@ static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined
if
(
This
->
flags
&
WINED3D_BUFFER_APPLESYNC
)
{
DWORD
syncflags
=
0
;
if
(
flags
&
WINED3D_BUFFER_DISCARD
)
syncflags
|=
WINED3DLOCK_DISCARD
;
if
(
flags
&
WINED3D_BUFFER_NOSYNC
)
syncflags
|=
WINED3DLOCK_NOOVERWRITE
;
if
(
flags
&
WINED3D_BUFFER_DISCARD
)
syncflags
|=
WINED3D_MAP_DISCARD
;
if
(
flags
&
WINED3D_BUFFER_NOSYNC
)
syncflags
|=
WINED3D_MAP_NOOVERWRITE
;
LEAVE_GL
();
buffer_sync_apple
(
This
,
syncflags
,
gl_info
);
ENTER_GL
();
...
...
@@ -948,29 +952,31 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer)
static
DWORD
buffer_sanitize_flags
(
const
struct
wined3d_buffer
*
buffer
,
DWORD
flags
)
{
/* Not all flags make sense together, but Windows never returns an error.
Catch the
*
cases that could cause issues
*/
if
(
flags
&
WINED3DLOCK
_READONLY
)
/* Not all flags make sense together, but Windows never returns an error.
*
Catch the cases that could cause issues.
*/
if
(
flags
&
WINED3D_MAP
_READONLY
)
{
if
(
flags
&
WINED3DLOCK
_DISCARD
)
if
(
flags
&
WINED3D_MAP
_DISCARD
)
{
WARN
(
"WINED3D
LOCK_READONLY combined with WINED3DLOCK_DISCARD, ignoring flags
\n
"
);
WARN
(
"WINED3D
_MAP_READONLY combined with WINED3D_MAP_DISCARD, ignoring flags.
\n
"
);
return
0
;
}
if
(
flags
&
WINED3DLOCK
_NOOVERWRITE
)
if
(
flags
&
WINED3D_MAP
_NOOVERWRITE
)
{
WARN
(
"WINED3D
LOCK_READONLY combined with WINED3DLOCK_NOOVERWRITE, ignoring flags
\n
"
);
WARN
(
"WINED3D
_MAP_READONLY combined with WINED3D_MAP_NOOVERWRITE, ignoring flags.
\n
"
);
return
0
;
}
}
else
if
((
flags
&
(
WINED3DLOCK_DISCARD
|
WINED3DLOCK_NOOVERWRITE
))
==
(
WINED3DLOCK_DISCARD
|
WINED3DLOCK_NOOVERWRITE
))
else
if
((
flags
&
(
WINED3D_MAP_DISCARD
|
WINED3D_MAP_NOOVERWRITE
))
==
(
WINED3D_MAP_DISCARD
|
WINED3D_MAP_NOOVERWRITE
))
{
WARN
(
"WINED3D
LOCK_DISCARD and WINED3DLOCK_NOOVERWRITE used together, ignoring
\n
"
);
WARN
(
"WINED3D
_MAP_DISCARD and WINED3D_MAP_NOOVERWRITE used together, ignoring.
\n
"
);
return
0
;
}
else
if
(
flags
&
(
WINED3DLOCK_DISCARD
|
WINED3DLOCK_NOOVERWRITE
)
&&
!
(
buffer
->
resource
.
usage
&
WINED3DUSAGE_DYNAMIC
))
else
if
(
flags
&
(
WINED3D_MAP_DISCARD
|
WINED3D_MAP_NOOVERWRITE
)
&&
!
(
buffer
->
resource
.
usage
&
WINED3DUSAGE_DYNAMIC
))
{
WARN
(
"DISCARD or NOOVERWRITE
lock on non-dynamic buffer, ignoring
\n
"
);
WARN
(
"DISCARD or NOOVERWRITE
map on non-dynamic buffer, ignoring.
\n
"
);
return
0
;
}
...
...
@@ -981,14 +987,14 @@ static GLbitfield buffer_gl_map_flags(DWORD d3d_flags)
{
GLbitfield
ret
=
0
;
if
(
!
(
d3d_flags
&
WINED3D
LOCK
_READONLY
))
if
(
!
(
d3d_flags
&
WINED3D
_MAP
_READONLY
))
ret
|=
GL_MAP_WRITE_BIT
|
GL_MAP_FLUSH_EXPLICIT_BIT
;
if
(
!
(
d3d_flags
&
(
WINED3D
LOCK_DISCARD
|
WINED3DLOCK
_NOOVERWRITE
)))
if
(
!
(
d3d_flags
&
(
WINED3D
_MAP_DISCARD
|
WINED3D_MAP
_NOOVERWRITE
)))
ret
|=
GL_MAP_READ_BIT
;
if
(
d3d_flags
&
WINED3D
LOCK
_DISCARD
)
if
(
d3d_flags
&
WINED3D
_MAP
_DISCARD
)
ret
|=
GL_MAP_INVALIDATE_BUFFER_BIT
;
if
(
d3d_flags
&
WINED3D
LOCK
_NOOVERWRITE
)
if
(
d3d_flags
&
WINED3D
_MAP
_NOOVERWRITE
)
ret
|=
GL_MAP_UNSYNCHRONIZED_BIT
;
return
ret
;
...
...
@@ -1009,9 +1015,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
TRACE
(
"buffer %p, offset %u, size %u, data %p, flags %#x
\n
"
,
buffer
,
offset
,
size
,
data
,
flags
);
flags
=
buffer_sanitize_flags
(
buffer
,
flags
);
if
(
!
(
flags
&
WINED3D
LOCK
_READONLY
))
if
(
!
(
flags
&
WINED3D
_MAP
_READONLY
))
{
if
(
flags
&
WINED3D
LOCK
_DISCARD
)
if
(
flags
&
WINED3D
_MAP
_DISCARD
)
{
/* DISCARD invalidates the entire buffer, regardless of the
* specified offset and size. Some applications also depend on the
...
...
@@ -1105,17 +1111,17 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
{
if
(
dirty
)
{
if
(
buffer
->
flags
&
WINED3D_BUFFER_NOSYNC
&&
!
(
flags
&
WINED3D
LOCK
_NOOVERWRITE
))
if
(
buffer
->
flags
&
WINED3D_BUFFER_NOSYNC
&&
!
(
flags
&
WINED3D
_MAP
_NOOVERWRITE
))
{
buffer
->
flags
&=
~
WINED3D_BUFFER_NOSYNC
;
}
}
else
if
(
flags
&
WINED3D
LOCK
_NOOVERWRITE
)
else
if
(
flags
&
WINED3D
_MAP
_NOOVERWRITE
)
{
buffer
->
flags
|=
WINED3D_BUFFER_NOSYNC
;
}
if
(
flags
&
WINED3D
LOCK
_DISCARD
)
if
(
flags
&
WINED3D
_MAP
_DISCARD
)
{
buffer
->
flags
|=
WINED3D_BUFFER_DISCARD
;
}
...
...
dlls/wined3d/device.c
View file @
a6ffab3b
...
...
@@ -4210,10 +4210,9 @@ static HRESULT device_update_volume(struct wined3d_device *device,
/* TODO: Implement direct loading into the gl volume instead of using
* memcpy and dirtification to improve loading performance. */
hr
=
wined3d_volume_map
(
src_volume
,
&
src
,
NULL
,
WINED3DLOCK_READONLY
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
wined3d_volume_map
(
dst_volume
,
&
dst
,
NULL
,
WINED3DLOCK_DISCARD
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
=
wined3d_volume_map
(
src_volume
,
&
src
,
NULL
,
WINED3D_MAP_READONLY
)))
return
hr
;
if
(
FAILED
(
hr
=
wined3d_volume_map
(
dst_volume
,
&
dst
,
NULL
,
WINED3D_MAP_DISCARD
)))
{
wined3d_volume_unmap
(
src_volume
);
return
hr
;
...
...
@@ -4911,7 +4910,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
* instead. */
device
->
cursorWidth
=
cursor_image
->
resource
.
width
;
device
->
cursorHeight
=
cursor_image
->
resource
.
height
;
if
(
SUCCEEDED
(
wined3d_surface_map
(
cursor_image
,
&
map_desc
,
NULL
,
WINED3D
LOCK
_READONLY
)))
if
(
SUCCEEDED
(
wined3d_surface_map
(
cursor_image
,
&
map_desc
,
NULL
,
WINED3D
_MAP
_READONLY
)))
{
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
const
struct
wined3d_format
*
format
=
wined3d_get_format
(
gl_info
,
WINED3DFMT_B8G8R8A8_UNORM
);
...
...
@@ -4981,7 +4980,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
maskBits
=
HeapAlloc
(
GetProcessHeap
(),
0
,
mask_size
);
memset
(
maskBits
,
0xff
,
mask_size
);
wined3d_surface_map
(
cursor_image
,
&
map_desc
,
NULL
,
WINED3D
LOCK_NO_DIRTY_UPDATE
|
WINED3DLOCK
_READONLY
);
WINED3D
_MAP_NO_DIRTY_UPDATE
|
WINED3D_MAP
_READONLY
);
TRACE
(
"width: %u height: %u.
\n
"
,
cursor_image
->
resource
.
width
,
cursor_image
->
resource
.
height
);
cursorInfo
.
fIcon
=
FALSE
;
...
...
dlls/wined3d/surface.c
View file @
a6ffab3b
...
...
@@ -887,9 +887,9 @@ static void surface_map(struct wined3d_surface *surface, const RECT *rect, DWORD
TRACE
(
"surface %p, rect %s, flags %#x.
\n
"
,
surface
,
wine_dbgstr_rect
(
rect
),
flags
);
if
(
flags
&
WINED3D
LOCK
_DISCARD
)
if
(
flags
&
WINED3D
_MAP
_DISCARD
)
{
TRACE
(
"WINED3D
LOCK
_DISCARD flag passed, marking SYSMEM as up to date.
\n
"
);
TRACE
(
"WINED3D
_MAP
_DISCARD flag passed, marking SYSMEM as up to date.
\n
"
);
surface_prepare_system_memory
(
surface
);
surface_modify_location
(
surface
,
SFLAG_INSYSMEM
,
TRUE
);
}
...
...
@@ -933,7 +933,7 @@ static void surface_map(struct wined3d_surface *surface, const RECT *rect, DWORD
context_release
(
context
);
}
if
(
!
(
flags
&
(
WINED3D
LOCK_NO_DIRTY_UPDATE
|
WINED3DLOCK
_READONLY
)))
if
(
!
(
flags
&
(
WINED3D
_MAP_NO_DIRTY_UPDATE
|
WINED3D_MAP
_READONLY
)))
{
if
(
!
rect
)
surface_add_dirty_rect
(
surface
,
NULL
);
...
...
@@ -3746,15 +3746,13 @@ static struct wined3d_surface *surface_convert_format(struct wined3d_surface *so
memset
(
&
src_map
,
0
,
sizeof
(
src_map
));
memset
(
&
dst_map
,
0
,
sizeof
(
dst_map
));
hr
=
wined3d_surface_map
(
source
,
&
src_map
,
NULL
,
WINED3DLOCK_READONLY
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
=
wined3d_surface_map
(
source
,
&
src_map
,
NULL
,
WINED3D_MAP_READONLY
)))
{
ERR
(
"Failed to lock the source surface.
\n
"
);
wined3d_surface_decref
(
ret
);
return
NULL
;
}
hr
=
wined3d_surface_map
(
ret
,
&
dst_map
,
NULL
,
WINED3DLOCK_READONLY
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
=
wined3d_surface_map
(
ret
,
&
dst_map
,
NULL
,
WINED3D_MAP_READONLY
)))
{
ERR
(
"Failed to lock the destination surface.
\n
"
);
wined3d_surface_unmap
(
source
);
...
...
@@ -6637,7 +6635,7 @@ static HRESULT surface_cpu_blt(struct wined3d_surface *dst_surface, const RECT *
goto
release
;
}
}
wined3d_surface_map
(
src_surface
,
&
src_map
,
NULL
,
WINED3D
LOCK
_READONLY
);
wined3d_surface_map
(
src_surface
,
&
src_map
,
NULL
,
WINED3D
_MAP
_READONLY
);
src_format
=
src_surface
->
resource
.
format
;
}
else
...
...
dlls/wined3d/volume.c
View file @
a6ffab3b
...
...
@@ -226,7 +226,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
volume
->
lockedBox
.
back
=
box
->
back
;
}
if
(
!
(
flags
&
(
WINED3D
LOCK_NO_DIRTY_UPDATE
|
WINED3DLOCK
_READONLY
)))
if
(
!
(
flags
&
(
WINED3D
_MAP_NO_DIRTY_UPDATE
|
WINED3D_MAP
_READONLY
)))
{
volume_add_dirty_box
(
volume
,
&
volume
->
lockedBox
);
wined3d_texture_set_dirty
(
volume
->
container
,
TRUE
);
...
...
include/wine/wined3d.h
View file @
a6ffab3b
...
...
@@ -827,12 +827,12 @@ enum wined3d_sysval_semantic
#define WINED3DUSAGE_QUERY_WRAPANDMIP 0x00200000
#define WINED3DUSAGE_QUERY_MASK 0x003f8000
#define WINED3D
LOCK
_READONLY 0x0010
#define WINED3D
LOCK
_NOSYSLOCK 0x0800
#define WINED3D
LOCK
_NOOVERWRITE 0x1000
#define WINED3D
LOCK
_DISCARD 0x2000
#define WINED3D
LOCK
_DONOTWAIT 0x4000
#define WINED3D
LOCK
_NO_DIRTY_UPDATE 0x8000
#define WINED3D
_MAP
_READONLY 0x0010
#define WINED3D
_MAP
_NOSYSLOCK 0x0800
#define WINED3D
_MAP
_NOOVERWRITE 0x1000
#define WINED3D
_MAP
_DISCARD 0x2000
#define WINED3D
_MAP
_DONOTWAIT 0x4000
#define WINED3D
_MAP
_NO_DIRTY_UPDATE 0x8000
#define WINED3DPRESENT_RATE_DEFAULT 0x00000000
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment