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
76de76e5
Commit
76de76e5
authored
Sep 18, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Destroy FBO entries in the context.
parent
459673da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
22 deletions
+47
-22
context.c
dlls/wined3d/context.c
+41
-1
device.c
dlls/wined3d/device.c
+5
-19
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-2
No files found.
dlls/wined3d/context.c
View file @
76de76e5
...
...
@@ -226,7 +226,7 @@ static struct fbo_entry *context_create_fbo_entry(IWineD3DDevice *iface)
return
entry
;
}
void
context_destroy_fbo_entry
(
IWineD3DDeviceImpl
*
This
,
struct
fbo_entry
*
entry
)
static
void
context_destroy_fbo_entry
(
IWineD3DDeviceImpl
*
This
,
struct
fbo_entry
*
entry
)
{
if
(
entry
->
id
)
{
...
...
@@ -320,6 +320,46 @@ static void context_apply_fbo_state(IWineD3DDevice *iface)
context_check_fbo_status
(
iface
);
}
void
context_resource_released
(
IWineD3DDevice
*
iface
,
IWineD3DResource
*
resource
,
WINED3DRESOURCETYPE
type
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
UINT
i
;
switch
(
type
)
{
case
WINED3DRTYPE_SURFACE
:
{
for
(
i
=
0
;
i
<
This
->
numContexts
;
++
i
)
{
struct
fbo_entry
*
entry
,
*
entry2
;
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
&
This
->
contexts
[
i
]
->
fbo_list
,
struct
fbo_entry
,
entry
)
{
BOOL
destroyed
=
FALSE
;
UINT
j
;
for
(
j
=
0
;
!
destroyed
&&
j
<
GL_LIMITS
(
buffers
);
++
j
)
{
if
(
entry
->
render_targets
[
j
]
==
(
IWineD3DSurface
*
)
resource
)
{
context_destroy_fbo_entry
(
This
,
entry
);
destroyed
=
TRUE
;
}
}
if
(
!
destroyed
&&
entry
->
depth_stencil
==
(
IWineD3DSurface
*
)
resource
)
context_destroy_fbo_entry
(
This
,
entry
);
}
}
break
;
}
default:
break
;
}
}
/*****************************************************************************
* Context_MarkStateDirty
*
...
...
dlls/wined3d/device.c
View file @
76de76e5
...
...
@@ -7325,10 +7325,14 @@ static void WINAPI IWineD3DDeviceImpl_RemoveResource(IWineD3DDevice *iface, IWin
static
void
WINAPI
IWineD3DDeviceImpl_ResourceReleased
(
IWineD3DDevice
*
iface
,
IWineD3DResource
*
resource
){
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
WINED3DRESOURCETYPE
type
=
IWineD3DResource_GetType
(
resource
);
int
counter
;
TRACE
(
"(%p) : resource %p
\n
"
,
This
,
resource
);
switch
(
IWineD3DResource_GetType
(
resource
)){
context_resource_released
(
iface
,
resource
,
type
);
switch
(
type
)
{
/* TODO: check front and back buffers, rendertargets etc.. possibly swapchains? */
case
WINED3DRTYPE_SURFACE
:
{
unsigned
int
i
;
...
...
@@ -7374,24 +7378,6 @@ static void WINAPI IWineD3DDeviceImpl_ResourceReleased(IWineD3DDevice *iface, IW
if
(
This
->
stencilBufferTarget
==
(
IWineD3DSurface
*
)
resource
)
{
This
->
stencilBufferTarget
=
NULL
;
}
for
(
i
=
0
;
i
<
This
->
numContexts
;
++
i
)
{
struct
fbo_entry
*
entry
,
*
entry2
;
int
j
;
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
&
This
->
contexts
[
i
]
->
fbo_list
,
struct
fbo_entry
,
entry
)
{
BOOL
destroyed
=
FALSE
;
for
(
j
=
0
;
!
destroyed
&&
j
<
GL_LIMITS
(
buffers
);
++
j
)
{
if
(
entry
->
render_targets
[
j
]
==
(
IWineD3DSurface
*
)
resource
)
{
context_destroy_fbo_entry
(
This
,
entry
);
destroyed
=
TRUE
;
}
}
if
(
!
destroyed
&&
entry
->
depth_stencil
==
(
IWineD3DSurface
*
)
resource
)
{
context_destroy_fbo_entry
(
This
,
entry
);
}
}
}
}
break
;
...
...
dlls/wined3d/wined3d_private.h
View file @
76de76e5
...
...
@@ -629,6 +629,7 @@ typedef enum ContextUsage {
void
ActivateContext
(
IWineD3DDeviceImpl
*
device
,
IWineD3DSurface
*
target
,
ContextUsage
usage
);
WineD3DContext
*
CreateContext
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurfaceImpl
*
target
,
HWND
win
,
BOOL
create_pbuffer
,
const
WINED3DPRESENT_PARAMETERS
*
pPresentParms
);
void
DestroyContext
(
IWineD3DDeviceImpl
*
This
,
WineD3DContext
*
context
);
void
context_resource_released
(
IWineD3DDevice
*
iface
,
IWineD3DResource
*
resource
,
WINED3DRESOURCETYPE
type
);
void
context_bind_fbo
(
IWineD3DDevice
*
iface
,
GLenum
target
,
GLuint
*
fbo
);
void
context_attach_depth_stencil_fbo
(
IWineD3DDeviceImpl
*
This
,
GLenum
fbo_target
,
IWineD3DSurface
*
depth_stencil
,
BOOL
use_render_buffer
);
void
context_attach_surface_fbo
(
IWineD3DDeviceImpl
*
This
,
GLenum
fbo_target
,
DWORD
idx
,
IWineD3DSurface
*
surface
);
...
...
@@ -2442,6 +2443,4 @@ static inline BOOL use_ps(IWineD3DDeviceImpl *device) {
void
stretch_rect_fbo
(
IWineD3DDevice
*
iface
,
IWineD3DSurface
*
src_surface
,
WINED3DRECT
*
src_rect
,
IWineD3DSurface
*
dst_surface
,
WINED3DRECT
*
dst_rect
,
const
WINED3DTEXTUREFILTERTYPE
filter
,
BOOL
flip
);
void
depth_blt
(
IWineD3DDevice
*
iface
,
GLuint
texture
,
GLsizei
w
,
GLsizei
h
);
void
context_destroy_fbo_entry
(
IWineD3DDeviceImpl
*
This
,
struct
fbo_entry
*
entry
);
#endif
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