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
c372654b
Commit
c372654b
authored
Jan 12, 2008
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 14, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement IWineD3DSurface::UnLoad.
parent
e59ddb0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
2 deletions
+52
-2
surface.c
dlls/wined3d/surface.c
+52
-2
No files found.
dlls/wined3d/surface.c
View file @
c372654b
...
@@ -489,8 +489,58 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) {
...
@@ -489,8 +489,58 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) {
return
;
return
;
}
}
void
WINAPI
IWineD3DSurfaceImpl_UnLoad
(
IWineD3DSurface
*
iface
)
{
static
void
surface_remove_pbo
(
IWineD3DSurfaceImpl
*
This
)
{
FIXME
(
"(%p): Stub!
\n
"
,
iface
);
This
->
resource
.
heapMemory
=
HeapAlloc
(
GetProcessHeap
()
,
0
,
This
->
resource
.
size
+
RESOURCE_ALIGNMENT
);
This
->
resource
.
allocatedMemory
=
(
BYTE
*
)(((
ULONG_PTR
)
This
->
resource
.
heapMemory
+
(
RESOURCE_ALIGNMENT
-
1
))
&
~
(
RESOURCE_ALIGNMENT
-
1
));
ENTER_GL
();
GL_EXTCALL
(
glBindBufferARB
(
GL_PIXEL_UNPACK_BUFFER_ARB
,
This
->
pbo
));
checkGLcall
(
"glBindBuffer(GL_PIXEL_UNPACK_BUFFER, This->pbo)"
);
GL_EXTCALL
(
glGetBufferSubDataARB
(
GL_PIXEL_UNPACK_BUFFER_ARB
,
0
,
This
->
resource
.
size
,
This
->
resource
.
allocatedMemory
));
checkGLcall
(
"glGetBufferSubData"
);
GL_EXTCALL
(
glDeleteBuffersARB
(
1
,
&
This
->
pbo
));
checkGLcall
(
"glDeleteBuffers"
);
LEAVE_GL
();
This
->
pbo
=
0
;
This
->
Flags
&=
~
SFLAG_PBO
;
}
static
void
WINAPI
IWineD3DSurfaceImpl_UnLoad
(
IWineD3DSurface
*
iface
)
{
IWineD3DBaseTexture
*
texture
=
NULL
;
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
iface
);
/* Default pool resources are supposed to be destroyed before Reset is called.
* Implicit resources stay however. So this means we have an implicit render target
* or depth stencil, and the content isn't supposed to survive the reset anyway
*/
if
(
This
->
resource
.
pool
==
WINED3DPOOL_DEFAULT
)
{
TRACE
(
"Default pool - nothing to do
\n
"
);
return
;
}
/* Load the surface into system memory */
IWineD3DSurface_LoadLocation
(
iface
,
SFLAG_INSYSMEM
,
NULL
);
/* Destroy PBOs, but load them into real sysmem before */
if
(
This
->
Flags
&
SFLAG_PBO
)
{
surface_remove_pbo
(
This
);
}
/* If we're in a texture, the texture name belongs to the texture. Otherwise,
* destroy it
*/
IWineD3DSurface_GetContainer
(
iface
,
&
IID_IWineD3DBaseTexture
,
(
void
**
)
&
texture
);
if
(
!
texture
)
{
ENTER_GL
();
glDeleteTextures
(
1
,
&
This
->
glDescription
.
textureName
);
This
->
glDescription
.
textureName
=
0
;
LEAVE_GL
();
}
else
{
IWineD3DBaseTexture_Release
(
texture
);
}
return
;
return
;
}
}
...
...
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