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
bf250285
Commit
bf250285
authored
Dec 25, 2006
by
H. Verbeet
Committed by
Alexandre Julliard
Dec 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Restore texture bindings in the FBO code.
parent
d6010ede
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
device.c
dlls/wined3d/device.c
+6
-2
drawprim.c
dlls/wined3d/drawprim.c
+7
-0
No files found.
dlls/wined3d/device.c
View file @
bf250285
...
...
@@ -5840,16 +5840,18 @@ static void set_depth_stencil_fbo(IWineD3DDevice *iface, IWineD3DSurface *depth_
if
(
depth_stencil_impl
)
{
GLenum
texttarget
,
target
;
GLint
old_binding
=
0
;
IWineD3DSurface_PreLoad
(
depth_stencil
);
texttarget
=
depth_stencil_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
);
glBindTexture
(
target
,
depth_stencil_impl
->
glDescription
.
textureName
);
glTexParameteri
(
target
,
GL_TEXTURE_MIN_FILTER
,
GL_NEAREST
);
glTexParameteri
(
target
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
glTexParameteri
(
target
,
GL_DEPTH_TEXTURE_MODE_ARB
,
GL_LUMINANCE
);
glBindTexture
(
target
,
0
);
glBindTexture
(
target
,
old_binding
);
GL_EXTCALL
(
glFramebufferTexture2DEXT
(
GL_FRAMEBUFFER_EXT
,
GL_DEPTH_ATTACHMENT_EXT
,
texttarget
,
depth_stencil_impl
->
glDescription
.
textureName
,
0
));
checkGLcall
(
"glFramebufferTexture2DEXT()"
);
...
...
@@ -5876,15 +5878,17 @@ static void set_render_target_fbo(IWineD3DDevice *iface, DWORD idx, IWineD3DSurf
if
(
rtimpl
)
{
GLenum
texttarget
,
target
;
GLint
old_binding
=
0
;
IWineD3DSurface_PreLoad
(
render_target
);
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
);
glBindTexture
(
target
,
rtimpl
->
glDescription
.
textureName
);
glTexParameteri
(
target
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR
);
glTexParameteri
(
target
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
);
glBindTexture
(
target
,
0
);
glBindTexture
(
target
,
old_binding
);
GL_EXTCALL
(
glFramebufferTexture2DEXT
(
GL_FRAMEBUFFER_EXT
,
GL_COLOR_ATTACHMENT0_EXT
+
idx
,
texttarget
,
rtimpl
->
glDescription
.
textureName
,
0
));
checkGLcall
(
"glFramebufferTexture2DEXT()"
);
...
...
dlls/wined3d/drawprim.c
View file @
bf250285
...
...
@@ -1849,6 +1849,7 @@ static void check_fbo_status(IWineD3DDevice *iface) {
static
void
depth_blt
(
IWineD3DDevice
*
iface
,
GLuint
texture
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
GLint
old_binding
=
0
;
glPushAttrib
(
GL_ENABLE_BIT
|
GL_DEPTH_BUFFER_BIT
);
...
...
@@ -1860,6 +1861,7 @@ static void depth_blt(IWineD3DDevice *iface, GLuint texture) {
glDepthFunc
(
GL_ALWAYS
);
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
));
glGetIntegerv
(
GL_TEXTURE_BINDING_2D
,
&
old_binding
);
glBindTexture
(
GL_TEXTURE_2D
,
texture
);
glEnable
(
GL_TEXTURE_2D
);
...
...
@@ -1872,6 +1874,8 @@ static void depth_blt(IWineD3DDevice *iface, GLuint texture) {
glVertex2f
(
1
.
0
f
,
1
.
0
f
);
glEnd
();
glBindTexture
(
GL_TEXTURE_2D
,
old_binding
);
glPopAttrib
();
}
...
...
@@ -1887,6 +1891,7 @@ static void depth_copy(IWineD3DDevice *iface) {
if
(
This
->
render_offscreen
)
{
static
GLuint
tmp_texture
=
0
;
GLint
old_binding
=
0
;
TRACE
(
"Copying onscreen depth buffer to offscreen surface
\n
"
);
...
...
@@ -1897,6 +1902,7 @@ static void depth_copy(IWineD3DDevice *iface) {
/* 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
));
glGetIntegerv
(
GL_TEXTURE_BINDING_2D
,
&
old_binding
);
glBindTexture
(
GL_TEXTURE_2D
,
tmp_texture
);
glCopyTexImage2D
(
depth_stencil
->
glDescription
.
target
,
depth_stencil
->
glDescription
.
level
,
...
...
@@ -1909,6 +1915,7 @@ static void depth_copy(IWineD3DDevice *iface) {
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_NEAREST
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_DEPTH_TEXTURE_MODE_ARB
,
GL_LUMINANCE
);
glBindTexture
(
GL_TEXTURE_2D
,
old_binding
);
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
This
->
fbo
));
checkGLcall
(
"glBindFramebuffer()"
);
...
...
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