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
986f4cb9
Commit
986f4cb9
authored
Nov 08, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a separate function for generating the sRGB write GLSL code.
parent
f6d05fba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
glsl_shader.c
dlls/wined3d/glsl_shader.c
+11
-8
No files found.
dlls/wined3d/glsl_shader.c
View file @
986f4cb9
...
...
@@ -4360,6 +4360,16 @@ static GLhandleARB generate_param_reorder_function(struct wined3d_shader_buffer
return
ret
;
}
static
void
shader_glsl_generate_srgb_write_correction
(
struct
wined3d_shader_buffer
*
buffer
)
{
shader_addline
(
buffer
,
"tmp0.xyz = pow(gl_FragData[0].xyz, vec3(srgb_const0.x));
\n
"
);
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 * vec3(srgb_const0.w);
\n
"
);
shader_addline
(
buffer
,
"bvec3 srgb_compare = lessThan(gl_FragData[0].xyz, vec3(srgb_const1.x));
\n
"
);
shader_addline
(
buffer
,
"gl_FragData[0].xyz = mix(tmp0.xyz, tmp1.xyz, vec3(srgb_compare));
\n
"
);
shader_addline
(
buffer
,
"gl_FragData[0] = clamp(gl_FragData[0], 0.0, 1.0);
\n
"
);
}
static
void
shader_glsl_generate_fog_code
(
struct
wined3d_shader_buffer
*
buffer
,
enum
fogmode
mode
)
{
switch
(
mode
)
...
...
@@ -4457,14 +4467,7 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context
}
if
(
args
->
srgb_correction
)
{
shader_addline
(
buffer
,
"tmp0.xyz = pow(gl_FragData[0].xyz, vec3(srgb_const0.x));
\n
"
);
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 * vec3(srgb_const0.w);
\n
"
);
shader_addline
(
buffer
,
"bvec3 srgb_compare = lessThan(gl_FragData[0].xyz, vec3(srgb_const1.x));
\n
"
);
shader_addline
(
buffer
,
"gl_FragData[0].xyz = mix(tmp0.xyz, tmp1.xyz, vec3(srgb_compare));
\n
"
);
shader_addline
(
buffer
,
"gl_FragData[0] = clamp(gl_FragData[0], 0.0, 1.0);
\n
"
);
}
shader_glsl_generate_srgb_write_correction
(
buffer
);
/* SM < 3 does not replace the fog stage. */
if
(
reg_maps
->
shader_version
.
major
<
3
)
...
...
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