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
b685b84e
Commit
b685b84e
authored
Aug 04, 2008
by
H. Verbeet
Committed by
Alexandre Julliard
Aug 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Apply FBO state in ActivateContext().
Fixes some GL errors due to calling glDrawBuffer(GL_BACK) when an FBO is still active.
parent
9a9414df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
24 deletions
+46
-24
context.c
dlls/wined3d/context.c
+46
-6
device.c
dlls/wined3d/device.c
+0
-12
drawprim.c
dlls/wined3d/drawprim.c
+0
-6
No files found.
dlls/wined3d/context.c
View file @
b685b84e
...
...
@@ -1051,7 +1051,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
return
context
;
}
static
void
apply_draw_buffer
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurface
*
target
)
static
void
apply_draw_buffer
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurface
*
target
,
BOOL
blit
)
{
HRESULT
hr
;
IWineD3DSwapChain
*
swapchain
;
...
...
@@ -1065,8 +1065,24 @@ static void apply_draw_buffer(IWineD3DDeviceImpl *This, IWineD3DSurface *target)
}
else
{
glDrawBuffer
(
This
->
offscreenBuffer
);
checkGLcall
(
"glDrawBuffer()"
);
if
(
!
blit
&&
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
if
(
GL_SUPPORT
(
ARB_DRAW_BUFFERS
))
{
GL_EXTCALL
(
glDrawBuffersARB
(
GL_LIMITS
(
buffers
),
This
->
draw_buffers
));
checkGLcall
(
"glDrawBuffers()"
);
}
else
{
glDrawBuffer
(
This
->
draw_buffers
[
0
]);
checkGLcall
(
"glDrawBuffer()"
);
}
}
else
{
glDrawBuffer
(
This
->
offscreenBuffer
);
checkGLcall
(
"glDrawBuffer()"
);
}
}
}
...
...
@@ -1135,9 +1151,33 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
/* We only need ENTER_GL for the gl calls made below and for the helper functions which make GL calls */
ENTER_GL
();
if
(
context
->
draw_buffer_dirty
)
{
apply_draw_buffer
(
This
,
target
);
context
->
draw_buffer_dirty
=
FALSE
;
switch
(
usage
)
{
case
CTXUSAGE_CLEAR
:
case
CTXUSAGE_DRAWPRIM
:
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
apply_fbo_state
((
IWineD3DDevice
*
)
This
);
}
if
(
context
->
draw_buffer_dirty
)
{
apply_draw_buffer
(
This
,
target
,
FALSE
);
context
->
draw_buffer_dirty
=
FALSE
;
}
break
;
case
CTXUSAGE_BLIT
:
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
));
context
->
draw_buffer_dirty
=
TRUE
;
}
if
(
context
->
draw_buffer_dirty
)
{
apply_draw_buffer
(
This
,
target
,
TRUE
);
if
(
wined3d_settings
.
offscreen_rendering_mode
!=
ORM_FBO
)
{
context
->
draw_buffer_dirty
=
FALSE
;
}
}
break
;
default:
break
;
}
switch
(
usage
)
{
...
...
dlls/wined3d/device.c
View file @
b685b84e
...
...
@@ -5026,10 +5026,6 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfa
ActivateContext
(
This
,
(
IWineD3DSurface
*
)
target
,
CTXUSAGE_CLEAR
);
ENTER_GL
();
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
apply_fbo_state
((
IWineD3DDevice
*
)
This
);
}
/* Only set the values up once, as they are not changing */
if
(
Flags
&
WINED3DCLEAR_STENCIL
)
{
glClearStencil
(
Stencil
);
...
...
@@ -6590,14 +6586,6 @@ void apply_fbo_state(IWineD3DDevice *iface) {
set_depth_stencil_fbo
(
iface
,
This
->
stencilBufferTarget
);
This
->
fbo_depth_attachment
=
This
->
stencilBufferTarget
;
}
if
(
GL_SUPPORT
(
ARB_DRAW_BUFFERS
))
{
GL_EXTCALL
(
glDrawBuffersARB
(
GL_LIMITS
(
buffers
),
This
->
draw_buffers
));
checkGLcall
(
"glDrawBuffers()"
);
}
else
{
glDrawBuffer
(
This
->
draw_buffers
[
0
]);
checkGLcall
(
"glDrawBuffer()"
);
}
}
else
{
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
));
}
...
...
dlls/wined3d/drawprim.c
View file @
b685b84e
...
...
@@ -941,12 +941,6 @@ void drawPrimitive(IWineD3DDevice *iface,
/* Ok, we will be updating the screen from here onwards so grab the lock */
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
ENTER_GL
();
apply_fbo_state
(
iface
);
LEAVE_GL
();
}
ActivateContext
(
This
,
This
->
render_targets
[
0
],
CTXUSAGE_DRAWPRIM
);
ENTER_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