From 0bcb8ba3989604c40d47d93f30cb4d3283911376 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 28 Sep 2020 22:41:07 -0500 Subject: [PATCH] vkd3d-compiler: Add the HLSL source type. Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- programs/vkd3d-compiler/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/programs/vkd3d-compiler/main.c b/programs/vkd3d-compiler/main.c index 8480c4f8..a5aff57c 100644 --- a/programs/vkd3d-compiler/main.c +++ b/programs/vkd3d-compiler/main.c @@ -52,12 +52,17 @@ static const struct source_type_info enum vkd3d_shader_source_type type; const char *name; const char *description; + bool is_binary; } source_type_info[] = { {VKD3D_SHADER_SOURCE_DXBC_TPF, "dxbc-tpf", "A 'Tokenized Program Format' shader embedded in a DXBC container.\n" - " This is the format used for Direct3D shader model 4 and 5 shaders.\n"}, + " This is the format used for Direct3D shader model 4 and 5 shaders.\n", + true}, + {VKD3D_SHADER_SOURCE_HLSL, + "hlsl", "High Level Shader Language source code.\n", + false}, }; static const struct target_type_info @@ -594,7 +599,7 @@ int main(int argc, char **argv) if (!(input = open_input(options.filename, &close_input))) goto done; - if (!options.filename && isatty(fileno(input))) + if (!options.filename && get_source_type_info(options.source_type)->is_binary && isatty(fileno(input))) { fprintf(stderr, "Input is a tty and input format is binary, exiting.\n" "If this is really what you intended, specify the input explicitly.\n");