tests/shader_runner: Allow probing a single component.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Giovanni Mascellani
2022-05-17 15:45:42 +02:00
committed by Alexandre Julliard
parent 4a9d675c49
commit 6ff6cb4ed2
3 changed files with 62 additions and 45 deletions

View File

@@ -413,7 +413,6 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
{
unsigned int left, top, right, bottom, ulps;
struct resource_readback *rb;
struct vec4 v;
int ret, len;
RECT rect;
@@ -439,17 +438,35 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
fatal_error("Malformed probe arguments '%s'.\n", line);
}
if (!match_string(line, "rgba", &line))
fatal_error("Malformed probe arguments '%s'.\n", line);
ret = sscanf(line, "( %f , %f , %f , %f ) %u", &v.x, &v.y, &v.z, &v.w, &ulps);
if (ret < 4)
fatal_error("Malformed probe arguments '%s'.\n", line);
if (ret < 5)
ulps = 0;
rb = runner->ops->get_rt_readback(runner);
todo_if(runner->is_todo) check_readback_data_vec4(rb, &rect, &v, ulps);
if (match_string(line, "rgba", &line))
{
struct vec4 v;
ret = sscanf(line, "( %f , %f , %f , %f ) %u", &v.x, &v.y, &v.z, &v.w, &ulps);
if (ret < 4)
fatal_error("Malformed probe arguments '%s'.\n", line);
if (ret < 5)
ulps = 0;
todo_if(runner->is_todo) check_readback_data_vec4(rb, &rect, &v, ulps);
}
else if (match_string(line, "r", &line))
{
float expect;
ret = sscanf(line, "( %f ) %u", &expect, &ulps);
if (ret < 1)
fatal_error("Malformed probe arguments '%s'.\n", line);
if (ret < 2)
ulps = 0;
todo_if(runner->is_todo) check_readback_data_float(rb, &rect, expect, ulps);
}
else
{
fatal_error("Malformed probe arguments '%s'.\n", line);
}
runner->ops->release_readback(runner, rb);
}
else if (match_string(line, "uniform", &line))