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
b7146d81
Commit
b7146d81
authored
Apr 13, 2017
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Do not add wined3d internal resources to the device resource list.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ecbc1cb6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
15 deletions
+23
-15
resource.c
dlls/wined3d/resource.c
+21
-14
surface.c
dlls/wined3d/surface.c
+1
-1
wined3d.h
include/wine/wined3d.h
+1
-0
No files found.
dlls/wined3d/resource.c
View file @
b7146d81
...
@@ -57,6 +57,7 @@ static void resource_check_usage(DWORD usage)
...
@@ -57,6 +57,7 @@ static void resource_check_usage(DWORD usage)
|
WINED3DUSAGE_AUTOGENMIPMAP
|
WINED3DUSAGE_AUTOGENMIPMAP
|
WINED3DUSAGE_STATICDECL
|
WINED3DUSAGE_STATICDECL
|
WINED3DUSAGE_OVERLAY
|
WINED3DUSAGE_OVERLAY
|
WINED3DUSAGE_PRIVATE
|
WINED3DUSAGE_LEGACY_CUBEMAP
|
WINED3DUSAGE_LEGACY_CUBEMAP
|
WINED3DUSAGE_TEXTURE
;
|
WINED3DUSAGE_TEXTURE
;
...
@@ -216,19 +217,22 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
...
@@ -216,19 +217,22 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
resource
->
heap_memory
=
NULL
;
resource
->
heap_memory
=
NULL
;
}
}
/* Check that we have enough video ram left */
if
(
!
(
usage
&
WINED3DUSAGE_PRIVATE
))
if
(
pool
==
WINED3D_POOL_DEFAULT
&&
device
->
wined3d
->
flags
&
WINED3D_VIDMEM_ACCOUNTING
)
{
{
if
(
size
>
wined3d_device_get_available_texture_mem
(
device
))
/* Check that we have enough video ram left */
if
(
pool
==
WINED3D_POOL_DEFAULT
&&
device
->
wined3d
->
flags
&
WINED3D_VIDMEM_ACCOUNTING
)
{
{
ERR
(
"Out of adapter memory
\n
"
);
if
(
size
>
wined3d_device_get_available_texture_mem
(
device
))
wined3d_resource_free_sysmem
(
resource
);
{
return
WINED3DERR_OUTOFVIDEOMEMORY
;
ERR
(
"Out of adapter memory
\n
"
);
wined3d_resource_free_sysmem
(
resource
);
return
WINED3DERR_OUTOFVIDEOMEMORY
;
}
adapter_adjust_memory
(
device
->
adapter
,
size
);
}
}
adapter_adjust_memory
(
device
->
adapter
,
size
);
}
device_resource_add
(
device
,
resource
);
device_resource_add
(
device
,
resource
);
}
return
WINED3D_OK
;
return
WINED3D_OK
;
}
}
...
@@ -248,13 +252,16 @@ void resource_cleanup(struct wined3d_resource *resource)
...
@@ -248,13 +252,16 @@ void resource_cleanup(struct wined3d_resource *resource)
TRACE
(
"Cleaning up resource %p.
\n
"
,
resource
);
TRACE
(
"Cleaning up resource %p.
\n
"
,
resource
);
if
(
resource
->
pool
==
WINED3D_POOL_DEFAULT
&&
d3d
->
flags
&
WINED3D_VIDMEM_ACCOUNTING
)
if
(
!
(
resource
->
usage
&
WINED3DUSAGE_PRIVATE
)
)
{
{
TRACE
(
"Decrementing device memory pool by %u.
\n
"
,
resource
->
size
);
if
(
resource
->
pool
==
WINED3D_POOL_DEFAULT
&&
d3d
->
flags
&
WINED3D_VIDMEM_ACCOUNTING
)
adapter_adjust_memory
(
resource
->
device
->
adapter
,
(
INT64
)
0
-
resource
->
size
);
{
}
TRACE
(
"Decrementing device memory pool by %u.
\n
"
,
resource
->
size
);
adapter_adjust_memory
(
resource
->
device
->
adapter
,
(
INT64
)
0
-
resource
->
size
);
}
device_resource_released
(
resource
->
device
,
resource
);
device_resource_released
(
resource
->
device
,
resource
);
}
wined3d_resource_acquire
(
resource
);
wined3d_resource_acquire
(
resource
);
wined3d_cs_destroy_object
(
resource
->
device
->
cs
,
wined3d_resource_destroy_object
,
resource
);
wined3d_cs_destroy_object
(
resource
->
device
->
cs
,
wined3d_resource_destroy_object
,
resource
);
}
}
...
...
dlls/wined3d/surface.c
View file @
b7146d81
...
@@ -1271,7 +1271,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr
...
@@ -1271,7 +1271,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr
desc
.
format
=
dst_format
->
id
;
desc
.
format
=
dst_format
->
id
;
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
0
;
desc
.
usage
=
WINED3DUSAGE_PRIVATE
;
desc
.
pool
=
WINED3D_POOL_SCRATCH
;
desc
.
pool
=
WINED3D_POOL_SCRATCH
;
desc
.
width
=
wined3d_texture_get_level_width
(
src_texture
,
texture_level
);
desc
.
width
=
wined3d_texture_get_level_width
(
src_texture
,
texture_level
);
desc
.
height
=
wined3d_texture_get_level_height
(
src_texture
,
texture_level
);
desc
.
height
=
wined3d_texture_get_level_height
(
src_texture
,
texture_level
);
...
...
include/wine/wined3d.h
View file @
b7146d81
...
@@ -870,6 +870,7 @@ enum wined3d_shader_byte_code_format
...
@@ -870,6 +870,7 @@ enum wined3d_shader_byte_code_format
#define WINED3DUSAGE_TEXTAPI 0x10000000
#define WINED3DUSAGE_TEXTAPI 0x10000000
#define WINED3DUSAGE_MASK 0x10007fff
#define WINED3DUSAGE_MASK 0x10007fff
#define WINED3DUSAGE_PRIVATE 0x00400000
#define WINED3DUSAGE_LEGACY_CUBEMAP 0x00800000
#define WINED3DUSAGE_LEGACY_CUBEMAP 0x00800000
#define WINED3DUSAGE_TEXTURE 0x01000000
#define WINED3DUSAGE_TEXTURE 0x01000000
#define WINED3DUSAGE_OWNDC 0x02000000
#define WINED3DUSAGE_OWNDC 0x02000000
...
...
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