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
60e0997c
Commit
60e0997c
authored
Jul 10, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Simplify the GLSL sRGB write code.
parent
1b41bafa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
glsl_shader.c
dlls/wined3d/glsl_shader.c
+13
-13
No files found.
dlls/wined3d/glsl_shader.c
View file @
60e0997c
...
@@ -891,11 +891,12 @@ static void shader_generate_glsl_declarations(IWineD3DBaseShader *iface, const s
...
@@ -891,11 +891,12 @@ static void shader_generate_glsl_declarations(IWineD3DBaseShader *iface, const s
extra_constants_needed
++
;
extra_constants_needed
++
;
}
}
if
(
ps_args
->
srgb_correction
)
{
if
(
ps_args
->
srgb_correction
)
shader_addline
(
buffer
,
"const vec4 srgb_mul_low = vec4(%f, %f, %f, %f);
\n
"
,
{
srgb_mul_low
,
srgb_mul_low
,
srgb_mul_low
,
srgb_mul_low
);
shader_addline
(
buffer
,
"const vec4 srgb_const0 = vec4(%.8e, %.8e, %.8e, %.8e);
\n
"
,
shader_addline
(
buffer
,
"const vec4 srgb_comparison = vec4(%f, %f, %f, %f);
\n
"
,
srgb_pow
,
srgb_mul_high
,
srgb_sub_high
,
srgb_mul_low
);
srgb_cmp
,
srgb_cmp
,
srgb_cmp
,
srgb_cmp
);
shader_addline
(
buffer
,
"const vec4 srgb_const1 = vec4(%.8e, 0.0, 0.0, 0.0);
\n
"
,
srgb_cmp
);
}
}
if
(
reg_maps
->
vpos
||
reg_maps
->
usesdsy
)
{
if
(
reg_maps
->
vpos
||
reg_maps
->
usesdsy
)
{
if
(
This
->
baseShader
.
limits
.
constant_float
+
extra_constants_needed
+
1
<
GL_LIMITS
(
pshader_constantsF
))
{
if
(
This
->
baseShader
.
limits
.
constant_float
+
extra_constants_needed
+
1
<
GL_LIMITS
(
pshader_constantsF
))
{
...
@@ -3717,14 +3718,13 @@ static GLuint shader_glsl_generate_pshader(IWineD3DPixelShaderImpl *This, struct
...
@@ -3717,14 +3718,13 @@ static GLuint shader_glsl_generate_pshader(IWineD3DPixelShaderImpl *This, struct
shader_addline
(
buffer
,
"gl_FragData[0] = R0;
\n
"
);
shader_addline
(
buffer
,
"gl_FragData[0] = R0;
\n
"
);
}
}
if
(
args
->
srgb_correction
)
{
if
(
args
->
srgb_correction
)
shader_addline
(
buffer
,
"tmp0.xyz = pow(gl_FragData[0].xyz, vec3(%f, %f, %f)) * vec3(%f, %f, %f) - vec3(%f, %f, %f);
\n
"
,
{
srgb_pow
,
srgb_pow
,
srgb_pow
,
srgb_mul_high
,
srgb_mul_high
,
srgb_mul_high
,
shader_addline
(
buffer
,
"tmp0.xyz = pow(gl_FragData[0].xyz, vec3(srgb_const0.x));
\n
"
);
srgb_sub_high
,
srgb_sub_high
,
srgb_sub_high
);
shader_addline
(
buffer
,
"tmp0.xyz = tmp0.xyz * vec3(srgb_const0.y) - vec3(srgb_const0.z);
\n
"
);
shader_addline
(
buffer
,
"tmp1.xyz = gl_FragData[0].xyz * srgb_mul_low.xyz;
\n
"
);
shader_addline
(
buffer
,
"tmp1.xyz = gl_FragData[0].xyz * vec3(srgb_const0.w);
\n
"
);
shader_addline
(
buffer
,
"gl_FragData[0].x = gl_FragData[0].x < srgb_comparison.x ? tmp1.x : tmp0.x;
\n
"
);
shader_addline
(
buffer
,
"bvec3 srgb_compare = lessThan(gl_FragData[0].xyz, vec3(srgb_const1.x));
\n
"
);
shader_addline
(
buffer
,
"gl_FragData[0].y = gl_FragData[0].y < srgb_comparison.y ? tmp1.y : tmp0.y;
\n
"
);
shader_addline
(
buffer
,
"gl_FragData[0].xyz = mix(tmp0.xyz, tmp1.xyz, vec3(srgb_compare));
\n
"
);
shader_addline
(
buffer
,
"gl_FragData[0].z = gl_FragData[0].z < srgb_comparison.z ? tmp1.z : tmp0.z;
\n
"
);
shader_addline
(
buffer
,
"gl_FragData[0] = clamp(gl_FragData[0], 0.0, 1.0);
\n
"
);
shader_addline
(
buffer
,
"gl_FragData[0] = clamp(gl_FragData[0], 0.0, 1.0);
\n
"
);
}
}
/* Pixel shader < 3.0 do not replace the fog stage.
/* Pixel shader < 3.0 do not replace the fog stage.
...
...
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