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
da321ceb
Commit
da321ceb
authored
Apr 19, 2017
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use wined3d_texture_get_memory() in surface_cpu_blt_colour_fill().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ee17d7ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
2 deletions
+36
-2
surface.c
dlls/wined3d/surface.c
+36
-2
No files found.
dlls/wined3d/surface.c
View file @
da321ceb
...
...
@@ -3345,8 +3345,14 @@ release:
static
void
surface_cpu_blt_colour_fill
(
struct
wined3d_rendertarget_view
*
view
,
const
struct
wined3d_box
*
box
,
const
struct
wined3d_color
*
colour
)
{
struct
wined3d_device
*
device
=
view
->
resource
->
device
;
const
struct
wined3d_gl_info
*
gl_info
=
NULL
;
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
;
DWORD
c
;
...
...
@@ -3358,12 +3364,37 @@ static void surface_cpu_blt_colour_fill(struct wined3d_rendertarget_view *view,
return
;
}
if
(
view
->
resource
->
type
==
WINED3D_RTYPE_BUFFER
)
{
FIXME
(
"Not implemented for buffers.
\n
"
);
return
;
}
if
(
device
->
d3d_initialized
)
{
context
=
context_acquire
(
device
,
NULL
,
0
);
gl_info
=
context
->
gl_info
;
}
c
=
wined3d_format_convert_from_float
(
view
->
format
,
colour
);
bpp
=
view
->
format
->
byte_count
;
w
=
box
->
right
-
box
->
left
;
h
=
box
->
bottom
-
box
->
top
;
wined3d_resource_map
(
view
->
resource
,
view
->
sub_resource_idx
,
&
map
,
box
,
0
);
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_memory
(
texture
,
view
->
sub_resource_idx
,
&
data
,
map_binding
);
map
.
data
=
wined3d_texture_map_bo_address
(
&
data
,
texture
->
sub_resources
[
view
->
sub_resource_idx
].
size
,
gl_info
,
GL_PIXEL_UNPACK_BUFFER
,
0
);
map
.
data
=
(
BYTE
*
)
map
.
data
+
(
box
->
front
*
map
.
slice_pitch
)
+
((
box
->
top
/
view
->
format
->
block_height
)
*
map
.
row_pitch
)
+
((
box
->
left
/
view
->
format
->
block_width
)
*
view
->
format
->
block_byte_count
);
switch
(
bpp
)
{
...
...
@@ -3411,7 +3442,10 @@ static void surface_cpu_blt_colour_fill(struct wined3d_rendertarget_view *view,
row
+=
map
.
row_pitch
;
memcpy
(
row
,
map
.
data
,
w
*
bpp
);
}
wined3d_resource_unmap
(
view
->
resource
,
view
->
sub_resource_idx
);
wined3d_texture_unmap_bo_address
(
&
data
,
gl_info
,
GL_PIXEL_UNPACK_BUFFER
);
if
(
context
)
context_release
(
context
);
}
static
void
cpu_blitter_clear
(
struct
wined3d_blitter
*
blitter
,
struct
wined3d_device
*
device
,
...
...
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