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
d2ac521c
Commit
d2ac521c
authored
Nov 20, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 27, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Make SRGB write correction working with 1.x shaders in arb.
parent
02ebbd1f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
pixelshader.c
dlls/wined3d/pixelshader.c
+17
-9
No files found.
dlls/wined3d/pixelshader.c
View file @
d2ac521c
...
...
@@ -414,8 +414,16 @@ static inline VOID IWineD3DPixelShaderImpl_GenerateShader(
shader_addline
(
&
buffer
,
"MAD_SAT TMP_FOG, fragment.fogcoord, state.fog.params.y, state.fog.params.z;
\n
"
);
if
(
This
->
srgb_enabled
)
{
const
char
*
color_reg
;
if
(
This
->
baseShader
.
hex_version
<
WINED3DPS_VERSION
(
2
,
0
))
{
color_reg
=
"R0"
;
}
else
{
color_reg
=
"TMP_COLOR"
;
}
if
(
This
->
baseShader
.
hex_version
<
WINED3DPS_VERSION
(
2
,
0
))
{
shader_addline
(
&
buffer
,
"LRP
TMP_COLOR
.rgb, TMP_FOG.x, R0, state.fog.color;
\n
"
);
shader_addline
(
&
buffer
,
"LRP
R0
.rgb, TMP_FOG.x, R0, state.fog.color;
\n
"
);
shader_addline
(
&
buffer
,
"MOV result.color.a, R0.a;
\n
"
);
}
else
{
shader_addline
(
&
buffer
,
"LRP TMP_COLOR.rgb, TMP_FOG.x, TMP_COLOR, state.fog.color;
\n
"
);
...
...
@@ -424,20 +432,20 @@ static inline VOID IWineD3DPixelShaderImpl_GenerateShader(
/* Perform sRGB write correction. See GLX_EXT_framebuffer_sRGB */
/* Calculate the > 0.0031308 case */
shader_addline
(
&
buffer
,
"POW TMP.x,
TMP_COLOR.x, srgb_pow.x;
\n
"
);
shader_addline
(
&
buffer
,
"POW TMP.y,
TMP_COLOR.y, srgb_pow.y;
\n
"
);
shader_addline
(
&
buffer
,
"POW TMP.z,
TMP_COLOR.z, srgb_pow.z;
\n
"
);
shader_addline
(
&
buffer
,
"POW TMP.x,
%s.x, srgb_pow.x;
\n
"
,
color_reg
);
shader_addline
(
&
buffer
,
"POW TMP.y,
%s.y, srgb_pow.y;
\n
"
,
color_reg
);
shader_addline
(
&
buffer
,
"POW TMP.z,
%s.z, srgb_pow.z;
\n
"
,
color_reg
);
shader_addline
(
&
buffer
,
"MUL TMP, TMP, srgb_mul_hi;
\n
"
);
shader_addline
(
&
buffer
,
"SUB TMP, TMP, srgb_sub_hi;
\n
"
);
/* Calculate the < case */
shader_addline
(
&
buffer
,
"MUL TMP2, srgb_mul_low,
TMP_COLOR;
\n
"
);
shader_addline
(
&
buffer
,
"MUL TMP2, srgb_mul_low,
%s;
\n
"
,
color_reg
);
/* Get 1.0 / 0.0 masks for > 0.0031308 and < 0.0031308 */
shader_addline
(
&
buffer
,
"SLT TA, srgb_comparison,
TMP_COLOR;
\n
"
);
shader_addline
(
&
buffer
,
"SGE TB, srgb_comparison,
TMP_COLOR;
\n
"
);
shader_addline
(
&
buffer
,
"SLT TA, srgb_comparison,
%s;
\n
"
,
color_reg
);
shader_addline
(
&
buffer
,
"SGE TB, srgb_comparison,
%s;
\n
"
,
color_reg
);
/* Store the components > 0.0031308 in the destination */
shader_addline
(
&
buffer
,
"MUL
TMP_COLOR, TMP, TA;
\n
"
);
shader_addline
(
&
buffer
,
"MUL
%s, TMP, TA;
\n
"
,
color_reg
);
/* Add the components that are < 0.0031308 */
shader_addline
(
&
buffer
,
"MAD result.color.xyz, TMP2, TB,
TMP_COLOR;
\n
"
);
shader_addline
(
&
buffer
,
"MAD result.color.xyz, TMP2, TB,
%s;
\n
"
,
color_reg
);
/* [0.0;1.0] clamping. Not needed, this is done implicitly */
}
else
{
if
(
This
->
baseShader
.
hex_version
<
WINED3DPS_VERSION
(
2
,
0
))
{
...
...
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