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
352d0493
Commit
352d0493
authored
Oct 14, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Rename buffer dirty ranges fields.
Make the fields names consistent with each other and with the usual scheme for field naming.
parent
344eee20
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
28 deletions
+31
-28
buffer.c
dlls/wined3d/buffer.c
+26
-26
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-2
No files found.
dlls/wined3d/buffer.c
View file @
352d0493
...
...
@@ -70,38 +70,38 @@ static void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, unsigned i
goto
invalidate_all
;
}
if
(
!
wined3d_array_reserve
((
void
**
)
&
buffer
->
maps
,
&
buffer
->
maps_size
,
buffer
->
modified_areas
+
1
,
sizeof
(
*
buffer
->
map
s
)))
if
(
!
wined3d_array_reserve
((
void
**
)
&
buffer
->
dirty_ranges
,
&
buffer
->
dirty_ranges_capacity
,
buffer
->
dirty_range_count
+
1
,
sizeof
(
*
buffer
->
dirty_range
s
)))
{
ERR
(
"Failed to allocate
map
s array, invalidating entire buffer.
\n
"
);
ERR
(
"Failed to allocate
dirty range
s array, invalidating entire buffer.
\n
"
);
goto
invalidate_all
;
}
buffer
->
maps
[
buffer
->
modified_areas
].
offset
=
offset
;
buffer
->
maps
[
buffer
->
modified_areas
].
size
=
size
;
++
buffer
->
modified_areas
;
buffer
->
dirty_ranges
[
buffer
->
dirty_range_count
].
offset
=
offset
;
buffer
->
dirty_ranges
[
buffer
->
dirty_range_count
].
size
=
size
;
++
buffer
->
dirty_range_count
;
return
;
invalidate_all:
buffer
->
modified_areas
=
1
;
buffer
->
map
s
[
0
].
offset
=
0
;
buffer
->
map
s
[
0
].
size
=
buffer
->
resource
.
size
;
buffer
->
dirty_range_count
=
1
;
buffer
->
dirty_range
s
[
0
].
offset
=
0
;
buffer
->
dirty_range
s
[
0
].
size
=
buffer
->
resource
.
size
;
}
static
inline
void
buffer_clear_dirty_areas
(
struct
wined3d_buffer
*
This
)
static
inline
void
buffer_clear_dirty_areas
(
struct
wined3d_buffer
*
buffer
)
{
This
->
modified_areas
=
0
;
buffer
->
dirty_range_count
=
0
;
}
static
BOOL
buffer_is_dirty
(
const
struct
wined3d_buffer
*
buffer
)
{
return
!!
buffer
->
modified_areas
;
return
!!
buffer
->
dirty_range_count
;
}
static
BOOL
buffer_is_fully_dirty
(
const
struct
wined3d_buffer
*
buffer
)
{
return
buffer
->
modified_areas
==
1
&&
!
buffer
->
maps
->
offset
&&
buffer
->
maps
->
size
==
buffer
->
resource
.
size
;
return
buffer
->
dirty_range_count
==
1
&&
!
buffer
->
dirty_ranges
[
0
].
offset
&&
buffer
->
dirty_ranges
[
0
].
size
==
buffer
->
resource
.
size
;
}
void
wined3d_buffer_validate_location
(
struct
wined3d_buffer
*
buffer
,
uint32_t
location
)
...
...
@@ -534,10 +534,10 @@ static void buffer_conversion_upload(struct wined3d_buffer *buffer, struct wined
return
;
}
for
(
range_idx
=
0
;
range_idx
<
buffer
->
modified_areas
;
++
range_idx
)
for
(
range_idx
=
0
;
range_idx
<
buffer
->
dirty_range_count
;
++
range_idx
)
{
start
=
buffer
->
map
s
[
range_idx
].
offset
;
end
=
start
+
buffer
->
map
s
[
range_idx
].
size
;
start
=
buffer
->
dirty_range
s
[
range_idx
].
offset
;
end
=
start
+
buffer
->
dirty_range
s
[
range_idx
].
size
;
memcpy
(
data
+
start
,
(
BYTE
*
)
buffer
->
resource
.
heap_memory
+
start
,
end
-
start
);
for
(
i
=
start
/
buffer
->
stride
;
i
<
min
((
end
/
buffer
->
stride
)
+
1
,
vertex_count
);
++
i
)
...
...
@@ -568,7 +568,8 @@ static void buffer_conversion_upload(struct wined3d_buffer *buffer, struct wined
dst
.
addr
=
NULL
;
src
.
buffer_object
=
NULL
;
src
.
addr
=
data
;
wined3d_context_copy_bo_address
(
context
,
&
dst
,
&
src
,
buffer
->
modified_areas
,
buffer
->
maps
,
WINED3D_MAP_WRITE
);
wined3d_context_copy_bo_address
(
context
,
&
dst
,
&
src
,
buffer
->
dirty_range_count
,
buffer
->
dirty_ranges
,
WINED3D_MAP_WRITE
);
heap_free
(
data
);
}
...
...
@@ -657,11 +658,11 @@ BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer,
{
uint32_t
map_flags
=
WINED3D_MAP_WRITE
;
if
(
buffer
->
modified_areas
==
1
&&
!
buffer
->
maps
[
0
].
offset
&&
buffer
->
maps
[
0
].
size
==
buffer
->
resource
.
size
)
if
(
buffer_is_fully_dirty
(
buffer
))
map_flags
|=
WINED3D_MAP_DISCARD
;
wined3d_context_copy_bo_address
(
context
,
&
dst
,
&
src
,
buffer
->
modified_areas
,
buffer
->
maps
,
map_flags
);
wined3d_context_copy_bo_address
(
context
,
&
dst
,
&
src
,
buffer
->
dirty_range_count
,
buffer
->
dirty_ranges
,
map_flags
);
}
else
{
...
...
@@ -776,7 +777,7 @@ static void wined3d_buffer_destroy_object(void *object)
context_release
(
context
);
}
heap_free
(
buffer
->
conversion_map
);
heap_free
(
buffer
->
map
s
);
heap_free
(
buffer
->
dirty_range
s
);
}
void
wined3d_buffer_cleanup
(
struct
wined3d_buffer
*
buffer
)
...
...
@@ -1079,7 +1080,6 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc
static
HRESULT
buffer_resource_sub_resource_unmap
(
struct
wined3d_resource
*
resource
,
unsigned
int
sub_resource_idx
)
{
struct
wined3d_buffer
*
buffer
=
buffer_from_resource
(
resource
);
unsigned
int
range_count
=
buffer
->
modified_areas
;
struct
wined3d_device
*
device
=
resource
->
device
;
struct
wined3d_context
*
context
;
struct
wined3d_bo_address
addr
;
...
...
@@ -1112,7 +1112,7 @@ static HRESULT buffer_resource_sub_resource_unmap(struct wined3d_resource *resou
addr
.
buffer_object
=
buffer
->
buffer_object
;
addr
.
addr
=
0
;
wined3d_context_unmap_bo_address
(
context
,
&
addr
,
range_count
,
buffer
->
map
s
);
wined3d_context_unmap_bo_address
(
context
,
&
addr
,
buffer
->
dirty_range_count
,
buffer
->
dirty_range
s
);
context_release
(
context
);
...
...
@@ -1399,7 +1399,7 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d
return
E_OUTOFMEMORY
;
}
if
(
!
(
buffer
->
maps
=
heap_alloc
(
sizeof
(
*
buffer
->
map
s
))))
if
(
!
(
buffer
->
dirty_ranges
=
heap_alloc
(
sizeof
(
*
buffer
->
dirty_range
s
))))
{
ERR
(
"Out of memory.
\n
"
);
buffer_resource_unload
(
resource
);
...
...
@@ -1407,7 +1407,7 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d
wined3d_resource_wait_idle
(
resource
);
return
E_OUTOFMEMORY
;
}
buffer
->
maps_size
=
1
;
buffer
->
dirty_ranges_capacity
=
1
;
if
(
buffer
->
locations
&
WINED3D_LOCATION_DISCARDED
)
buffer
->
resource
.
client
.
addr
.
buffer_object
=
CLIENT_BO_DISCARDED
;
...
...
dlls/wined3d/wined3d_private.h
View file @
352d0493
...
...
@@ -3832,8 +3832,11 @@ struct wined3d_buffer
struct
wined3d_bo
*
buffer_object
;
struct
wined3d_bo_user
bo_user
;
struct
wined3d_range
*
maps
;
SIZE_T
maps_size
,
modified_areas
;
/* For buffers which are GPU accessible but for which BUFFER is not
* currently a valid location, this is a list of areas that need to be
* uploaded to BUFFER. */
struct
wined3d_range
*
dirty_ranges
;
SIZE_T
dirty_range_count
,
dirty_ranges_capacity
;
/* conversion stuff */
UINT
decl_change_count
,
full_conversion_count
;
...
...
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