Skip to content
Snippets Groups Projects
Commit eb70f1ae authored by Elizabeth Figura's avatar Elizabeth Figura Committed by Alexandre Julliard
Browse files

tests: Add a test for asuint().

parent 3d85d77c
No related branches found
No related tags found
1 merge request!25vkd3d-shader/hlsl: Implement asuint() and completely move init_node() to hlsl.c.
[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);
}
......@@ -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
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment