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
856af1b5
Commit
856af1b5
authored
Mar 21, 2008
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Mar 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add srgb write support to CheckDeviceFormat.
parent
9e9ef623
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
directx.c
dlls/wined3d/directx.c
+50
-0
No files found.
dlls/wined3d/directx.c
View file @
856af1b5
...
...
@@ -2004,6 +2004,26 @@ static BOOL CheckSrgbReadCapability(UINT Adapter, WINED3DFORMAT CheckFormat)
return
FALSE
;
}
static
BOOL
CheckSrgbWriteCapability
(
UINT
Adapter
,
WINED3DDEVTYPE
DeviceType
,
WINED3DFORMAT
CheckFormat
)
{
/* Only offer SRGB writing on X8R8G8B8/A8R8G8B8 when we use ARB or GLSL shaders as we are
* doing the color fixup in shaders.
* Note Windows drivers (at least on the Geforce 8800) also offer this on R5G6B5. */
if
((
CheckFormat
==
WINED3DFMT_X8R8G8B8
)
||
(
CheckFormat
==
WINED3DFMT_X8R8G8B8
))
{
int
vs_selected_mode
;
int
ps_selected_mode
;
select_shader_mode
(
&
GLINFO_LOCATION
,
DeviceType
,
&
ps_selected_mode
,
&
vs_selected_mode
);
if
((
ps_selected_mode
==
SHADER_ARB
)
||
(
ps_selected_mode
==
SHADER_GLSL
))
{
TRACE_
(
d3d_caps
)(
"[OK]
\n
"
);
return
TRUE
;
}
}
TRACE_
(
d3d_caps
)(
"[FAILED] - no SRGB writing support on format=%s
\n
"
,
debug_d3dformat
(
CheckFormat
));
return
FALSE
;
}
/* Check if a texture format is supported on the given adapter */
static
BOOL
CheckTextureCapability
(
UINT
Adapter
,
WINED3DFORMAT
CheckFormat
)
{
...
...
@@ -2301,6 +2321,16 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
}
}
/* Check QUERY_SRGBWRITE support */
if
(
Usage
&
WINED3DUSAGE_QUERY_SRGBWRITE
)
{
if
(
CheckSrgbWriteCapability
(
Adapter
,
DeviceType
,
CheckFormat
))
{
UsageCaps
|=
WINED3DUSAGE_QUERY_SRGBWRITE
;
}
else
{
TRACE_
(
d3d_caps
)(
"[FAILED] - No query srgbwrite support
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
}
}
/* Check QUERY_VERTEXTEXTURE support */
if
(
Usage
&
WINED3DUSAGE_QUERY_VERTEXTEXTURE
)
{
if
(
CheckVertexTextureCapability
(
Adapter
,
CheckFormat
))
{
...
...
@@ -2413,6 +2443,16 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
}
}
/* Check QUERY_SRGBWRITE support */
if
(
Usage
&
WINED3DUSAGE_QUERY_SRGBWRITE
)
{
if
(
CheckSrgbWriteCapability
(
Adapter
,
DeviceType
,
CheckFormat
))
{
UsageCaps
|=
WINED3DUSAGE_QUERY_SRGBWRITE
;
}
else
{
TRACE_
(
d3d_caps
)(
"[FAILED] - No query srgbwrite support
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
}
}
/* Check QUERY_VERTEXTEXTURE support */
if
(
Usage
&
WINED3DUSAGE_QUERY_VERTEXTEXTURE
)
{
if
(
CheckVertexTextureCapability
(
Adapter
,
CheckFormat
))
{
...
...
@@ -2474,6 +2514,16 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
}
}
/* Check QUERY_SRGBWRITE support */
if
(
Usage
&
WINED3DUSAGE_QUERY_SRGBWRITE
)
{
if
(
CheckSrgbWriteCapability
(
Adapter
,
DeviceType
,
CheckFormat
))
{
UsageCaps
|=
WINED3DUSAGE_QUERY_SRGBWRITE
;
}
else
{
TRACE_
(
d3d_caps
)(
"[FAILED] - No query srgbwrite support
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
}
}
/* Check QUERY_VERTEXTEXTURE support */
if
(
Usage
&
WINED3DUSAGE_QUERY_VERTEXTEXTURE
)
{
if
(
CheckVertexTextureCapability
(
Adapter
,
CheckFormat
))
{
...
...
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