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
000eab87
Commit
000eab87
authored
Aug 19, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store the sRGB constants as wined3d_vec4 structures.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f193979a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
17 deletions
+19
-17
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+4
-4
glsl_shader.c
dlls/wined3d/glsl_shader.c
+4
-4
shader.c
dlls/wined3d/shader.c
+7
-4
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-5
No files found.
dlls/wined3d/arb_program_shader.c
View file @
000eab87
...
...
@@ -3668,10 +3668,10 @@ static GLuint shader_arb_generate_pshader(const struct wined3d_shader *shader,
if
(
args
->
super
.
srgb_correction
)
{
shader_addline
(
buffer
,
"PARAM srgb_consts0 = "
);
shader_arb_append_imm_vec4
(
buffer
,
wined3d_srgb_const0
);
shader_arb_append_imm_vec4
(
buffer
,
&
wined3d_srgb_const
[
0
].
x
);
shader_addline
(
buffer
,
";
\n
"
);
shader_addline
(
buffer
,
"PARAM srgb_consts1 = "
);
shader_arb_append_imm_vec4
(
buffer
,
wined3d_srgb_const1
);
shader_arb_append_imm_vec4
(
buffer
,
&
wined3d_srgb_const
[
1
].
x
);
shader_addline
(
buffer
,
";
\n
"
);
}
...
...
@@ -6371,10 +6371,10 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, con
if
(
settings
->
sRGB_write
)
{
shader_addline
(
&
buffer
,
"PARAM srgb_consts0 = "
);
shader_arb_append_imm_vec4
(
&
buffer
,
wined3d_srgb_const0
);
shader_arb_append_imm_vec4
(
&
buffer
,
&
wined3d_srgb_const
[
0
].
x
);
shader_addline
(
&
buffer
,
";
\n
"
);
shader_addline
(
&
buffer
,
"PARAM srgb_consts1 = "
);
shader_arb_append_imm_vec4
(
&
buffer
,
wined3d_srgb_const1
);
shader_arb_append_imm_vec4
(
&
buffer
,
&
wined3d_srgb_const
[
1
].
x
);
shader_addline
(
&
buffer
,
";
\n
"
);
}
...
...
dlls/wined3d/glsl_shader.c
View file @
000eab87
...
...
@@ -7701,10 +7701,10 @@ static GLuint shader_glsl_generate_fragment_shader(const struct wined3d_context_
if
(
args
->
srgb_correction
)
{
shader_addline
(
buffer
,
"const vec4 srgb_const0 = "
);
shader_glsl_append_imm_vec
(
buffer
,
wined3d_srgb_const0
,
4
,
gl_info
);
shader_glsl_append_imm_vec
(
buffer
,
&
wined3d_srgb_const
[
0
].
x
,
4
,
gl_info
);
shader_addline
(
buffer
,
";
\n
"
);
shader_addline
(
buffer
,
"const vec4 srgb_const1 = "
);
shader_glsl_append_imm_vec
(
buffer
,
wined3d_srgb_const1
,
4
,
gl_info
);
shader_glsl_append_imm_vec
(
buffer
,
&
wined3d_srgb_const
[
1
].
x
,
4
,
gl_info
);
shader_addline
(
buffer
,
";
\n
"
);
}
if
(
reg_maps
->
vpos
||
reg_maps
->
usesdsy
)
...
...
@@ -9555,10 +9555,10 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
if
(
settings
->
sRGB_write
)
{
shader_addline
(
buffer
,
"const vec4 srgb_const0 = "
);
shader_glsl_append_imm_vec
(
buffer
,
wined3d_srgb_const0
,
4
,
gl_info
);
shader_glsl_append_imm_vec
(
buffer
,
&
wined3d_srgb_const
[
0
].
x
,
4
,
gl_info
);
shader_addline
(
buffer
,
";
\n
"
);
shader_addline
(
buffer
,
"const vec4 srgb_const1 = "
);
shader_glsl_append_imm_vec
(
buffer
,
wined3d_srgb_const1
,
4
,
gl_info
);
shader_glsl_append_imm_vec
(
buffer
,
&
wined3d_srgb_const
[
1
].
x
,
4
,
gl_info
);
shader_addline
(
buffer
,
";
\n
"
);
}
...
...
dlls/wined3d/shader.c
View file @
000eab87
...
...
@@ -32,10 +32,13 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d_shader
);
/* pow, mul_high, sub_high, mul_low */
const
float
wined3d_srgb_const0
[]
=
{
0
.
41666
f
,
1
.
055
f
,
0
.
055
f
,
12
.
92
f
};
/* cmp */
const
float
wined3d_srgb_const1
[]
=
{
0
.
003130
8
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
const
struct
wined3d_vec4
wined3d_srgb_const
[]
=
{
/* pow, mul_high, sub_high, mul_low */
{
0
.
41666
f
,
1
.
055
f
,
0
.
055
f
,
12
.
92
f
},
/* cmp */
{
0
.
003130
8
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
};
static
const
char
*
const
shader_opcode_names
[]
=
{
...
...
dlls/wined3d/wined3d_private.h
View file @
000eab87
...
...
@@ -1482,17 +1482,16 @@ static inline void wined3d_color_from_d3dcolor(struct wined3d_color *wined3d_col
wined3d_color
->
a
=
D3DCOLOR_B_A
(
d3d_color
)
/
255
.
0
f
;
}
extern
const
float
wined3d_srgb_const0
[]
DECLSPEC_HIDDEN
;
extern
const
float
wined3d_srgb_const1
[]
DECLSPEC_HIDDEN
;
extern
const
struct
wined3d_vec4
wined3d_srgb_const
[]
DECLSPEC_HIDDEN
;
static
inline
float
wined3d_srgb_from_linear
(
float
colour
)
{
if
(
colour
<
0
.
0
f
)
return
0
.
0
f
;
if
(
colour
<
wined3d_srgb_const
1
[
0
]
)
return
colour
*
wined3d_srgb_const
0
[
3
]
;
if
(
colour
<
wined3d_srgb_const
[
1
].
x
)
return
colour
*
wined3d_srgb_const
[
0
].
w
;
if
(
colour
<
1
.
0
f
)
return
wined3d_srgb_const
0
[
1
]
*
powf
(
colour
,
wined3d_srgb_const0
[
0
])
-
wined3d_srgb_const0
[
2
]
;
return
wined3d_srgb_const
[
0
].
y
*
powf
(
colour
,
wined3d_srgb_const
[
0
].
x
)
-
wined3d_srgb_const
[
0
].
z
;
return
1
.
0
f
;
}
...
...
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