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
710f6f84
Commit
710f6f84
authored
Jul 17, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Always use context_bind_fbo() to change the framebuffer binding.
parent
74851738
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
31 deletions
+29
-31
context.c
dlls/wined3d/context.c
+20
-17
device.c
dlls/wined3d/device.c
+5
-7
surface.c
dlls/wined3d/surface.c
+4
-7
No files found.
dlls/wined3d/context.c
View file @
710f6f84
...
...
@@ -47,15 +47,24 @@ void context_set_last_device(IWineD3DDeviceImpl *device)
void
context_bind_fbo
(
struct
WineD3DContext
*
context
,
GLenum
target
,
GLuint
*
fbo
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GLuint
f
;
if
(
!
*
fbo
)
if
(
!
fbo
)
{
GL_EXTCALL
(
glGenFramebuffersEXT
(
1
,
fbo
));
checkGLcall
(
"glGenFramebuffersEXT()"
);
TRACE
(
"Created FBO %d
\n
"
,
*
fbo
);
f
=
0
;
}
else
{
if
(
!*
fbo
)
{
GL_EXTCALL
(
glGenFramebuffersEXT
(
1
,
fbo
));
checkGLcall
(
"glGenFramebuffersEXT()"
);
TRACE
(
"Created FBO %u.
\n
"
,
*
fbo
);
}
f
=
*
fbo
;
}
GL_EXTCALL
(
glBindFramebufferEXT
(
target
,
*
fbo
));
GL_EXTCALL
(
glBindFramebufferEXT
(
target
,
f
));
checkGLcall
(
"glBindFramebuffer()"
);
}
...
...
@@ -77,17 +86,14 @@ static void context_clean_fbo_attachments(const struct wined3d_gl_info *gl_info)
}
/* GL locking is done by the caller */
static
void
context_destroy_fbo
(
struct
WineD3DContext
*
context
,
const
GLuint
*
fbo
)
static
void
context_destroy_fbo
(
struct
WineD3DContext
*
context
,
GLuint
*
fbo
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
*
fbo
));
checkGLcall
(
"glBindFramebuffer()"
);
context_bind_fbo
(
context
,
GL_FRAMEBUFFER_EXT
,
fbo
);
context_clean_fbo_attachments
(
gl_info
);
context_bind_fbo
(
context
,
GL_FRAMEBUFFER_EXT
,
NULL
);
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
));
checkGLcall
(
"glBindFramebuffer()"
);
GL_EXTCALL
(
glDeleteFramebuffersEXT
(
1
,
fbo
));
checkGLcall
(
"glDeleteFramebuffers()"
);
}
...
...
@@ -308,8 +314,7 @@ static void context_reuse_fbo_entry(struct WineD3DContext *context, struct fbo_e
IWineD3DDeviceImpl
*
device
=
((
IWineD3DSurfaceImpl
*
)
context
->
surface
)
->
resource
.
wineD3DDevice
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
entry
->
id
));
checkGLcall
(
"glBindFramebuffer()"
);
context_bind_fbo
(
context
,
GL_FRAMEBUFFER_EXT
,
&
entry
->
id
);
context_clean_fbo_attachments
(
gl_info
);
memcpy
(
entry
->
render_targets
,
device
->
render_targets
,
GL_LIMITS
(
buffers
)
*
sizeof
(
*
entry
->
render_targets
));
...
...
@@ -419,7 +424,6 @@ static void context_apply_fbo_entry(struct WineD3DContext *context, struct fbo_e
static
void
context_apply_fbo_state
(
struct
WineD3DContext
*
context
)
{
IWineD3DDeviceImpl
*
device
=
((
IWineD3DSurfaceImpl
*
)
context
->
surface
)
->
resource
.
wineD3DDevice
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
if
(
device
->
render_offscreen
)
{
...
...
@@ -427,7 +431,7 @@ static void context_apply_fbo_state(struct WineD3DContext *context)
context_apply_fbo_entry
(
context
,
context
->
current_fbo
);
}
else
{
context
->
current_fbo
=
NULL
;
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
)
);
context_bind_fbo
(
context
,
GL_FRAMEBUFFER_EXT
,
NULL
);
}
context_check_fbo_status
(
context
);
...
...
@@ -1800,8 +1804,7 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
LEAVE_GL
();
}
else
{
ENTER_GL
();
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
));
checkGLcall
(
"glFramebufferRenderbufferEXT"
);
context_bind_fbo
(
context
,
GL_FRAMEBUFFER_EXT
,
NULL
);
LEAVE_GL
();
}
context
->
draw_buffer_dirty
=
TRUE
;
...
...
dlls/wined3d/device.c
View file @
710f6f84
...
...
@@ -6041,7 +6041,7 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface,
ActivateContext
(
This
,
surface
,
CTXUSAGE_RESOURCELOAD
);
ENTER_GL
();
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
)
);
context_bind_fbo
(
This
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
NULL
);
buffer
=
surface_get_gl_buffer
(
surface
,
swapchain
);
glDrawBuffer
(
buffer
);
checkGLcall
(
"glDrawBuffer()"
);
...
...
@@ -6083,8 +6083,7 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface,
if
(
This
->
activeContext
->
current_fbo
)
{
context_bind_fbo
(
This
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
&
This
->
activeContext
->
current_fbo
->
id
);
}
else
{
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
));
checkGLcall
(
"glBindFramebuffer()"
);
context_bind_fbo
(
This
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
NULL
);
}
if
(
swapchain
&&
surface
==
((
IWineD3DSwapChainImpl
*
)
swapchain
)
->
frontBuffer
...
...
@@ -6468,7 +6467,7 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
}
ENTER_GL
();
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_READ_FRAMEBUFFER_EXT
,
0
)
);
context_bind_fbo
(
This
->
activeContext
,
GL_READ_FRAMEBUFFER_EXT
,
NULL
);
glReadBuffer
(
buffer
);
checkGLcall
(
"glReadBuffer()"
);
}
else
{
...
...
@@ -6507,7 +6506,7 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
}
ENTER_GL
();
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_DRAW_FRAMEBUFFER_EXT
,
0
)
);
context_bind_fbo
(
This
->
activeContext
,
GL_DRAW_FRAMEBUFFER_EXT
,
NULL
);
glDrawBuffer
(
buffer
);
checkGLcall
(
"glDrawBuffer()"
);
}
else
{
...
...
@@ -6538,8 +6537,7 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
if
(
This
->
activeContext
->
current_fbo
)
{
context_bind_fbo
(
This
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
&
This
->
activeContext
->
current_fbo
->
id
);
}
else
{
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
));
checkGLcall
(
"glBindFramebuffer()"
);
context_bind_fbo
(
This
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
NULL
);
}
/* If we switched from GL_BACK to GL_FRONT above, we need to switch back here */
...
...
dlls/wined3d/surface.c
View file @
710f6f84
...
...
@@ -4404,7 +4404,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) {
/* Note that we use depth_blt here as well, rather than glCopyTexImage2D
* directly on the FBO texture. That's because we need to flip. */
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
)
);
context_bind_fbo
(
device
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
NULL
);
if
(
This
->
texture_target
==
GL_TEXTURE_RECTANGLE_ARB
)
{
glGetIntegerv
(
GL_TEXTURE_BINDING_RECTANGLE_ARB
,
&
old_binding
);
...
...
@@ -4451,8 +4451,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) {
if
(
device
->
activeContext
->
current_fbo
)
{
context_bind_fbo
(
device
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
&
device
->
activeContext
->
current_fbo
->
id
);
}
else
{
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
));
checkGLcall
(
"glBindFramebuffer()"
);
context_bind_fbo
(
device
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
NULL
);
}
LEAVE_GL
();
...
...
@@ -4465,15 +4464,13 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) {
ENTER_GL
();
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
));
checkGLcall
(
"glBindFramebuffer()"
);
context_bind_fbo
(
device
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
NULL
);
surface_depth_blt
(
This
,
This
->
texture_name
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
,
This
->
texture_target
);
checkGLcall
(
"depth_blt"
);
if
(
device
->
activeContext
->
current_fbo
)
{
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
device
->
activeContext
->
current_fbo
->
id
));
checkGLcall
(
"glBindFramebuffer()"
);
context_bind_fbo
(
device
->
activeContext
,
GL_FRAMEBUFFER_EXT
,
&
device
->
activeContext
->
current_fbo
->
id
);
}
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