Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
c1032e97
Commit
c1032e97
authored
Mar 04, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Filter redundant WINED3D_MAP_DISCARD buffer maps.
parent
9f9fb6b7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
31 deletions
+16
-31
ddraw_private.h
dlls/ddraw/ddraw_private.h
+0
-2
device.c
dlls/ddraw/device.c
+0
-6
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+1
-4
buffer.c
dlls/wined3d/buffer.c
+15
-19
No files found.
dlls/ddraw/ddraw_private.h
View file @
c1032e97
...
...
@@ -543,8 +543,6 @@ struct d3d_vertex_buffer
DWORD
fvf
;
DWORD
size
;
BOOL
dynamic
;
BOOL
read_since_last_map
;
};
HRESULT
d3d_vertex_buffer_create
(
struct
d3d_vertex_buffer
**
buffer
,
struct
ddraw
*
ddraw
,
...
...
dlls/ddraw/device.c
View file @
c1032e97
...
...
@@ -4268,9 +4268,6 @@ static HRESULT d3d_device7_DrawPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVE
wined3d_device_set_primitive_type
(
device
->
wined3d_device
,
PrimitiveType
);
hr
=
wined3d_device_draw_primitive
(
device
->
wined3d_device
,
StartVertex
,
NumVertices
);
if
(
SUCCEEDED
(
hr
))
vb
->
read_since_last_map
=
TRUE
;
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -4396,9 +4393,6 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
wined3d_device_set_primitive_type
(
This
->
wined3d_device
,
PrimitiveType
);
hr
=
wined3d_device_draw_indexed_primitive
(
This
->
wined3d_device
,
ib_pos
/
sizeof
(
WORD
),
IndexCount
);
if
(
SUCCEEDED
(
hr
))
vb
->
read_since_last_map
=
TRUE
;
wined3d_mutex_unlock
();
return
hr
;
...
...
dlls/ddraw/vertexbuffer.c
View file @
c1032e97
...
...
@@ -245,7 +245,7 @@ static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface,
wined3d_flags
|=
WINED3D_MAP_READONLY
;
if
(
flags
&
DDLOCK_NOOVERWRITE
)
wined3d_flags
|=
WINED3D_MAP_NOOVERWRITE
;
if
(
flags
&
DDLOCK_DISCARDCONTENTS
&&
buffer
->
read_since_last_map
)
if
(
flags
&
DDLOCK_DISCARDCONTENTS
)
{
wined3d_flags
|=
WINED3D_MAP_DISCARD
;
...
...
@@ -279,9 +279,6 @@ static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface,
hr
=
wined3d_buffer_map
(
buffer
->
wineD3DVertexBuffer
,
0
,
0
,
(
BYTE
**
)
data
,
wined3d_flags
);
if
(
SUCCEEDED
(
hr
))
buffer
->
read_since_last_map
=
FALSE
;
wined3d_mutex_unlock
();
return
hr
;
...
...
dlls/wined3d/buffer.c
View file @
c1032e97
...
...
@@ -944,13 +944,20 @@ struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffe
HRESULT
CDECL
wined3d_buffer_map
(
struct
wined3d_buffer
*
buffer
,
UINT
offset
,
UINT
size
,
BYTE
**
data
,
DWORD
flags
)
{
BOOL
dirty
=
buffer_is_dirty
(
buffer
);
LONG
count
;
BYTE
*
base
;
TRACE
(
"buffer %p, offset %u, size %u, data %p, flags %#x
\n
"
,
buffer
,
offset
,
size
,
data
,
flags
);
flags
=
wined3d_resource_sanitize_map_flags
(
&
buffer
->
resource
,
flags
);
/* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture
* fill rate test seems to depend on this. When we map a buffer with
* GL_MAP_INVALIDATE_BUFFER_BIT, the driver is free to discard the
* previous contents of the buffer. The r600g driver only does this when
* the buffer is currently in use, while the proprietary NVIDIA driver
* appears to do this unconditionally. */
if
(
buffer
->
flags
&
WINED3D_BUFFER_DISCARD
)
flags
&=
~
WINED3D_MAP_DISCARD
;
count
=
++
buffer
->
resource
.
map_count
;
if
(
buffer
->
buffer_object
)
...
...
@@ -1026,25 +1033,14 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
context_release
(
context
);
}
}
else
{
if
(
dirty
)
{
if
(
buffer
->
flags
&
WINED3D_BUFFER_NOSYNC
&&
!
(
flags
&
WINED3D_MAP_NOOVERWRITE
))
{
buffer
->
flags
&=
~
WINED3D_BUFFER_NOSYNC
;
}
}
else
if
(
flags
&
WINED3D_MAP_NOOVERWRITE
)
{
buffer
->
flags
|=
WINED3D_BUFFER_NOSYNC
;
}
if
(
flags
&
WINED3D_MAP_DISCARD
)
{
buffer
->
flags
|=
WINED3D_BUFFER_DISCARD
;
}
}
if
(
flags
&
WINED3D_MAP_DISCARD
)
buffer
->
flags
|=
WINED3D_BUFFER_DISCARD
;
if
(
!
(
flags
&
WINED3D_MAP_NOOVERWRITE
))
buffer
->
flags
&=
~
WINED3D_BUFFER_NOSYNC
;
else
if
(
!
buffer_is_dirty
(
buffer
))
buffer
->
flags
|=
WINED3D_BUFFER_NOSYNC
;
}
base
=
buffer
->
map_ptr
?
buffer
->
map_ptr
:
buffer
->
resource
.
heap_memory
;
...
...
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