mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
tests: Test casts to float.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
4509f089e5
commit
9d1f9746b7
@ -242,11 +242,38 @@ static void parse_test_directive(struct shader_context *context, const char *lin
|
||||
}
|
||||
memcpy(context->uniforms + offset, &v, sizeof(v));
|
||||
}
|
||||
else if (match_string(line, "float", &line))
|
||||
{
|
||||
float f;
|
||||
|
||||
if (sscanf(line, "%f", &f) < 1)
|
||||
goto err;
|
||||
if (offset + 1 > context->uniform_count)
|
||||
{
|
||||
context->uniform_count = offset + 1;
|
||||
context->uniforms = realloc(context->uniforms, context->uniform_count * sizeof(*context->uniforms));
|
||||
}
|
||||
memcpy(context->uniforms + offset, &f, sizeof(f));
|
||||
}
|
||||
else if (match_string(line, "int", &line))
|
||||
{
|
||||
int i;
|
||||
|
||||
if (sscanf(line, "%i", &i) < 1)
|
||||
goto err;
|
||||
if (offset + 1 > context->uniform_count)
|
||||
{
|
||||
context->uniform_count = offset + 1;
|
||||
context->uniforms = realloc(context->uniforms, context->uniform_count * sizeof(*context->uniforms));
|
||||
}
|
||||
memcpy(context->uniforms + offset, &i, sizeof(i));
|
||||
}
|
||||
else if (match_string(line, "uint", &line))
|
||||
{
|
||||
unsigned int u;
|
||||
|
||||
sscanf(line, "%u", &u);
|
||||
if (sscanf(line, "%u", &u) < 1)
|
||||
goto err;
|
||||
if (offset + 1 > context->uniform_count)
|
||||
{
|
||||
context->uniform_count = offset + 1;
|
||||
|
Reference in New Issue
Block a user