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
4056f4bf
Commit
4056f4bf
authored
May 04, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
May 05, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Explicitly pass the render target and depth/stencil surfaces to the FBO…
wined3d: Explicitly pass the render target and depth/stencil surfaces to the FBO management functions.
parent
e01d56f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
context.c
dlls/wined3d/context.c
+20
-18
No files found.
dlls/wined3d/context.c
View file @
4056f4bf
...
...
@@ -318,16 +318,16 @@ static void context_check_fbo_status(struct wined3d_context *context, GLenum tar
}
}
static
struct
fbo_entry
*
context_create_fbo_entry
(
struct
wined3d_context
*
context
)
static
struct
fbo_entry
*
context_create_fbo_entry
(
struct
wined3d_context
*
context
,
IWineD3DSurfaceImpl
**
render_targets
,
IWineD3DSurfaceImpl
*
depth_stencil
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
IWineD3DDeviceImpl
*
device
=
context
->
swapchain
->
device
;
struct
fbo_entry
*
entry
;
entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
entry
));
entry
->
render_targets
=
HeapAlloc
(
GetProcessHeap
(),
0
,
gl_info
->
limits
.
buffers
*
sizeof
(
*
entry
->
render_targets
));
memcpy
(
entry
->
render_targets
,
device
->
render_targets
,
gl_info
->
limits
.
buffers
*
sizeof
(
*
entry
->
render_targets
));
entry
->
depth_stencil
=
de
vice
->
de
pth_stencil
;
memcpy
(
entry
->
render_targets
,
render_targets
,
gl_info
->
limits
.
buffers
*
sizeof
(
*
entry
->
render_targets
));
entry
->
depth_stencil
=
depth_stencil
;
entry
->
attached
=
FALSE
;
entry
->
id
=
0
;
...
...
@@ -335,16 +335,17 @@ static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *contex
}
/* GL locking is done by the caller */
static
void
context_reuse_fbo_entry
(
struct
wined3d_context
*
context
,
GLenum
target
,
struct
fbo_entry
*
entry
)
static
void
context_reuse_fbo_entry
(
struct
wined3d_context
*
context
,
GLenum
target
,
IWineD3DSurfaceImpl
**
render_targets
,
IWineD3DSurfaceImpl
*
depth_stencil
,
struct
fbo_entry
*
entry
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
IWineD3DDeviceImpl
*
device
=
context
->
swapchain
->
device
;
context_bind_fbo
(
context
,
target
,
&
entry
->
id
);
context_clean_fbo_attachments
(
gl_info
);
memcpy
(
entry
->
render_targets
,
device
->
render_targets
,
gl_info
->
limits
.
buffers
*
sizeof
(
*
entry
->
render_targets
));
entry
->
depth_stencil
=
de
vice
->
de
pth_stencil
;
memcpy
(
entry
->
render_targets
,
render_targets
,
gl_info
->
limits
.
buffers
*
sizeof
(
*
entry
->
render_targets
));
entry
->
depth_stencil
=
depth_stencil
;
entry
->
attached
=
FALSE
;
}
...
...
@@ -364,17 +365,17 @@ static void context_destroy_fbo_entry(struct wined3d_context *context, struct fb
/* GL locking is done by the caller */
static
struct
fbo_entry
*
context_find_fbo_entry
(
struct
wined3d_context
*
context
,
GLenum
target
)
static
struct
fbo_entry
*
context_find_fbo_entry
(
struct
wined3d_context
*
context
,
GLenum
target
,
IWineD3DSurfaceImpl
**
render_targets
,
IWineD3DSurfaceImpl
*
depth_stencil
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
IWineD3DDeviceImpl
*
device
=
context
->
swapchain
->
device
;
struct
fbo_entry
*
entry
;
LIST_FOR_EACH_ENTRY
(
entry
,
&
context
->
fbo_list
,
struct
fbo_entry
,
entry
)
{
if
(
!
memcmp
(
entry
->
render_targets
,
device
->
render_targets
,
gl_info
->
limits
.
buffers
*
sizeof
(
*
entry
->
render_targets
))
&&
entry
->
depth_stencil
==
de
vice
->
de
pth_stencil
)
render_targets
,
gl_info
->
limits
.
buffers
*
sizeof
(
*
entry
->
render_targets
))
&&
entry
->
depth_stencil
==
depth_stencil
)
{
list_remove
(
&
entry
->
entry
);
list_add_head
(
&
context
->
fbo_list
,
&
entry
->
entry
);
...
...
@@ -384,14 +385,14 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context,
if
(
context
->
fbo_entry_count
<
WINED3D_MAX_FBO_ENTRIES
)
{
entry
=
context_create_fbo_entry
(
context
);
entry
=
context_create_fbo_entry
(
context
,
render_targets
,
depth_stencil
);
list_add_head
(
&
context
->
fbo_list
,
&
entry
->
entry
);
++
context
->
fbo_entry_count
;
}
else
{
entry
=
LIST_ENTRY
(
list_tail
(
&
context
->
fbo_list
),
struct
fbo_entry
,
entry
);
context_reuse_fbo_entry
(
context
,
target
,
entry
);
context_reuse_fbo_entry
(
context
,
target
,
render_targets
,
depth_stencil
,
entry
);
list_remove
(
&
entry
->
entry
);
list_add_head
(
&
context
->
fbo_list
,
&
entry
->
entry
);
}
...
...
@@ -438,7 +439,8 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ
}
/* GL locking is done by the caller */
static
void
context_apply_fbo_state
(
struct
wined3d_context
*
context
,
GLenum
target
)
static
void
context_apply_fbo_state
(
struct
wined3d_context
*
context
,
GLenum
target
,
IWineD3DSurfaceImpl
**
render_targets
,
IWineD3DSurfaceImpl
*
depth_stencil
)
{
struct
fbo_entry
*
entry
,
*
entry2
;
...
...
@@ -455,7 +457,7 @@ static void context_apply_fbo_state(struct wined3d_context *context, GLenum targ
if
(
context
->
render_offscreen
)
{
context
->
current_fbo
=
context_find_fbo_entry
(
context
,
target
);
context
->
current_fbo
=
context_find_fbo_entry
(
context
,
target
,
render_targets
,
depth_stencil
);
context_apply_fbo_entry
(
context
,
target
,
context
->
current_fbo
);
}
else
...
...
@@ -2016,7 +2018,7 @@ void context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceIm
{
if
(
!
context
->
render_offscreen
)
context_validate_onscreen_formats
(
device
,
context
);
ENTER_GL
();
context_apply_fbo_state
(
context
,
GL_FRAMEBUFFER
);
context_apply_fbo_state
(
context
,
GL_FRAMEBUFFER
,
device
->
render_targets
,
device
->
depth_stencil
);
LEAVE_GL
();
}
...
...
@@ -2056,7 +2058,7 @@ void context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImp
{
if
(
!
context
->
render_offscreen
)
context_validate_onscreen_formats
(
device
,
context
);
ENTER_GL
();
context_apply_fbo_state
(
context
,
GL_FRAMEBUFFER
);
context_apply_fbo_state
(
context
,
GL_FRAMEBUFFER
,
device
->
render_targets
,
device
->
depth_stencil
);
LEAVE_GL
();
}
...
...
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