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
3a2921c5
Commit
3a2921c5
authored
Nov 30, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Keep the primary surface mapped at the same address for early ddraw versions.
parent
3430e116
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
3 deletions
+16
-3
surface.c
dlls/ddraw/surface.c
+9
-1
surface.c
dlls/wined3d/surface.c
+3
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-1
wined3d.h
include/wine/wined3d.h
+1
-0
No files found.
dlls/ddraw/surface.c
View file @
3a2921c5
...
...
@@ -5254,6 +5254,7 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr
DDSURFACEDESC2
*
desc
,
UINT
mip_level
,
UINT
version
)
{
WINED3DPOOL
pool
=
WINED3DPOOL_DEFAULT
;
DWORD
flags
=
WINED3D_SURFACE_MAPPABLE
;
enum
wined3d_format_id
format
;
DWORD
usage
=
0
;
HRESULT
hr
;
...
...
@@ -5269,6 +5270,13 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr
if
(
desc
->
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
{
/* Some applications assume that the primary surface will always be
* mapped at the same address. Some of those also assume that this
* address is valid even when the surface isn't mapped, and that
* updates done this way will be visible on the screen. The game Nox
* is such an application. */
if
(
version
==
1
)
flags
|=
WINED3D_SURFACE_PIN_SYSMEM
;
usage
|=
WINED3DUSAGE_RENDERTARGET
;
desc
->
ddsCaps
.
dwCaps
|=
DDSCAPS_VISIBLE
;
}
...
...
@@ -5343,7 +5351,7 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr
surface
->
first_attached
=
surface
;
hr
=
wined3d_surface_create
(
ddraw
->
wined3d_device
,
desc
->
dwWidth
,
desc
->
dwHeight
,
format
,
mip_level
,
usage
,
pool
,
WINED3DMULTISAMPLE_NONE
,
0
,
DefaultSurfaceType
,
WINED3D_SURFACE_MAPPABLE
,
usage
,
pool
,
WINED3DMULTISAMPLE_NONE
,
0
,
DefaultSurfaceType
,
flags
,
surface
,
&
ddraw_surface_wined3d_parent_ops
,
&
surface
->
wined3d_surface
);
if
(
FAILED
(
hr
))
{
...
...
dlls/wined3d/surface.c
View file @
3a2921c5
...
...
@@ -544,7 +544,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
* converted or NPOT surfaces. Also don't create a PBO for systemmem
* surfaces. */
if
(
gl_info
->
supported
[
ARB_PIXEL_BUFFER_OBJECT
]
&&
(
surface
->
flags
&
SFLAG_DYNLOCK
)
&&
!
(
surface
->
flags
&
(
SFLAG_PBO
|
SFLAG_CONVERTED
|
SFLAG_NONPOW2
))
&&
!
(
surface
->
flags
&
(
SFLAG_PBO
|
SFLAG_CONVERTED
|
SFLAG_NONPOW2
|
SFLAG_PIN_SYSMEM
))
&&
(
surface
->
resource
.
pool
!=
WINED3DPOOL_SYSTEMMEM
))
{
struct
wined3d_context
*
context
;
...
...
@@ -7186,6 +7186,8 @@ static HRESULT surface_init(struct wined3d_surface *surface, WINED3DSURFTYPE sur
surface
->
flags
=
SFLAG_NORMCOORD
;
/* Default to normalized coords. */
if
(
flags
&
WINED3D_SURFACE_DISCARD
)
surface
->
flags
|=
SFLAG_DISCARD
;
if
(
flags
&
WINED3D_SURFACE_PIN_SYSMEM
)
surface
->
flags
|=
SFLAG_PIN_SYSMEM
;
if
(
lockable
||
format_id
==
WINED3DFMT_D16_LOCKABLE
)
surface
->
flags
|=
SFLAG_LOCKABLE
;
/* I'm not sure if this qualifies as a hack or as an optimization. It
...
...
dlls/wined3d/wined3d_private.h
View file @
3a2921c5
...
...
@@ -2140,6 +2140,7 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
#define SFLAG_INRB_RESOLVED 0x00400000
/* The resolved renderbuffer is current. */
#define SFLAG_DS_ONSCREEN 0x00800000
/* This is a depth / stencil surface, last modified onscreen. */
#define SFLAG_DS_OFFSCREEN 0x01000000
/* This is a depth / stencil surface, last modified offscreen. */
#define SFLAG_PIN_SYSMEM 0x02000000
/* Keep the surface in sysmem, at the same address. */
/* In some conditions the surface memory must not be freed:
* SFLAG_CONVERTED: Converting the data back would take too long
...
...
@@ -2155,7 +2156,8 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
SFLAG_CLIENT | \
SFLAG_DIBSECTION | \
SFLAG_USERPTR | \
SFLAG_PBO)
SFLAG_PBO | \
SFLAG_PIN_SYSMEM)
#define SFLAG_LOCATIONS (SFLAG_INSYSMEM | \
SFLAG_INTEXTURE | \
...
...
include/wine/wined3d.h
View file @
3a2921c5
...
...
@@ -1511,6 +1511,7 @@ enum wined3d_sysval_semantic
#define WINED3D_SURFACE_MAPPABLE 0x00000001
#define WINED3D_SURFACE_DISCARD 0x00000002
#define WINED3D_SURFACE_PIN_SYSMEM 0x00000004
struct
wined3d_display_mode
{
...
...
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