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
6d0d018b
Commit
6d0d018b
authored
Nov 27, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 27, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't store PBO pointers in allocatedMemory.
parent
0c56639a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
surface.c
dlls/wined3d/surface.c
+14
-14
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/surface.c
View file @
6d0d018b
...
...
@@ -767,7 +767,7 @@ static void surface_realize_palette(struct wined3d_surface *surface)
surface_load_location
(
surface
,
surface
->
draw_binding
);
}
static
void
surface_map
(
struct
wined3d_surface
*
surface
,
const
RECT
*
rect
,
DWORD
flags
)
static
BYTE
*
surface_map
(
struct
wined3d_surface
*
surface
,
const
RECT
*
rect
,
DWORD
flags
)
{
struct
wined3d_device
*
device
=
surface
->
resource
.
device
;
...
...
@@ -793,6 +793,7 @@ static void surface_map(struct wined3d_surface *surface, const RECT *rect, DWORD
if
(
surface
->
flags
&
SFLAG_PBO
)
{
BYTE
*
ret
;
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context
*
context
;
...
...
@@ -802,12 +803,7 @@ static void surface_map(struct wined3d_surface *surface, const RECT *rect, DWORD
GL_EXTCALL
(
glBindBufferARB
(
GL_PIXEL_UNPACK_BUFFER_ARB
,
surface
->
pbo
));
checkGLcall
(
"glBindBufferARB"
);
/* This shouldn't happen but could occur if some other function
* didn't handle the PBO properly. */
if
(
surface
->
resource
.
allocatedMemory
)
ERR
(
"The surface already has PBO memory allocated.
\n
"
);
surface
->
resource
.
allocatedMemory
=
GL_EXTCALL
(
glMapBufferARB
(
GL_PIXEL_UNPACK_BUFFER_ARB
,
GL_READ_WRITE_ARB
));
ret
=
GL_EXTCALL
(
glMapBufferARB
(
GL_PIXEL_UNPACK_BUFFER_ARB
,
GL_READ_WRITE_ARB
));
checkGLcall
(
"glMapBufferARB"
);
/* Make sure the PBO isn't set anymore in order not to break non-PBO
...
...
@@ -816,7 +812,10 @@ static void surface_map(struct wined3d_surface *surface, const RECT *rect, DWORD
checkGLcall
(
"glBindBufferARB"
);
context_release
(
context
);
return
ret
;
}
return
surface
->
resource
.
allocatedMemory
;
}
static
void
surface_unmap
(
struct
wined3d_surface
*
surface
)
...
...
@@ -842,8 +841,6 @@ static void surface_unmap(struct wined3d_surface *surface)
GL_EXTCALL
(
glBindBufferARB
(
GL_PIXEL_UNPACK_BUFFER_ARB
,
0
));
checkGLcall
(
"glUnmapBufferARB"
);
context_release
(
context
);
surface
->
resource
.
allocatedMemory
=
NULL
;
}
TRACE
(
"dirtyfied %u.
\n
"
,
surface
->
flags
&
(
SFLAG_INDRAWABLE
|
SFLAG_INTEXTURE
)
?
0
:
1
);
...
...
@@ -1473,10 +1470,12 @@ static void gdi_surface_realize_palette(struct wined3d_surface *surface)
x11_copy_to_screen
(
surface
->
swapchain
,
NULL
);
}
static
void
gdi_surface_map
(
struct
wined3d_surface
*
surface
,
const
RECT
*
rect
,
DWORD
flags
)
static
BYTE
*
gdi_surface_map
(
struct
wined3d_surface
*
surface
,
const
RECT
*
rect
,
DWORD
flags
)
{
TRACE
(
"surface %p, rect %s, flags %#x.
\n
"
,
surface
,
wine_dbgstr_rect
(
rect
),
flags
);
return
surface
->
resource
.
allocatedMemory
;
}
static
void
gdi_surface_unmap
(
struct
wined3d_surface
*
surface
)
...
...
@@ -3195,6 +3194,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
struct
wined3d_map_desc
*
map_desc
,
const
RECT
*
rect
,
DWORD
flags
)
{
const
struct
wined3d_format
*
format
=
surface
->
resource
.
format
;
BYTE
*
base_memory
;
TRACE
(
"surface %p, map_desc %p, rect %s, flags %#x.
\n
"
,
surface
,
map_desc
,
wine_dbgstr_rect
(
rect
),
flags
);
...
...
@@ -3233,7 +3233,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
}
}
surface
->
surface_ops
->
surface_map
(
surface
,
rect
,
flags
);
base_memory
=
surface
->
surface_ops
->
surface_map
(
surface
,
rect
,
flags
);
if
(
format
->
flags
&
WINED3DFMT_FLAG_BROKEN_PITCH
)
map_desc
->
row_pitch
=
surface
->
resource
.
width
*
format
->
byte_count
;
...
...
@@ -3243,7 +3243,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
if
(
!
rect
)
{
map_desc
->
data
=
surface
->
resource
.
allocatedM
emory
;
map_desc
->
data
=
base_m
emory
;
surface
->
lockedRect
.
left
=
0
;
surface
->
lockedRect
.
top
=
0
;
surface
->
lockedRect
.
right
=
surface
->
resource
.
width
;
...
...
@@ -3255,13 +3255,13 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
{
/* Compressed textures are block based, so calculate the offset of
* the block that contains the top-left pixel of the locked rectangle. */
map_desc
->
data
=
surface
->
resource
.
allocatedM
emory
map_desc
->
data
=
base_m
emory
+
((
rect
->
top
/
format
->
block_height
)
*
map_desc
->
row_pitch
)
+
((
rect
->
left
/
format
->
block_width
)
*
format
->
block_byte_count
);
}
else
{
map_desc
->
data
=
surface
->
resource
.
allocatedM
emory
map_desc
->
data
=
base_m
emory
+
(
map_desc
->
row_pitch
*
rect
->
top
)
+
(
rect
->
left
*
format
->
byte_count
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
6d0d018b
...
...
@@ -2169,7 +2169,7 @@ struct wined3d_surface_ops
{
HRESULT
(
*
surface_private_setup
)(
struct
wined3d_surface
*
surface
);
void
(
*
surface_realize_palette
)(
struct
wined3d_surface
*
surface
);
void
(
*
surface_map
)(
struct
wined3d_surface
*
surface
,
const
RECT
*
rect
,
DWORD
flags
);
BYTE
*
(
*
surface_map
)(
struct
wined3d_surface
*
surface
,
const
RECT
*
rect
,
DWORD
flags
);
void
(
*
surface_unmap
)(
struct
wined3d_surface
*
surface
);
};
...
...
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