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
a3287287
Commit
a3287287
authored
Nov 08, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Record a dirty rect in wined3d_texture_create_dc().
parent
8fa82bd1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
33 deletions
+37
-33
visual.c
dlls/d3d9/tests/visual.c
+2
-2
texture.c
dlls/wined3d/texture.c
+35
-31
No files found.
dlls/d3d9/tests/visual.c
View file @
a3287287
...
@@ -19760,7 +19760,7 @@ static void add_dirty_rect_test(void)
...
@@ -19760,7 +19760,7 @@ static void add_dirty_rect_test(void)
ok
(
SUCCEEDED
(
hr
),
"Failed to update texture, hr %#lx.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to update texture, hr %#lx.
\n
"
,
hr
);
add_dirty_rect_test_draw
(
device
);
add_dirty_rect_test_draw
(
device
);
color
=
getPixelColor
(
device
,
320
,
240
);
color
=
getPixelColor
(
device
,
320
,
240
);
todo_wine
ok
(
color_match
(
color
,
0x00000080
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00000080
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#lx.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#lx.
\n
"
,
hr
);
...
@@ -19897,7 +19897,7 @@ static void add_dirty_rect_test(void)
...
@@ -19897,7 +19897,7 @@ static void add_dirty_rect_test(void)
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
add_dirty_rect_test_draw
(
device
);
add_dirty_rect_test_draw
(
device
);
color
=
getPixelColor
(
device
,
320
,
240
);
color
=
getPixelColor
(
device
,
320
,
240
);
todo_wine
ok
(
color_match
(
color
,
0x00000080
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00000080
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#lx.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to present, hr %#lx.
\n
"
,
hr
);
dlls/wined3d/texture.c
View file @
a3287287
...
@@ -1088,6 +1088,37 @@ static void wined3d_texture_gl_allocate_immutable_storage(struct wined3d_texture
...
@@ -1088,6 +1088,37 @@ static void wined3d_texture_gl_allocate_immutable_storage(struct wined3d_texture
checkGLcall
(
"allocate immutable storage"
);
checkGLcall
(
"allocate immutable storage"
);
}
}
static
void
wined3d_texture_dirty_region_add
(
struct
wined3d_texture
*
texture
,
unsigned
int
layer
,
const
struct
wined3d_box
*
box
)
{
struct
wined3d_dirty_regions
*
regions
;
unsigned
int
count
;
if
(
!
texture
->
dirty_regions
)
return
;
regions
=
&
texture
->
dirty_regions
[
layer
];
count
=
regions
->
box_count
+
1
;
if
(
count
>=
WINED3D_MAX_DIRTY_REGION_COUNT
||
!
box
||
(
!
box
->
left
&&
!
box
->
top
&&
!
box
->
front
&&
box
->
right
==
texture
->
resource
.
width
&&
box
->
bottom
==
texture
->
resource
.
height
&&
box
->
back
==
texture
->
resource
.
depth
))
{
regions
->
box_count
=
WINED3D_MAX_DIRTY_REGION_COUNT
;
return
;
}
if
(
!
wined3d_array_reserve
((
void
**
)
&
regions
->
boxes
,
&
regions
->
boxes_size
,
count
,
sizeof
(
*
regions
->
boxes
)))
{
ERR
(
"Failed to grow boxes array, marking entire texture dirty.
\n
"
);
regions
->
box_count
=
WINED3D_MAX_DIRTY_REGION_COUNT
;
return
;
}
regions
->
boxes
[
regions
->
box_count
++
]
=
*
box
;
}
void
wined3d_texture_sub_resources_destroyed
(
struct
wined3d_texture
*
texture
)
void
wined3d_texture_sub_resources_destroyed
(
struct
wined3d_texture
*
texture
)
{
{
unsigned
int
sub_count
=
texture
->
level_count
*
texture
->
layer_count
;
unsigned
int
sub_count
=
texture
->
level_count
*
texture
->
layer_count
;
...
@@ -1150,6 +1181,10 @@ static void wined3d_texture_create_dc(void *object)
...
@@ -1150,6 +1181,10 @@ static void wined3d_texture_create_dc(void *object)
context
=
context_acquire
(
device
,
NULL
,
0
);
context
=
context_acquire
(
device
,
NULL
,
0
);
wined3d_texture_load_location
(
texture
,
sub_resource_idx
,
context
,
texture
->
resource
.
map_binding
);
wined3d_texture_load_location
(
texture
,
sub_resource_idx
,
context
,
texture
->
resource
.
map_binding
);
}
}
if
(
texture
->
dirty_regions
)
wined3d_texture_dirty_region_add
(
texture
,
sub_resource_idx
/
texture
->
level_count
,
NULL
);
wined3d_texture_invalidate_location
(
texture
,
sub_resource_idx
,
~
texture
->
resource
.
map_binding
);
wined3d_texture_invalidate_location
(
texture
,
sub_resource_idx
,
~
texture
->
resource
.
map_binding
);
wined3d_texture_get_pitch
(
texture
,
level
,
&
row_pitch
,
&
slice_pitch
);
wined3d_texture_get_pitch
(
texture
,
level
,
&
row_pitch
,
&
slice_pitch
);
wined3d_texture_get_bo_address
(
texture
,
sub_resource_idx
,
&
data
,
texture
->
resource
.
map_binding
);
wined3d_texture_get_bo_address
(
texture
,
sub_resource_idx
,
&
data
,
texture
->
resource
.
map_binding
);
...
@@ -2123,37 +2158,6 @@ static struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(str
...
@@ -2123,37 +2158,6 @@ static struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(str
return
&
texture
->
sub_resources
[
sub_resource_idx
];
return
&
texture
->
sub_resources
[
sub_resource_idx
];
}
}
static
void
wined3d_texture_dirty_region_add
(
struct
wined3d_texture
*
texture
,
unsigned
int
layer
,
const
struct
wined3d_box
*
box
)
{
struct
wined3d_dirty_regions
*
regions
;
unsigned
int
count
;
if
(
!
texture
->
dirty_regions
)
return
;
regions
=
&
texture
->
dirty_regions
[
layer
];
count
=
regions
->
box_count
+
1
;
if
(
count
>=
WINED3D_MAX_DIRTY_REGION_COUNT
||
!
box
||
(
!
box
->
left
&&
!
box
->
top
&&
!
box
->
front
&&
box
->
right
==
texture
->
resource
.
width
&&
box
->
bottom
==
texture
->
resource
.
height
&&
box
->
back
==
texture
->
resource
.
depth
))
{
regions
->
box_count
=
WINED3D_MAX_DIRTY_REGION_COUNT
;
return
;
}
if
(
!
wined3d_array_reserve
((
void
**
)
&
regions
->
boxes
,
&
regions
->
boxes_size
,
count
,
sizeof
(
*
regions
->
boxes
)))
{
WARN
(
"Failed to grow boxes array, marking entire texture dirty.
\n
"
);
regions
->
box_count
=
WINED3D_MAX_DIRTY_REGION_COUNT
;
return
;
}
regions
->
boxes
[
regions
->
box_count
++
]
=
*
box
;
}
HRESULT
CDECL
wined3d_texture_add_dirty_region
(
struct
wined3d_texture
*
texture
,
HRESULT
CDECL
wined3d_texture_add_dirty_region
(
struct
wined3d_texture
*
texture
,
UINT
layer
,
const
struct
wined3d_box
*
dirty_region
)
UINT
layer
,
const
struct
wined3d_box
*
dirty_region
)
{
{
...
...
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