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
2469597e
Commit
2469597e
authored
Jan 26, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Verify we have at least one framebuffer attachment before doing clears or draws.
parent
bea2be5c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
6 deletions
+44
-6
context.c
dlls/wined3d/context.c
+30
-2
device.c
dlls/wined3d/device.c
+6
-1
drawprim.c
dlls/wined3d/drawprim.c
+6
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-2
No files found.
dlls/wined3d/context.c
View file @
2469597e
...
...
@@ -2053,13 +2053,33 @@ void context_apply_blit_state(struct wined3d_context *context, IWineD3DDeviceImp
SetupForBlit
(
device
,
context
);
}
static
BOOL
context_validate_rt_config
(
UINT
rt_count
,
IWineD3DSurfaceImpl
**
rts
,
IWineD3DSurfaceImpl
*
ds
)
{
unsigned
int
i
;
if
(
ds
)
return
TRUE
;
for
(
i
=
0
;
i
<
rt_count
;
++
i
)
{
if
(
rts
[
i
])
return
TRUE
;
}
WARN
(
"Invalid render target config, need at least one attachment.
\n
"
);
return
FALSE
;
}
/* Context activation is done by the caller. */
void
context_apply_clear_state
(
struct
wined3d_context
*
context
,
IWineD3DDeviceImpl
*
device
,
BOOL
context_apply_clear_state
(
struct
wined3d_context
*
context
,
IWineD3DDeviceImpl
*
device
,
UINT
rt_count
,
IWineD3DSurfaceImpl
**
rts
,
IWineD3DSurfaceImpl
*
depth_stencil
)
{
const
struct
StateEntry
*
state_table
=
device
->
StateTable
;
UINT
i
;
if
(
!
context_validate_rt_config
(
rt_count
,
rts
,
depth_stencil
))
return
FALSE
;
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
context_validate_onscreen_formats
(
device
,
context
,
depth_stencil
);
...
...
@@ -2108,14 +2128,20 @@ void context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceIm
Context_MarkStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
state_table
);
Context_MarkStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_SCISSORTESTENABLE
),
state_table
);
Context_MarkStateDirty
(
context
,
STATE_SCISSORRECT
,
state_table
);
return
TRUE
;
}
/* Context activation is done by the caller. */
void
context_apply_draw_state
(
struct
wined3d_context
*
context
,
IWineD3DDeviceImpl
*
device
)
BOOL
context_apply_draw_state
(
struct
wined3d_context
*
context
,
IWineD3DDeviceImpl
*
device
)
{
const
struct
StateEntry
*
state_table
=
device
->
StateTable
;
unsigned
int
i
;
if
(
!
context_validate_rt_config
(
context
->
gl_info
->
limits
.
buffers
,
device
->
render_targets
,
device
->
depth_stencil
))
return
FALSE
;
/* Preload resources before FBO setup. Texture preload in particular may
* result in changes to the current FBO, due to using e.g. FBO blits for
* updating a resource location. */
...
...
@@ -2166,6 +2192,8 @@ void context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImp
LEAVE_GL
();
context
->
numDirtyEntries
=
0
;
/* This makes the whole list clean */
context
->
last_was_blit
=
FALSE
;
return
TRUE
;
}
static
void
context_setup_target
(
IWineD3DDeviceImpl
*
device
,
...
...
dlls/wined3d/device.c
View file @
2469597e
...
...
@@ -686,7 +686,12 @@ HRESULT device_clear_render_targets(IWineD3DDeviceImpl *device, UINT rt_count, I
return
WINED3D_OK
;
}
context_apply_clear_state
(
context
,
device
,
rt_count
,
rts
,
depth_stencil
);
if
(
!
context_apply_clear_state
(
context
,
device
,
rt_count
,
rts
,
depth_stencil
))
{
context_release
(
context
);
WARN
(
"Failed to apply clear state, skipping clear.
\n
"
);
return
WINED3D_OK
;
}
target
->
get_drawable_size
(
context
,
&
drawable_width
,
&
drawable_height
);
...
...
dlls/wined3d/drawprim.c
View file @
2469597e
...
...
@@ -591,7 +591,12 @@ void drawPrimitive(IWineD3DDeviceImpl *device, UINT index_count, UINT StartIdx,
return
;
}
context_apply_draw_state
(
context
,
device
);
if
(
!
context_apply_draw_state
(
context
,
device
))
{
context_release
(
context
);
WARN
(
"Unable to apply draw state, skipping draw.
\n
"
);
return
;
}
if
(
device
->
depth_stencil
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
2469597e
...
...
@@ -1212,9 +1212,9 @@ void context_alloc_event_query(struct wined3d_context *context,
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
,
BOOL
context_apply_clear_state
(
struct
wined3d_context
*
context
,
IWineD3DDeviceImpl
*
device
,
UINT
rt_count
,
IWineD3DSurfaceImpl
**
rts
,
IWineD3DSurfaceImpl
*
depth_stencil
)
DECLSPEC_HIDDEN
;
void
context_apply_draw_state
(
struct
wined3d_context
*
context
,
IWineD3DDeviceImpl
*
device
)
DECLSPEC_HIDDEN
;
BOOL
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
,
DWORD
location
)
DECLSPEC_HIDDEN
;
void
context_attach_depth_stencil_fbo
(
struct
wined3d_context
*
context
,
...
...
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