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
70dd7ced
Commit
70dd7ced
authored
Apr 09, 2007
by
H. Verbeet
Committed by
Alexandre Julliard
Apr 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Separate attaching a surface to an FBO from set_render_target_fbo.
parent
2e1e3d48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
16 deletions
+21
-16
device.c
dlls/wined3d/device.c
+21
-16
No files found.
dlls/wined3d/device.c
View file @
70dd7ced
...
...
@@ -5139,29 +5139,34 @@ static void set_depth_stencil_fbo(IWineD3DDevice *iface, IWineD3DSurface *depth_
}
}
static
void
set_render_target_fbo
(
IWineD3DDevice
*
iface
,
DWORD
idx
,
IWineD3DSurface
*
render_target
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DSurfaceImpl
*
rtimpl
=
(
IWineD3DSurfaceImpl
*
)
render_target
;
static
void
attach_surface_fbo
(
IWineD3DDeviceImpl
*
This
,
GLenum
fbo_target
,
DWORD
idx
,
IWineD3DSurface
*
surface
)
{
const
IWineD3DSurfaceImpl
*
surface_impl
=
(
IWineD3DSurfaceImpl
*
)
surface
;
GLenum
texttarget
,
target
;
GLint
old_binding
;
TRACE
(
"Set render target %u to %p
\n
"
,
idx
,
render_target
);
texttarget
=
surface_impl
->
glDescription
.
target
;
target
=
texttarget
==
GL_TEXTURE_2D
?
GL_TEXTURE_2D
:
GL_TEXTURE_CUBE_MAP_ARB
;
glGetIntegerv
(
texttarget
==
GL_TEXTURE_2D
?
GL_TEXTURE_BINDING_2D
:
GL_TEXTURE_BINDING_CUBE_MAP_ARB
,
&
old_binding
);
if
(
rtimpl
)
{
GLenum
texttarget
,
target
;
GLint
old_binding
=
0
;
IWineD3DSurface_PreLoad
(
surface
);
texttarget
=
rtimpl
->
glDescription
.
target
;
target
=
texttarget
==
GL_TEXTURE_2D
?
GL_TEXTURE_2D
:
GL_TEXTURE_CUBE_MAP_ARB
;
glGetIntegerv
(
texttarget
==
GL_TEXTURE_2D
?
GL_TEXTURE_BINDING_2D
:
GL_TEXTURE_BINDING_CUBE_MAP_ARB
,
&
old_binding
);
glTexParameteri
(
target
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR
)
;
glTexParameteri
(
target
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
)
;
glBindTexture
(
target
,
old_binding
);
IWineD3DSurface_PreLoad
(
render_target
);
GL_EXTCALL
(
glFramebufferTexture2DEXT
(
fbo_target
,
GL_COLOR_ATTACHMENT0_EXT
+
idx
,
texttarget
,
surface_impl
->
glDescription
.
textureName
,
0
)
);
glTexParameteri
(
target
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR
);
glTexParameteri
(
target
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
);
glBindTexture
(
target
,
old_binding
);
checkGLcall
(
"attach_surface_fbo"
);
}
GL_EXTCALL
(
glFramebufferTexture2DEXT
(
GL_FRAMEBUFFER_EXT
,
GL_COLOR_ATTACHMENT0_EXT
+
idx
,
texttarget
,
rtimpl
->
glDescription
.
textureName
,
0
));
checkGLcall
(
"glFramebufferTexture2DEXT()"
);
static
void
set_render_target_fbo
(
IWineD3DDevice
*
iface
,
DWORD
idx
,
IWineD3DSurface
*
render_target
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DSurfaceImpl
*
rtimpl
=
(
IWineD3DSurfaceImpl
*
)
render_target
;
TRACE
(
"Set render target %u to %p
\n
"
,
idx
,
render_target
);
if
(
rtimpl
)
{
attach_surface_fbo
(
This
,
GL_FRAMEBUFFER_EXT
,
idx
,
render_target
);
This
->
draw_buffers
[
idx
]
=
GL_COLOR_ATTACHMENT0_EXT
+
idx
;
}
else
{
GL_EXTCALL
(
glFramebufferTexture2DEXT
(
GL_FRAMEBUFFER_EXT
,
GL_COLOR_ATTACHMENT0_EXT
+
idx
,
GL_TEXTURE_2D
,
0
,
0
));
...
...
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