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
51a81623
Commit
51a81623
authored
Mar 21, 2008
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Mar 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Check pixel formats of the same pixel type.
parent
cd0213bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
13 deletions
+36
-13
directx.c
dlls/wined3d/directx.c
+35
-13
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/directx.c
View file @
51a81623
...
...
@@ -1614,24 +1614,44 @@ static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt(const WineD3D_Pixe
if
(
!
cfg
)
return
FALSE
;
if
(
!
getColorBits
(
Format
,
&
redSize
,
&
greenSize
,
&
blueSize
,
&
alphaSize
,
&
colorBits
))
{
ERR
(
"Unable to check compatibility for Format=%s
\n
"
,
debug_d3dformat
(
Format
));
return
FALSE
;
}
if
(
cfg
->
iPixelType
==
WGL_TYPE_RGBA_ARB
)
{
/* Integer RGBA formats */
if
(
!
getColorBits
(
Format
,
&
redSize
,
&
greenSize
,
&
blueSize
,
&
alphaSize
,
&
colorBits
))
{
ERR
(
"Unable to check compatibility for Format=%s
\n
"
,
debug_d3dformat
(
Format
));
return
FALSE
;
}
if
(
cfg
->
redSize
<
redSize
)
return
FALSE
;
if
(
cfg
->
redSize
<
redSize
)
return
FALSE
;
if
(
cfg
->
greenSize
<
greenSize
)
return
FALSE
;
if
(
cfg
->
greenSize
<
greenSize
)
return
FALSE
;
if
(
cfg
->
blueSize
<
blueSize
)
return
FALSE
;
if
(
cfg
->
blueSize
<
blueSize
)
return
FALSE
;
if
(
cfg
->
alphaSize
<
alphaSize
)
if
(
cfg
->
alphaSize
<
alphaSize
)
return
FALSE
;
return
TRUE
;
}
else
if
(
cfg
->
iPixelType
==
WGL_TYPE_RGBA_FLOAT_ARB
)
{
/* Float RGBA formats; TODO: WGL_NV_float_buffer */
if
(
Format
==
WINED3DFMT_R16F
)
return
(
cfg
->
redSize
==
16
&&
cfg
->
greenSize
==
0
&&
cfg
->
blueSize
==
0
&&
cfg
->
alphaSize
==
0
);
if
(
Format
==
WINED3DFMT_G16R16F
)
return
(
cfg
->
redSize
==
16
&&
cfg
->
greenSize
==
16
&&
cfg
->
blueSize
==
0
&&
cfg
->
alphaSize
==
0
);
if
(
Format
==
WINED3DFMT_A16B16G16R16F
)
return
(
cfg
->
redSize
==
16
&&
cfg
->
greenSize
==
16
&&
cfg
->
blueSize
==
16
&&
cfg
->
alphaSize
==
16
);
if
(
Format
==
WINED3DFMT_R32F
)
return
(
cfg
->
redSize
==
32
&&
cfg
->
greenSize
==
0
&&
cfg
->
blueSize
==
0
&&
cfg
->
alphaSize
==
0
);
if
(
Format
==
WINED3DFMT_G32R32F
)
return
(
cfg
->
redSize
==
32
&&
cfg
->
greenSize
==
32
&&
cfg
->
blueSize
==
0
&&
cfg
->
alphaSize
==
0
);
if
(
Format
==
WINED3DFMT_A32B32G32R32F
)
return
(
cfg
->
redSize
==
32
&&
cfg
->
greenSize
==
32
&&
cfg
->
blueSize
==
32
&&
cfg
->
alphaSize
==
32
);
}
else
{
/* Probably a color index mode */
return
FALSE
;
}
return
TRU
E
;
return
FALS
E
;
}
static
BOOL
IWineD3DImpl_IsPixelFormatCompatibleWithDepthFmt
(
const
WineD3D_PixelFormat
*
cfg
,
WINED3DFORMAT
Format
)
{
...
...
@@ -3882,6 +3902,7 @@ BOOL InitAdapters(void) {
PUSH1
(
WGL_DEPTH_BITS_ARB
)
PUSH1
(
WGL_STENCIL_BITS_ARB
)
PUSH1
(
WGL_DRAW_TO_WINDOW_ARB
)
PUSH1
(
WGL_PIXEL_TYPE_ARB
)
for
(
iPixelFormat
=
1
;
iPixelFormat
<=
Adapters
[
0
].
nCfgs
;
iPixelFormat
++
)
{
res
=
GL_EXTCALL
(
wglGetPixelFormatAttribivARB
(
hdc
,
iPixelFormat
,
0
,
nAttribs
,
attribs
,
values
));
...
...
@@ -3898,6 +3919,7 @@ BOOL InitAdapters(void) {
cfgs
->
depthSize
=
values
[
4
];
cfgs
->
stencilSize
=
values
[
5
];
cfgs
->
windowDrawable
=
values
[
6
];
cfgs
->
iPixelType
=
values
[
7
];
cfgs
->
pbufferDrawable
=
FALSE
;
/* Check for pbuffer support when it is around as wglGetPixelFormatAttribiv fails for unknown
...
...
@@ -3909,7 +3931,7 @@ attributes. */
cfgs
->
pbufferDrawable
=
value
;
}
TRACE
(
"iPixelFormat=%d,
RGBA=%d/%d/%d/%d, depth=%d, stencil=%d, windowDrawable=%d, pbufferDrawable=%d
\n
"
,
cfgs
->
iPixelFormat
,
cfgs
->
redSize
,
cfgs
->
greenSize
,
cfgs
->
blueSize
,
cfgs
->
alphaSize
,
cfgs
->
depthSize
,
cfgs
->
stencilSize
,
cfgs
->
windowDrawable
,
cfgs
->
pbufferDrawable
);
TRACE
(
"iPixelFormat=%d,
iPixelType=%#x, RGBA=%d/%d/%d/%d, depth=%d, stencil=%d, windowDrawable=%d, pbufferDrawable=%d
\n
"
,
cfgs
->
iPixelFormat
,
cfgs
->
iPixelType
,
cfgs
->
redSize
,
cfgs
->
greenSize
,
cfgs
->
blueSize
,
cfgs
->
alphaSize
,
cfgs
->
depthSize
,
cfgs
->
stencilSize
,
cfgs
->
windowDrawable
,
cfgs
->
pbufferDrawable
);
cfgs
++
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
51a81623
...
...
@@ -636,6 +636,7 @@ extern const WINED3DLIGHT WINED3D_default_light;
typedef
struct
WineD3D_PixelFormat
{
int
iPixelFormat
;
/* WGL pixel format */
int
iPixelType
;
/* WGL pixel type e.g. WGL_TYPE_RGBA_ARB, WGL_TYPE_RGBA_FLOAT_ARB or WGL_TYPE_COLORINDEX_ARB */
int
redSize
,
greenSize
,
blueSize
,
alphaSize
;
int
depthSize
,
stencilSize
;
BOOL
windowDrawable
;
...
...
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