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
3de4515c
Commit
3de4515c
authored
Aug 15, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement 3D texture clears in surface_cpu_blt_colour_fill().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0a0ab960
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
14 deletions
+31
-14
surface.c
dlls/wined3d/surface.c
+31
-14
No files found.
dlls/wined3d/surface.c
View file @
3de4515c
...
...
@@ -2119,13 +2119,13 @@ static void surface_cpu_blt_colour_fill(struct wined3d_rendertarget_view *view,
{
struct
wined3d_device
*
device
=
view
->
resource
->
device
;
struct
wined3d_context_gl
*
context_gl
=
NULL
;
unsigned
int
x
,
y
,
z
,
w
,
h
,
d
,
bpp
,
level
;
struct
wined3d_context
*
context
=
NULL
;
struct
wined3d_texture
*
texture
;
struct
wined3d_bo_address
data
;
unsigned
int
x
,
y
,
w
,
h
,
bpp
;
struct
wined3d_map_desc
map
;
DWORD
map_binding
;
BYTE
*
row
;
uint8_t
*
dst
;
DWORD
c
;
TRACE
(
"view %p, box %s, colour %s.
\n
"
,
view
,
debug_box
(
box
),
debug_color
(
colour
));
...
...
@@ -2152,18 +2152,28 @@ static void surface_cpu_blt_colour_fill(struct wined3d_rendertarget_view *view,
context_gl
=
wined3d_context_gl
(
context
);
}
texture
=
texture_from_resource
(
view
->
resource
);
level
=
view
->
sub_resource_idx
%
texture
->
level_count
;
c
=
wined3d_format_convert_from_float
(
view
->
format
,
colour
);
bpp
=
view
->
format
->
byte_count
;
w
=
min
(
box
->
right
,
view
->
width
)
-
min
(
box
->
left
,
view
->
width
);
h
=
min
(
box
->
bottom
,
view
->
height
)
-
min
(
box
->
top
,
view
->
height
);
if
(
view
->
resource
->
type
!=
WINED3D_RTYPE_TEXTURE_3D
)
{
d
=
1
;
}
else
{
d
=
wined3d_texture_get_level_depth
(
texture
,
level
);
d
=
min
(
box
->
back
,
d
)
-
min
(
box
->
front
,
d
);
}
texture
=
texture_from_resource
(
view
->
resource
);
map_binding
=
texture
->
resource
.
map_binding
;
if
(
!
wined3d_texture_load_location
(
texture
,
view
->
sub_resource_idx
,
context
,
map_binding
))
ERR
(
"Failed to load the sub-resource into %s.
\n
"
,
wined3d_debug_location
(
map_binding
));
wined3d_texture_invalidate_location
(
texture
,
view
->
sub_resource_idx
,
~
map_binding
);
wined3d_texture_get_pitch
(
texture
,
view
->
sub_resource_idx
%
texture
->
level_count
,
&
map
.
row_pitch
,
&
map
.
slice_pitch
);
wined3d_texture_get_pitch
(
texture
,
level
,
&
map
.
row_pitch
,
&
map
.
slice_pitch
);
wined3d_texture_get_memory
(
texture
,
view
->
sub_resource_idx
,
&
data
,
map_binding
);
map
.
data
=
wined3d_context_gl_map_bo_address
(
context_gl
,
&
data
,
texture
->
sub_resources
[
view
->
sub_resource_idx
].
size
,
GL_PIXEL_UNPACK_BUFFER
,
WINED3D_MAP_WRITE
);
...
...
@@ -2190,12 +2200,12 @@ static void surface_cpu_blt_colour_fill(struct wined3d_rendertarget_view *view,
case
3
:
{
row
=
map
.
data
;
for
(
x
=
0
;
x
<
w
;
++
x
,
row
+=
3
)
dst
=
map
.
data
;
for
(
x
=
0
;
x
<
w
;
++
x
,
dst
+=
3
)
{
row
[
0
]
=
(
c
)
&
0xff
;
row
[
1
]
=
(
c
>>
8
)
&
0xff
;
row
[
2
]
=
(
c
>>
16
)
&
0xff
;
dst
[
0
]
=
(
c
)
&
0xff
;
dst
[
1
]
=
(
c
>>
8
)
&
0xff
;
dst
[
2
]
=
(
c
>>
16
)
&
0xff
;
}
break
;
}
...
...
@@ -2212,11 +2222,18 @@ static void surface_cpu_blt_colour_fill(struct wined3d_rendertarget_view *view,
return
;
}
row
=
map
.
data
;
dst
=
map
.
data
;
for
(
y
=
1
;
y
<
h
;
++
y
)
{
row
+=
map
.
row_pitch
;
memcpy
(
row
,
map
.
data
,
w
*
bpp
);
dst
+=
map
.
row_pitch
;
memcpy
(
dst
,
map
.
data
,
w
*
bpp
);
}
dst
=
map
.
data
;
for
(
z
=
1
;
z
<
d
;
++
z
)
{
dst
+=
map
.
slice_pitch
;
memcpy
(
dst
,
map
.
data
,
w
*
h
*
bpp
);
}
wined3d_context_gl_unmap_bo_address
(
context_gl
,
&
data
,
GL_PIXEL_UNPACK_BUFFER
);
...
...
@@ -2246,7 +2263,7 @@ static void cpu_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_de
box
.
right
=
min
(
clear_rects
[
i
].
right
,
draw_rect
->
right
);
box
.
bottom
=
min
(
clear_rects
[
i
].
bottom
,
draw_rect
->
bottom
);
box
.
front
=
0
;
box
.
back
=
1
;
box
.
back
=
~
0u
;
if
(
box
.
left
>=
box
.
right
||
box
.
top
>=
box
.
bottom
)
continue
;
...
...
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