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
32a32d82
Commit
32a32d82
authored
Mar 17, 2008
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Mar 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Put the SRG read capability check in its own function.
parent
4e66c9c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
26 deletions
+59
-26
directx.c
dlls/wined3d/directx.c
+59
-26
No files found.
dlls/wined3d/directx.c
View file @
32a32d82
...
@@ -1940,6 +1940,35 @@ static BOOL CheckRenderTargetCapability(WINED3DFORMAT AdapterFormat, WINED3DFORM
...
@@ -1940,6 +1940,35 @@ static BOOL CheckRenderTargetCapability(WINED3DFORMAT AdapterFormat, WINED3DFORM
return
FALSE
;
return
FALSE
;
}
}
static
BOOL
CheckSrgbReadCapability
(
UINT
Adapter
,
WINED3DFORMAT
CheckFormat
)
{
/* Check for supported sRGB formats (Texture loading and framebuffer) */
if
(
!
GL_SUPPORT
(
EXT_TEXTURE_SRGB
))
{
TRACE_
(
d3d_caps
)(
"[FAILED] GL_EXT_texture_sRGB not supported
\n
"
);
return
FALSE
;
}
switch
(
CheckFormat
)
{
case
WINED3DFMT_A8R8G8B8
:
case
WINED3DFMT_X8R8G8B8
:
case
WINED3DFMT_A4R4G4B4
:
case
WINED3DFMT_L8
:
case
WINED3DFMT_A8L8
:
case
WINED3DFMT_DXT1
:
case
WINED3DFMT_DXT2
:
case
WINED3DFMT_DXT3
:
case
WINED3DFMT_DXT4
:
case
WINED3DFMT_DXT5
:
TRACE_
(
d3d_caps
)(
"[OK]
\n
"
);
return
TRUE
;
default
:
TRACE_
(
d3d_caps
)(
"[FAILED] Gamma texture format %s not supported.
\n
"
,
debug_d3dformat
(
CheckFormat
));
return
FALSE
;
}
return
FALSE
;
}
/* Check if a texture format is supported on the given adapter */
/* Check if a texture format is supported on the given adapter */
static
BOOL
CheckTextureCapability
(
UINT
Adapter
,
WINED3DFORMAT
CheckFormat
)
static
BOOL
CheckTextureCapability
(
UINT
Adapter
,
WINED3DFORMAT
CheckFormat
)
{
{
...
@@ -2199,6 +2228,16 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
...
@@ -2199,6 +2228,16 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
return
WINED3DERR_NOTAVAILABLE
;
return
WINED3DERR_NOTAVAILABLE
;
}
}
}
}
/* Check QUERY_SRGBREAD support */
if
(
Usage
&
WINED3DUSAGE_QUERY_SRGBREAD
)
{
if
(
CheckSrgbReadCapability
(
Adapter
,
CheckFormat
))
{
UsageCaps
|=
WINED3DUSAGE_QUERY_SRGBREAD
;
}
else
{
TRACE_
(
d3d_caps
)(
"[FAILED] - No query srgbread support
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
}
}
}
}
}
}
}
else
if
(
RType
==
WINED3DRTYPE_SURFACE
)
{
}
else
if
(
RType
==
WINED3DRTYPE_SURFACE
)
{
...
@@ -2261,6 +2300,16 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
...
@@ -2261,6 +2300,16 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
return
WINED3DERR_NOTAVAILABLE
;
return
WINED3DERR_NOTAVAILABLE
;
}
}
}
}
/* Check QUERY_SRGBREAD support */
if
(
Usage
&
WINED3DUSAGE_QUERY_SRGBREAD
)
{
if
(
CheckSrgbReadCapability
(
Adapter
,
CheckFormat
))
{
UsageCaps
|=
WINED3DUSAGE_QUERY_SRGBREAD
;
}
else
{
TRACE_
(
d3d_caps
)(
"[FAILED] - No query srgbread support
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
}
}
}
else
if
(
CheckDepthStencilCapability
(
Adapter
,
AdapterFormat
,
CheckFormat
))
{
}
else
if
(
CheckDepthStencilCapability
(
Adapter
,
AdapterFormat
,
CheckFormat
))
{
if
(
Usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
if
(
Usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
UsageCaps
|=
WINED3DUSAGE_DEPTHSTENCIL
;
UsageCaps
|=
WINED3DUSAGE_DEPTHSTENCIL
;
...
@@ -2272,6 +2321,16 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
...
@@ -2272,6 +2321,16 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
TRACE_
(
d3d_caps
)(
"[FAILED] - Format not supported
\n
"
);
TRACE_
(
d3d_caps
)(
"[FAILED] - Format not supported
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
return
WINED3DERR_NOTAVAILABLE
;
}
}
/* Check QUERY_SRGBREAD support */
if
(
Usage
&
WINED3DUSAGE_QUERY_SRGBREAD
)
{
if
(
CheckSrgbReadCapability
(
Adapter
,
CheckFormat
))
{
UsageCaps
|=
WINED3DUSAGE_QUERY_SRGBREAD
;
}
else
{
TRACE_
(
d3d_caps
)(
"[FAILED] - No query srgbread support
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
}
}
}
}
/* Filter formats that need conversion; For one part, this conversion is unimplemented,
/* Filter formats that need conversion; For one part, this conversion is unimplemented,
...
@@ -2346,32 +2405,6 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
...
@@ -2346,32 +2405,6 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
}
}
}
}
/* Check for supported sRGB formats (Texture loading and framebuffer) */
if
(
Usage
&
WINED3DUSAGE_QUERY_SRGBREAD
)
{
if
(
!
GL_SUPPORT
(
EXT_TEXTURE_SRGB
))
{
TRACE_
(
d3d_caps
)(
"[FAILED] GL_EXT_texture_sRGB not supported
\n
"
);
}
switch
(
CheckFormat
)
{
case
WINED3DFMT_A8R8G8B8
:
case
WINED3DFMT_X8R8G8B8
:
case
WINED3DFMT_A4R4G4B4
:
case
WINED3DFMT_L8
:
case
WINED3DFMT_A8L8
:
case
WINED3DFMT_DXT1
:
case
WINED3DFMT_DXT2
:
case
WINED3DFMT_DXT3
:
case
WINED3DFMT_DXT4
:
case
WINED3DFMT_DXT5
:
TRACE_
(
d3d_caps
)(
"[OK]
\n
"
);
break
;
/* Continue with checking other flags */
default
:
TRACE_
(
d3d_caps
)(
"[FAILED] Gamma texture format %s not supported.
\n
"
,
debug_d3dformat
(
CheckFormat
));
return
WINED3DERR_NOTAVAILABLE
;
}
}
/* This format is nothing special and it is supported perfectly.
/* This format is nothing special and it is supported perfectly.
* However, ati and nvidia driver on windows do not mark this format as
* However, ati and nvidia driver on windows do not mark this format as
* supported (tested with the dxCapsViewer) and pretending to
* supported (tested with the dxCapsViewer) and pretending to
...
...
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