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
c9227bcc
Commit
c9227bcc
authored
Jun 15, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement SM4 discard in the GLSL shader backend.
parent
b4b2a29d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
glsl_shader.c
dlls/wined3d/glsl_shader.c
+21
-14
No files found.
dlls/wined3d/glsl_shader.c
View file @
c9227bcc
...
...
@@ -4704,22 +4704,29 @@ static void shader_glsl_texreg2rgb(const struct wined3d_shader_instruction *ins)
* If any of the first 3 components are < 0, discard this pixel */
static
void
shader_glsl_texkill
(
const
struct
wined3d_shader_instruction
*
ins
)
{
struct
glsl_dst_param
dst_param
;
if
(
ins
->
ctx
->
reg_maps
->
shader_version
.
major
>=
4
)
{
struct
glsl_src_param
src_param
;
/* The argument is a destination parameter, and no writemasks are allowed */
shader_glsl_add_dst_param
(
ins
,
&
ins
->
dst
[
0
],
&
dst_param
);
if
(
ins
->
ctx
->
reg_maps
->
shader_version
.
major
>=
2
)
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
0
],
WINED3DSP_WRITEMASK_0
,
&
src_param
);
shader_addline
(
ins
->
ctx
->
buffer
,
"if (bool(floatBitsToUint(%s))) discard;
\n
"
,
src_param
.
param_str
);
}
else
{
if
(
ins
->
ctx
->
reg_maps
->
shader_version
.
major
>=
4
)
FIXME
(
"SM4 discard not implemented.
\n
"
);
/* 2.0 shaders compare all 4 components in texkill */
shader_addline
(
ins
->
ctx
->
buffer
,
"if (any(lessThan(%s.xyzw, vec4(0.0)))) discard;
\n
"
,
dst_param
.
reg_name
);
}
else
{
/* 1.X shaders only compare the first 3 components, probably due to the nature of the texkill
* instruction as a tex* instruction, and phase, which kills all a / w components. Even if all
* 4 components are defined, only the first 3 are used
*/
shader_addline
(
ins
->
ctx
->
buffer
,
"if (any(lessThan(%s.xyz, vec3(0.0)))) discard;
\n
"
,
dst_param
.
reg_name
);
struct
glsl_dst_param
dst_param
;
/* The argument is a destination parameter, and no writemasks are allowed */
shader_glsl_add_dst_param
(
ins
,
&
ins
->
dst
[
0
],
&
dst_param
);
/* 2.0 shaders compare all 4 components in texkill. */
if
(
ins
->
ctx
->
reg_maps
->
shader_version
.
major
>=
2
)
shader_addline
(
ins
->
ctx
->
buffer
,
"if (any(lessThan(%s.xyzw, vec4(0.0)))) discard;
\n
"
,
dst_param
.
reg_name
);
/* 1.x shaders only compare the first 3 components, probably due to
* the nature of the texkill instruction as a tex* instruction, and
* phase, which kills all .w components. Even if all 4 components are
* defined, only the first 3 are used. */
else
shader_addline
(
ins
->
ctx
->
buffer
,
"if (any(lessThan(%s.xyz, vec3(0.0)))) discard;
\n
"
,
dst_param
.
reg_name
);
}
}
...
...
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