From: Giovanni Mascellani gmascellani@codeweavers.com
--- tests/vkd3d_shader_stress.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/tests/vkd3d_shader_stress.c b/tests/vkd3d_shader_stress.c index 7e20daa9f..babb6e4a9 100644 --- a/tests/vkd3d_shader_stress.c +++ b/tests/vkd3d_shader_stress.c @@ -30,6 +30,7 @@ VKD3D_DEBUG_ENV_NAME(""); #define READ_SIZE 4096
static bool silent_pass = false; +static bool print_messages = false;
static bool read_shader(const char *path, struct vkd3d_shader_code *code) { @@ -80,8 +81,6 @@ static bool compile_shader(const char *path) struct vkd3d_shader_compile_info compile_info = { .type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO, - /* INFO is used even if messages are not gathered, so that - * they still appear in the trace. */ .log_level = VKD3D_SHADER_LOG_INFO, .source_name = path, }; @@ -91,7 +90,7 @@ static bool compile_shader(const char *path) }; struct vkd3d_shader_code compiled_code; const char *filename, *ext, *profile; - char profile2[64]; + char profile2[64], *messages = NULL; bool ret = false; int res;
@@ -177,7 +176,7 @@ static bool compile_shader(const char *path) if (!read_shader(path, &compile_info.source)) goto out;
- res = vkd3d_shader_compile(&compile_info, &compiled_code, NULL); + res = vkd3d_shader_compile(&compile_info, &compiled_code, &messages);
if (res == VKD3D_OK) { @@ -187,11 +186,18 @@ static bool compile_shader(const char *path)
out: if (!ret) + { printf("FAIL: %s\n", path); + if (print_messages) + printf("%s", messages); + } else if (!silent_pass) + { printf("PASS: %s\n", path); + }
vkd3d_free((void *)compile_info.source.code); + vkd3d_shader_free_messages(messages);
return ret; } @@ -204,6 +210,8 @@ static inline void parse_args(int argc, char *argv[]) { if (!strcmp(argv[i], "--silent-pass")) silent_pass = true; + else if (!strcmp(argv[i], "--print-messages")) + print_messages = true; } }