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
5754726a
Commit
5754726a
authored
Aug 11, 2007
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Aug 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use the proper depth stencil format.
parent
f6260c5b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
12 deletions
+18
-12
context.c
dlls/wined3d/context.c
+14
-8
device.c
dlls/wined3d/device.c
+1
-1
swapchain.c
dlls/wined3d/swapchain.c
+2
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/context.c
View file @
5754726a
...
...
@@ -119,9 +119,10 @@ static WineD3DContext *AddContextToArray(IWineD3DDeviceImpl *This, HWND win_hand
* target: Surface this context will render to
* win_handle: handle to the window which we are drawing to
* create_pbuffer: tells whether to create a pbuffer or not
* pPresentParameters: contains the pixelformats to use for onscreen rendering
*
*****************************************************************************/
WineD3DContext
*
CreateContext
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurfaceImpl
*
target
,
HWND
win_handle
,
BOOL
create_pbuffer
)
{
WineD3DContext
*
CreateContext
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurfaceImpl
*
target
,
HWND
win_handle
,
BOOL
create_pbuffer
,
const
WINED3DPRESENT_PARAMETERS
*
pPresentParms
)
{
HDC
oldDrawable
,
hdc
;
HPBUFFERARB
pbuffer
=
NULL
;
HGLRC
ctx
=
NULL
,
oldCtx
;
...
...
@@ -222,18 +223,23 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
pfd
.
dwFlags
=
PFD_SUPPORT_OPENGL
|
PFD_DOUBLEBUFFER
|
PFD_DRAW_TO_WINDOW
;
/*PFD_GENERIC_ACCELERATED*/
pfd
.
iPixelType
=
PFD_TYPE_RGBA
;
pfd
.
cColorBits
=
32
;
pfd
.
cDepthBits
=
24
;
pfd
.
cStencilBits
=
8
;
pfd
.
cDepthBits
=
0
;
pfd
.
cStencilBits
=
0
;
pfd
.
iLayerType
=
PFD_MAIN_PLANE
;
/* Try to match the colorBits of the d3d format */
if
(
getColorBits
(
target
->
resource
.
format
,
&
red
,
&
green
,
&
blue
,
&
alpha
,
&
colorBits
))
pfd
.
cColorBits
=
colorBits
;
/* TODO: get the depth/stencil format from auto depth stencil format */
if
(
getDepthStencilBits
(
WINED3DFMT_D24S8
,
&
depthBits
,
&
stencilBits
))
{
pfd
.
cDepthBits
=
depthBits
;
pfd
.
cStencilBits
=
stencilBits
;
/* Retrieve the depth stencil format from the present parameters.
* The choice of the proper format can give a nice performance boost
* in case of GPU limited programs. */
if
(
pPresentParms
->
EnableAutoDepthStencil
)
{
TRACE
(
"pPresentParms->EnableAutoDepthStencil=enabled; using AutoDepthStencilFormat=%s
\n
"
,
debug_d3dformat
(
pPresentParms
->
AutoDepthStencilFormat
));
if
(
getDepthStencilBits
(
pPresentParms
->
AutoDepthStencilFormat
,
&
depthBits
,
&
stencilBits
))
{
pfd
.
cDepthBits
=
depthBits
;
pfd
.
cStencilBits
=
stencilBits
;
}
}
iPixelFormat
=
ChoosePixelFormat
(
hdc
,
&
pfd
);
...
...
@@ -696,7 +702,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
*/
This
->
pbufferContext
=
CreateContext
(
This
,
targetimpl
,
((
IWineD3DSwapChainImpl
*
)
This
->
swapchains
[
0
])
->
context
[
0
]
->
win_handle
,
TRUE
/* pbuffer */
);
TRUE
/* pbuffer */
,
&
((
IWineD3DSwapChainImpl
*
)
This
->
swapchains
[
0
])
->
presentParms
);
This
->
pbufferWidth
=
targetimpl
->
currentDesc
.
Width
;
This
->
pbufferHeight
=
targetimpl
->
currentDesc
.
Height
;
}
...
...
dlls/wined3d/device.c
View file @
5754726a
...
...
@@ -1302,7 +1302,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
object
->
num_contexts
=
1
;
ENTER_GL
();
object
->
context
[
0
]
=
CreateContext
(
This
,
(
IWineD3DSurfaceImpl
*
)
object
->
frontBuffer
,
object
->
win_handle
,
FALSE
/* pbuffer */
);
object
->
context
[
0
]
=
CreateContext
(
This
,
(
IWineD3DSurfaceImpl
*
)
object
->
frontBuffer
,
object
->
win_handle
,
FALSE
/* pbuffer */
,
pPresentationParameters
);
LEAVE_GL
();
if
(
!
object
->
context
[
0
])
{
...
...
dlls/wined3d/swapchain.c
View file @
5754726a
...
...
@@ -205,7 +205,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
IWineD3DSurface_UnlockRect
(
This
->
backBuffer
[
0
]);
DestroyContext
(
This
->
wineD3DDevice
,
This
->
context
[
0
]);
This
->
context
[
0
]
=
CreateContext
(
This
->
wineD3DDevice
,
(
IWineD3DSurfaceImpl
*
)
This
->
frontBuffer
,
This
->
win_handle
,
FALSE
/* pbuffer */
);
This
->
context
[
0
]
=
CreateContext
(
This
->
wineD3DDevice
,
(
IWineD3DSurfaceImpl
*
)
This
->
frontBuffer
,
This
->
win_handle
,
FALSE
/* pbuffer */
,
&
This
->
presentParms
);
IWineD3DSurface_LockRect
(
This
->
backBuffer
[
0
],
&
r
,
NULL
,
WINED3DLOCK_DISCARD
);
memcpy
(
r
.
pBits
,
mem
,
r
.
Pitch
*
((
IWineD3DSurfaceImpl
*
)
This
->
backBuffer
[
0
])
->
currentDesc
.
Height
);
...
...
@@ -537,7 +537,7 @@ WineD3DContext *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *
TRACE
(
"Creating a new context for swapchain %p, thread %d
\n
"
,
This
,
GetCurrentThreadId
());
ctx
=
CreateContext
(
This
->
wineD3DDevice
,
(
IWineD3DSurfaceImpl
*
)
This
->
frontBuffer
,
This
->
context
[
0
]
->
win_handle
,
FALSE
/* pbuffer */
);
This
->
context
[
0
]
->
win_handle
,
FALSE
/* pbuffer */
,
&
This
->
presentParms
);
if
(
!
ctx
)
{
ERR
(
"Failed to create a new context for the swapchain
\n
"
);
return
NULL
;
...
...
dlls/wined3d/wined3d_private.h
View file @
5754726a
...
...
@@ -535,7 +535,7 @@ typedef enum ContextUsage {
}
ContextUsage
;
void
ActivateContext
(
IWineD3DDeviceImpl
*
device
,
IWineD3DSurface
*
target
,
ContextUsage
usage
);
WineD3DContext
*
CreateContext
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurfaceImpl
*
target
,
HWND
win
,
BOOL
create_pbuffer
);
WineD3DContext
*
CreateContext
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurfaceImpl
*
target
,
HWND
win
,
BOOL
create_pbuffer
,
const
WINED3DPRESENT_PARAMETERS
*
pPresentParms
);
void
DestroyContext
(
IWineD3DDeviceImpl
*
This
,
WineD3DContext
*
context
);
void
apply_fbo_state
(
IWineD3DDevice
*
iface
);
...
...
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