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
d6557e81
Commit
d6557e81
authored
Apr 12, 2017
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Send texture dirty region updates through the command stream.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6302d5ed
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
16 deletions
+48
-16
cs.c
dlls/wined3d/cs.c
+45
-0
texture.c
dlls/wined3d/texture.c
+1
-16
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/cs.c
View file @
d6557e81
...
...
@@ -65,6 +65,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UNMAP
,
WINED3D_CS_OP_BLT_SUB_RESOURCE
,
WINED3D_CS_OP_UPDATE_SUB_RESOURCE
,
WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION
,
};
struct
wined3d_cs_present
...
...
@@ -372,6 +373,13 @@ struct wined3d_cs_update_sub_resource
struct
wined3d_sub_resource_data
data
;
};
struct
wined3d_cs_add_dirty_texture_region
{
enum
wined3d_cs_op
opcode
;
struct
wined3d_texture
*
texture
;
unsigned
int
layer
;
};
static
void
wined3d_cs_exec_present
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_present
*
op
=
data
;
...
...
@@ -1957,6 +1965,42 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
cs
->
ops
->
submit
(
cs
);
}
static
void
wined3d_cs_exec_add_dirty_texture_region
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_add_dirty_texture_region
*
op
=
data
;
struct
wined3d_texture
*
texture
=
op
->
texture
;
unsigned
int
sub_resource_idx
,
i
;
struct
wined3d_context
*
context
;
context
=
context_acquire
(
cs
->
device
,
NULL
,
0
);
sub_resource_idx
=
op
->
layer
*
texture
->
level_count
;
for
(
i
=
0
;
i
<
texture
->
level_count
;
++
i
,
++
sub_resource_idx
)
{
if
(
wined3d_texture_load_location
(
texture
,
sub_resource_idx
,
context
,
texture
->
resource
.
map_binding
))
wined3d_texture_invalidate_location
(
texture
,
sub_resource_idx
,
~
texture
->
resource
.
map_binding
);
else
ERR
(
"Failed to load location %s.
\n
"
,
wined3d_debug_location
(
texture
->
resource
.
map_binding
));
}
context_release
(
context
);
wined3d_resource_release
(
&
texture
->
resource
);
}
void
wined3d_cs_emit_add_dirty_texture_region
(
struct
wined3d_cs
*
cs
,
struct
wined3d_texture
*
texture
,
unsigned
int
layer
)
{
struct
wined3d_cs_add_dirty_texture_region
*
op
;
op
=
cs
->
ops
->
require_space
(
cs
,
sizeof
(
*
op
));
op
->
opcode
=
WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION
;
op
->
texture
=
texture
;
op
->
layer
=
layer
;
wined3d_resource_acquire
(
&
texture
->
resource
);
cs
->
ops
->
submit
(
cs
);
}
static
void
(
*
const
wined3d_cs_op_handlers
[])(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
=
{
/* WINED3D_CS_OP_PRESENT */
wined3d_cs_exec_present
,
...
...
@@ -1998,6 +2042,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UNMAP */
wined3d_cs_exec_unmap
,
/* WINED3D_CS_OP_BLT_SUB_RESOURCE */
wined3d_cs_exec_blt_sub_resource
,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */
wined3d_cs_exec_update_sub_resource
,
/* WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION */
wined3d_cs_exec_add_dirty_texture_region
,
};
static
void
*
wined3d_cs_st_require_space
(
struct
wined3d_cs
*
cs
,
size_t
size
)
...
...
dlls/wined3d/texture.c
View file @
d6557e81
...
...
@@ -1639,9 +1639,6 @@ static struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(str
HRESULT
CDECL
wined3d_texture_add_dirty_region
(
struct
wined3d_texture
*
texture
,
UINT
layer
,
const
struct
wined3d_box
*
dirty_region
)
{
unsigned
int
sub_resource_idx
,
i
;
struct
wined3d_context
*
context
;
TRACE
(
"texture %p, layer %u, dirty_region %s.
\n
"
,
texture
,
layer
,
debug_box
(
dirty_region
));
if
(
layer
>=
texture
->
layer_count
)
...
...
@@ -1653,19 +1650,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
if
(
dirty_region
)
FIXME
(
"Ignoring dirty_region %s.
\n
"
,
debug_box
(
dirty_region
));
context
=
context_acquire
(
texture
->
resource
.
device
,
NULL
,
0
);
sub_resource_idx
=
layer
*
texture
->
level_count
;
for
(
i
=
0
;
i
<
texture
->
level_count
;
++
i
,
++
sub_resource_idx
)
{
if
(
!
wined3d_texture_load_location
(
texture
,
sub_resource_idx
,
context
,
texture
->
resource
.
map_binding
))
{
ERR
(
"Failed to load location %s.
\n
"
,
wined3d_debug_location
(
texture
->
resource
.
map_binding
));
context_release
(
context
);
return
E_OUTOFMEMORY
;
}
wined3d_texture_invalidate_location
(
texture
,
sub_resource_idx
,
~
texture
->
resource
.
map_binding
);
}
context_release
(
context
);
wined3d_cs_emit_add_dirty_texture_region
(
texture
->
resource
.
device
->
cs
,
texture
,
layer
);
return
WINED3D_OK
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
d6557e81
...
...
@@ -3243,6 +3243,8 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HID
void
wined3d_cs_destroy
(
struct
wined3d_cs
*
cs
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_destroy_object
(
struct
wined3d_cs
*
cs
,
void
(
*
callback
)(
void
*
object
),
void
*
object
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_add_dirty_texture_region
(
struct
wined3d_cs
*
cs
,
struct
wined3d_texture
*
texture
,
unsigned
int
layer
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_blt_sub_resource
(
struct
wined3d_cs
*
cs
,
struct
wined3d_resource
*
dst_resource
,
unsigned
int
dst_sub_resource_idx
,
const
struct
wined3d_box
*
dst_box
,
struct
wined3d_resource
*
src_resource
,
unsigned
int
src_sub_resource_idx
,
const
struct
wined3d_box
*
src_box
,
DWORD
flags
,
...
...
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