Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
vkd3d
Manage
Activity
Members
Labels
Plan
Wiki
Bugzilla
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wine
vkd3d
Commits
eb70f1ae
Commit
eb70f1ae
authored
2 years ago
by
Elizabeth Figura
Committed by
Alexandre Julliard
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
tests: Add a test for asuint().
parent
3d85d77c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!25
vkd3d-shader/hlsl: Implement asuint() and completely move init_node() to hlsl.c.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/asuint.shader_test
+55
-0
55 additions, 0 deletions
tests/asuint.shader_test
tests/shader_runner.c
+8
-4
8 additions, 4 deletions
tests/shader_runner.c
with
63 additions
and
4 deletions
tests/asuint.shader_test
0 → 100644
+
55
−
0
View file @
eb70f1ae
[require]
shader model >= 4.0
[pixel shader]
float4 main(uniform float f, uniform int i, uniform uint u, uniform half h) : sv_target
{
uint4 ret;
ret.x = asuint(f);
ret.y = asuint(i);
ret.z = asuint(u);
ret.w = asuint(h);
return ret;
}
[test]
uniform 0 uint4 123 0xc0000000 456 0x7fd69345
todo draw quad
probe (320,240) rgba (123.0, 3221225472.0, 456.0, 2144768896.0)
[pixel shader]
float4 main(uniform float2x2 m, uniform float4 v) : sv_target
{
return float4(asuint(m)[0][1], asuint(v).y, 0, 0);
}
[test]
uniform 0 uint4 11 12 0 0
uniform 4 uint4 13 14 0 0
uniform 8 uint4 20 21 22 23
todo draw quad
probe (320,240) rgba (13.0, 21.0, 0.0, 0.0)
[pixel shader fail]
float4 main() : sv_target
{
bool b = true;
return asuint(b);
}
[pixel shader fail]
float4 main() : sv_target
{
double d = 1.0;
return asuint(b);
}
This diff is collapsed.
Click to expand it.
tests/shader_runner.c
+
8
−
4
View file @
eb70f1ae
...
...
@@ -557,7 +557,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
unsigned
int
offset
;
if
(
!
sscanf
(
line
,
"%u"
,
&
offset
))
fatal_error
(
"
Unknown
uniform
type
'%s'.
\n
"
,
line
);
fatal_error
(
"
Malformed
uniform
offset
'%s'.
\n
"
,
line
);
line
=
strchr
(
line
,
' '
)
+
1
;
if
(
match_string
(
line
,
"float4"
,
&
line
))
...
...
@@ -576,12 +576,12 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
fatal_error
(
"Malformed float constant '%s'.
\n
"
,
line
);
set_uniforms
(
runner
,
offset
,
1
,
&
f
);
}
else
if
(
match_string
(
line
,
"int4"
,
&
line
))
else
if
(
match_string
(
line
,
"int4"
,
&
line
)
||
match_string
(
line
,
"uint4"
,
&
line
))
{
int
v
[
4
];
if
(
sscanf
(
line
,
"%
d
%
d
%
d
%
d
"
,
&
v
[
0
],
&
v
[
1
],
&
v
[
2
],
&
v
[
3
])
<
4
)
fatal_error
(
"Malformed int4 constant '%s'.
\n
"
,
line
);
if
(
sscanf
(
line
,
"%
i
%
i
%
i
%
i
"
,
&
v
[
0
],
&
v
[
1
],
&
v
[
2
],
&
v
[
3
])
<
4
)
fatal_error
(
"Malformed
(u)
int4 constant '%s'.
\n
"
,
line
);
set_uniforms
(
runner
,
offset
,
4
,
v
);
}
else
if
(
match_string
(
line
,
"int"
,
&
line
))
...
...
@@ -600,6 +600,10 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
fatal_error
(
"Malformed uint constant '%s'.
\n
"
,
line
);
set_uniforms
(
runner
,
offset
,
1
,
&
u
);
}
else
{
fatal_error
(
"Unknown uniform type '%s'.
\n
"
,
line
);
}
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment