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
d374d850
Commit
d374d850
authored
Jul 23, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Clear all render targets in an MRT setup.
parent
74015090
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
17 deletions
+55
-17
context.c
dlls/wined3d/context.c
+47
-11
device.c
dlls/wined3d/device.c
+0
-0
surface.c
dlls/wined3d/surface.c
+4
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-3
No files found.
dlls/wined3d/context.c
View file @
d374d850
...
...
@@ -473,7 +473,9 @@ void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target
{
if
(
surface_is_offscreen
(
render_target
))
{
UINT
clear_size
=
(
context
->
gl_info
->
limits
.
buffers
-
1
)
*
sizeof
(
*
context
->
blit_targets
);
context
->
blit_targets
[
0
]
=
render_target
;
if
(
clear_size
)
memset
(
&
context
->
blit_targets
[
1
],
0
,
clear_size
);
context_apply_fbo_state
(
context
,
target
,
context
->
blit_targets
,
depth_stencil
);
}
else
...
...
@@ -2059,30 +2061,64 @@ void context_apply_blit_state(struct wined3d_context *context, IWineD3DDeviceImp
/* Context activation is done by the caller. */
void
context_apply_clear_state
(
struct
wined3d_context
*
context
,
IWineD3DDeviceImpl
*
device
,
IWineD3DSurfaceImpl
*
render_target
,
IWineD3DSurfaceImpl
*
depth_stencil
)
UINT
rt_count
,
IWineD3DSurfaceImpl
**
rts
,
IWineD3DSurfaceImpl
*
depth_stencil
)
{
const
struct
StateEntry
*
state_table
=
device
->
StateTable
;
GLenum
buffer
;
UINT
i
;
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
context_validate_onscreen_formats
(
device
,
context
,
depth_stencil
);
ENTER_GL
();
context_apply_fbo_state_blit
(
context
,
GL_FRAMEBUFFER
,
render_target
,
depth_stencil
);
if
(
surface_is_offscreen
(
rts
[
0
]))
{
for
(
i
=
0
;
i
<
rt_count
;
++
i
)
{
context
->
blit_targets
[
i
]
=
rts
[
i
];
}
while
(
i
<
context
->
gl_info
->
limits
.
buffers
)
{
context
->
blit_targets
[
i
]
=
NULL
;
++
i
;
}
context_apply_fbo_state
(
context
,
GL_FRAMEBUFFER
,
context
->
blit_targets
,
depth_stencil
);
}
else
{
context_apply_fbo_state
(
context
,
GL_FRAMEBUFFER
,
NULL
,
NULL
);
}
LEAVE_GL
();
}
if
(
!
surface_is_offscreen
(
render_target
))
buffer
=
surface_get_gl_buffer
(
render_target
);
else
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
buffer
=
GL_COLOR_ATTACHMENT0
;
if
(
!
surface_is_offscreen
(
rts
[
0
]))
{
ENTER_GL
();
context_set_draw_buffer
(
context
,
surface_get_gl_buffer
(
rts
[
0
]));
LEAVE_GL
();
}
else
buffer
=
device
->
offscreenBuffer
;
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GLenum
buffers
[
gl_info
->
limits
.
buffers
];
ENTER_GL
();
context_set_draw_buffer
(
context
,
buffer
);
LEAVE_GL
();
for
(
i
=
0
;
i
<
gl_info
->
limits
.
buffers
;
++
i
)
{
if
(
i
<
rt_count
&&
rts
[
i
])
buffers
[
i
]
=
GL_COLOR_ATTACHMENT0
+
i
;
else
buffers
[
i
]
=
GL_NONE
;
}
ENTER_GL
();
GL_EXTCALL
(
glDrawBuffersARB
(
gl_info
->
limits
.
buffers
,
buffers
));
checkGLcall
(
"glDrawBuffers()"
);
LEAVE_GL
();
context
->
draw_buffer_dirty
=
TRUE
;
}
if
(
context
->
last_was_blit
)
{
...
...
dlls/wined3d/device.c
View file @
d374d850
This diff is collapsed.
Click to expand it.
dlls/wined3d/surface.c
View file @
d374d850
...
...
@@ -4726,10 +4726,11 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info, enum blit_
return
FALSE
;
}
static
HRESULT
ffp_blit_color_fill
(
IWineD3DDeviceImpl
*
device
,
IWineD3DSurfaceImpl
*
dst_surface
,
const
RECT
*
dst_rect
,
DWORD
fill_color
)
static
HRESULT
ffp_blit_color_fill
(
IWineD3DDeviceImpl
*
device
,
IWineD3DSurfaceImpl
*
dst_surface
,
const
RECT
*
dst_rect
,
DWORD
fill_color
)
{
return
IWineD3DDeviceImpl_ClearSurface
(
device
,
dst_surface
,
1
/* Number of rectangles
*/
,
(
const
WINED3DRECT
*
)
dst_rect
,
WINED3DCLEAR_TARGET
,
fill_color
,
0
.
0
f
/* Z */
,
0
/* S
tencil */
);
return
device_clear_render_targets
(
device
,
1
/* rt_count */
,
&
dst_surface
,
1
/* rect_count
*/
,
(
const
WINED3DRECT
*
)
dst_rect
,
WINED3DCLEAR_TARGET
,
fill_color
,
0
.
0
f
/* depth */
,
0
/* s
tencil */
);
}
const
struct
blit_shader
ffp_blit
=
{
...
...
dlls/wined3d/wined3d_private.h
View file @
d374d850
...
...
@@ -1161,7 +1161,7 @@ void context_alloc_occlusion_query(struct wined3d_context *context,
struct
wined3d_occlusion_query
*
query
)
DECLSPEC_HIDDEN
;
void
context_apply_blit_state
(
struct
wined3d_context
*
context
,
IWineD3DDeviceImpl
*
device
)
DECLSPEC_HIDDEN
;
void
context_apply_clear_state
(
struct
wined3d_context
*
context
,
IWineD3DDeviceImpl
*
device
,
IWineD3DSurfaceImpl
*
render_target
,
IWineD3DSurfaceImpl
*
depth_stencil
)
DECLSPEC_HIDDEN
;
UINT
rt_count
,
IWineD3DSurfaceImpl
**
rts
,
IWineD3DSurfaceImpl
*
depth_stencil
)
DECLSPEC_HIDDEN
;
void
context_apply_draw_state
(
struct
wined3d_context
*
context
,
IWineD3DDeviceImpl
*
device
)
DECLSPEC_HIDDEN
;
void
context_apply_fbo_state_blit
(
struct
wined3d_context
*
context
,
GLenum
target
,
IWineD3DSurfaceImpl
*
render_target
,
IWineD3DSurfaceImpl
*
depth_stencil
)
DECLSPEC_HIDDEN
;
...
...
@@ -1686,6 +1686,9 @@ struct IWineD3DDeviceImpl
struct
WineD3DRectPatch
*
currentPatch
;
};
HRESULT
device_clear_render_targets
(
IWineD3DDeviceImpl
*
device
,
UINT
rt_count
,
IWineD3DSurfaceImpl
**
rts
,
UINT
rect_count
,
const
WINED3DRECT
*
rects
,
DWORD
flags
,
WINED3DCOLOR
color
,
float
depth
,
DWORD
stencil
)
DECLSPEC_HIDDEN
;
BOOL
device_context_add
(
IWineD3DDeviceImpl
*
device
,
struct
wined3d_context
*
context
)
DECLSPEC_HIDDEN
;
void
device_context_remove
(
IWineD3DDeviceImpl
*
device
,
struct
wined3d_context
*
context
)
DECLSPEC_HIDDEN
;
void
device_get_draw_rect
(
IWineD3DDeviceImpl
*
device
,
RECT
*
rect
)
DECLSPEC_HIDDEN
;
...
...
@@ -1702,8 +1705,6 @@ void device_stream_info_from_declaration(IWineD3DDeviceImpl *This,
void
device_switch_onscreen_ds
(
IWineD3DDeviceImpl
*
device
,
struct
wined3d_context
*
context
,
IWineD3DSurfaceImpl
*
depth_stencil
)
DECLSPEC_HIDDEN
;
void
device_update_stream_info
(
IWineD3DDeviceImpl
*
device
,
const
struct
wined3d_gl_info
*
gl_info
)
DECLSPEC_HIDDEN
;
HRESULT
IWineD3DDeviceImpl_ClearSurface
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurfaceImpl
*
target
,
DWORD
Count
,
const
WINED3DRECT
*
pRects
,
DWORD
Flags
,
WINED3DCOLOR
Color
,
float
Z
,
DWORD
Stencil
)
DECLSPEC_HIDDEN
;
void
IWineD3DDeviceImpl_FindTexUnitMap
(
IWineD3DDeviceImpl
*
This
)
DECLSPEC_HIDDEN
;
void
IWineD3DDeviceImpl_MarkStateDirty
(
IWineD3DDeviceImpl
*
This
,
DWORD
state
)
DECLSPEC_HIDDEN
;
...
...
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