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
8355b1a5
Commit
8355b1a5
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 device to store multiple render targets.
parent
1698c44e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
42 deletions
+46
-42
device.c
dlls/wined3d/device.c
+31
-29
directx.c
dlls/wined3d/directx.c
+5
-3
surface.c
dlls/wined3d/surface.c
+8
-8
swapchain.c
dlls/wined3d/swapchain.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/device.c
View file @
8355b1a5
This diff is collapsed.
Click to expand it.
dlls/wined3d/directx.c
View file @
8355b1a5
...
...
@@ -2448,6 +2448,8 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,
if
(
WINED3D_OK
!=
temp_result
)
return
temp_result
;
object
->
render_targets
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IWineD3DSurface
*
)
*
GL_LIMITS
(
buffers
));
/* set the state of the device to valid */
object
->
state
=
WINED3D_OK
;
...
...
@@ -2472,9 +2474,9 @@ create_device_error:
IWineD3DStateBlock_Release
((
IWineD3DStateBlock
*
)
object
->
stateBlock
);
object
->
stateBlock
=
NULL
;
}
if
(
object
->
render
Target
!=
NULL
)
{
IWineD3DSurface_Release
(
object
->
render
Target
);
object
->
render
Target
=
NULL
;
if
(
object
->
render
_targets
[
0
]
!=
NULL
)
{
IWineD3DSurface_Release
(
object
->
render
_targets
[
0
]
);
object
->
render
_targets
[
0
]
=
NULL
;
}
if
(
object
->
stencilBufferTarget
!=
NULL
)
{
IWineD3DSurface_Release
(
object
->
stencilBufferTarget
);
...
...
dlls/wined3d/surface.c
View file @
8355b1a5
...
...
@@ -545,7 +545,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
if
(
This
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
{
IWineD3DSurface_GetContainer
(
iface
,
&
IID_IWineD3DSwapChain
,
(
void
**
)
&
swapchain
);
if
(
swapchain
!=
NULL
||
iface
==
myDevice
->
render
Target
||
iface
==
myDevice
->
depthStencilBuffer
)
{
if
(
swapchain
!=
NULL
||
iface
==
myDevice
->
render
_targets
[
0
]
||
iface
==
myDevice
->
depthStencilBuffer
)
{
if
(
swapchain
!=
NULL
)
{
int
i
;
for
(
i
=
0
;
i
<
swapchain
->
presentParms
.
BackBufferCount
;
i
++
)
{
...
...
@@ -559,7 +559,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
TRACE
(
"(%p, backBuffer) : rect@%p flags(%08x), output lockedRect@%p, memory@%p
\n
"
,
This
,
pRect
,
Flags
,
pLockedRect
,
This
->
resource
.
allocatedMemory
);
}
else
if
(
swapchain
!=
NULL
&&
iface
==
swapchain
->
frontBuffer
)
{
TRACE
(
"(%p, frontBuffer) : rect@%p flags(%08x), output lockedRect@%p, memory@%p
\n
"
,
This
,
pRect
,
Flags
,
pLockedRect
,
This
->
resource
.
allocatedMemory
);
}
else
if
(
iface
==
myDevice
->
render
Target
)
{
}
else
if
(
iface
==
myDevice
->
render
_targets
[
0
]
)
{
TRACE
(
"(%p, renderTarget) : rect@%p flags(%08x), output lockedRect@%p, memory@%p
\n
"
,
This
,
pRect
,
Flags
,
pLockedRect
,
This
->
resource
.
allocatedMemory
);
}
else
if
(
iface
==
myDevice
->
depthStencilBuffer
)
{
TRACE
(
"(%p, stencilBuffer) : rect@%p flags(%08x), output lockedRect@%p, memory@%p
\n
"
,
This
,
pRect
,
Flags
,
pLockedRect
,
This
->
resource
.
allocatedMemory
);
...
...
@@ -689,15 +689,15 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
if not, we need to switch contexts and then switchback at the end.
*/
IWineD3DSurface_GetContainer
(
iface
,
&
IID_IWineD3DSwapChain
,
(
void
**
)
&
swapchain
);
IWineD3DSurface_GetContainer
(
myDevice
->
render
Target
,
&
IID_IWineD3DSwapChain
,
(
void
**
)
&
targetSwapChain
);
IWineD3DSurface_GetContainer
(
myDevice
->
render
_targets
[
0
]
,
&
IID_IWineD3DSwapChain
,
(
void
**
)
&
targetSwapChain
);
/* NOTE: In a shared context environment the renderTarget will use the same context as the implicit swapchain (we're not in a shared environment yet! */
if
((
swapchain
==
targetSwapChain
&&
targetSwapChain
!=
NULL
)
||
iface
==
myDevice
->
render
Target
)
{
if
((
swapchain
==
targetSwapChain
&&
targetSwapChain
!=
NULL
)
||
iface
==
myDevice
->
render
_targets
[
0
]
)
{
if
(
swapchain
&&
iface
==
swapchain
->
frontBuffer
)
{
TRACE
(
"locking front
\n
"
);
glReadBuffer
(
GL_FRONT
);
}
else
if
(
iface
==
myDevice
->
render
Target
||
backbuf
)
{
else
if
(
iface
==
myDevice
->
render
_targets
[
0
]
||
backbuf
)
{
TRACE
(
"locking back buffer
\n
"
);
glReadBuffer
(
GL_BACK
);
}
else
if
(
iface
==
myDevice
->
depthStencilBuffer
)
{
...
...
@@ -1102,7 +1102,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
buffername
=
"frontBuffer"
;
}
else
if
(
iface
==
myDevice
->
depthStencilBuffer
)
{
buffername
=
"depthStencilBuffer"
;
}
else
if
(
iface
==
myDevice
->
render
Target
)
{
}
else
if
(
iface
==
myDevice
->
render
_targets
[
0
]
)
{
buffername
=
"renderTarget"
;
}
}
...
...
@@ -1134,7 +1134,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
IWineD3DSwapChainImpl
*
implSwapChain
;
IWineD3DDevice_GetSwapChain
((
IWineD3DDevice
*
)
myDevice
,
0
,
(
IWineD3DSwapChain
**
)
&
implSwapChain
);
if
(
backbuf
||
iface
==
implSwapChain
->
frontBuffer
||
iface
==
myDevice
->
render
Target
)
{
if
(
backbuf
||
iface
==
implSwapChain
->
frontBuffer
||
iface
==
myDevice
->
render
_targets
[
0
]
)
{
int
tex
;
ENTER_GL
();
...
...
@@ -1147,7 +1147,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
if
(
iface
==
implSwapChain
->
frontBuffer
)
{
glDrawBuffer
(
GL_FRONT
);
checkGLcall
(
"glDrawBuffer GL_FRONT"
);
}
else
if
(
backbuf
||
iface
==
myDevice
->
render
Target
)
{
}
else
if
(
backbuf
||
iface
==
myDevice
->
render
_targets
[
0
]
)
{
glDrawBuffer
(
GL_BACK
);
checkGLcall
(
"glDrawBuffer GL_BACK"
);
}
...
...
dlls/wined3d/swapchain.c
View file @
8355b1a5
...
...
@@ -279,7 +279,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
checkGLcall
(
"glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);"
);
/* If this swapchain is currently the active context then make this swapchain active */
if
(
IWineD3DSurface_GetContainer
(
This
->
wineD3DDevice
->
render
Target
,
&
IID_IWineD3DSwapChain
,
(
void
**
)
&
tmp
)
==
WINED3D_OK
){
if
(
IWineD3DSurface_GetContainer
(
This
->
wineD3DDevice
->
render
_targets
[
0
]
,
&
IID_IWineD3DSwapChain
,
(
void
**
)
&
tmp
)
==
WINED3D_OK
){
if
(
tmp
!=
(
IUnknown
*
)
This
){
glXMakeCurrent
(
This
->
display
,
currentDrawable
,
currentContext
);
checkGLcall
(
"glXMakeCurrent"
);
...
...
dlls/wined3d/wined3d_private.h
View file @
8355b1a5
...
...
@@ -574,9 +574,9 @@ typedef struct IWineD3DDeviceImpl
ResourceList
*
resources
;
/* a linked list to track resources created by the device */
/* Render Target Support */
IWineD3DSurface
**
render_targets
;
IWineD3DSurface
*
depthStencilBuffer
;
IWineD3DSurface
*
renderTarget
;
IWineD3DSurface
*
stencilBufferTarget
;
/* palettes texture management */
...
...
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