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
299c1e62
Commit
299c1e62
authored
Dec 19, 2006
by
H. Verbeet
Committed by
Alexandre Julliard
Dec 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Allow the FBO code to handle multiple render targets.
parent
577dbb57
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
5 deletions
+28
-5
device.c
dlls/wined3d/device.c
+25
-5
directx.c
dlls/wined3d/directx.c
+2
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/device.c
View file @
299c1e62
...
...
@@ -574,6 +574,8 @@ static ULONG WINAPI IWineD3DDeviceImpl_Release(IWineD3DDevice *iface) {
HeapFree
(
GetProcessHeap
(),
0
,
This
->
render_targets
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
draw_buffers
);
/* TODO: Clean up all the surfaces and textures! */
/* NOTE: You must release the parent if the object was created via a callback
** ***************************/
...
...
@@ -5794,15 +5796,19 @@ static void set_depth_stencil_fbo(IWineD3DDevice *iface, IWineD3DSurface *depth_
}
}
static
void
set_render_target_fbo
(
IWineD3DDevice
*
iface
,
IWineD3DSurface
*
render_target
)
{
static
void
set_render_target_fbo
(
IWineD3DDevice
*
iface
,
DWORD
idx
,
IWineD3DSurface
*
render_target
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DSurfaceImpl
*
rtimpl
=
(
IWineD3DSurfaceImpl
*
)
render_target
;
if
(
This
->
render_offscreen
)
{
GLenum
texttarget
,
target
;
if
(
idx
>=
GL_LIMITS
(
buffers
))
{
ERR
(
"%p : Trying to set render target %d, but only %d supported
\n
"
,
This
,
idx
,
GL_LIMITS
(
buffers
));
}
bind_fbo
(
iface
);
if
(
rtimpl
)
{
GLenum
texttarget
,
target
;
IWineD3DSurface_PreLoad
(
render_target
);
texttarget
=
rtimpl
->
glDescription
.
target
;
target
=
texttarget
==
GL_TEXTURE_2D
?
GL_TEXTURE_2D
:
GL_TEXTURE_CUBE_MAP_ARB
;
...
...
@@ -5812,9 +5818,23 @@ static void set_render_target_fbo(IWineD3DDevice *iface, IWineD3DSurface *render
glTexParameteri
(
target
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
);
glBindTexture
(
target
,
0
);
GL_EXTCALL
(
glFramebufferTexture2DEXT
(
GL_FRAMEBUFFER_EXT
,
GL_COLOR_ATTACHMENT0_EXT
,
texttarget
,
rtimpl
->
glDescription
.
textureName
,
0
));
GL_EXTCALL
(
glFramebufferTexture2DEXT
(
GL_FRAMEBUFFER_EXT
,
GL_COLOR_ATTACHMENT0_EXT
+
idx
,
texttarget
,
rtimpl
->
glDescription
.
textureName
,
0
));
checkGLcall
(
"glFramebufferTexture2DEXT()"
);
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
));
checkGLcall
(
"glFramebufferTexture2DEXT()"
);
This
->
draw_buffers
[
idx
]
=
GL_NONE
;
}
if
(
GL_SUPPORT
(
ARB_DRAW_BUFFERS
))
{
GL_EXTCALL
(
glDrawBuffersARB
(
GL_LIMITS
(
buffers
),
This
->
draw_buffers
));
checkGLcall
(
"glDrawBuffers()"
);
}
if
(
!
This
->
render_offscreen
)
{
GL_EXTCALL
(
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
0
));
checkGLcall
(
"glBindFramebuffer()"
);
}
...
...
@@ -5878,7 +5898,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface,
if
(
pRenderTarget
)
IWineD3DSurface_AddRef
(
pRenderTarget
);
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
set_render_target_fbo
(
iface
,
pRenderTarget
);
set_render_target_fbo
(
iface
,
RenderTargetIndex
,
pRenderTarget
);
}
}
...
...
dlls/wined3d/directx.c
View file @
299c1e62
...
...
@@ -2450,6 +2450,8 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,
object
->
render_targets
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IWineD3DSurface
*
)
*
GL_LIMITS
(
buffers
));
object
->
draw_buffers
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
GLenum
)
*
GL_LIMITS
(
buffers
));
/* set the state of the device to valid */
object
->
state
=
WINED3D_OK
;
...
...
dlls/wined3d/wined3d_private.h
View file @
299c1e62
...
...
@@ -587,6 +587,7 @@ typedef struct IWineD3DDeviceImpl
BOOL
render_offscreen
;
WINED3D_DEPTHCOPYSTATE
depth_copy_state
;
GLuint
fbo
;
GLenum
*
draw_buffers
;
/* Cursor management */
BOOL
bCursorVisible
;
...
...
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