Zebediah Figura : vkd3d-compiler: Default to HLSL as a source format when preprocessing.

Alexandre Julliard julliard at winehq.org
Tue Dec 1 15:40:17 CST 2020


Module: vkd3d
Branch: master
Commit: 6d5fd68f1d9dc2bb4c74e41c12f5cba2e9b81e88
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=6d5fd68f1d9dc2bb4c74e41c12f5cba2e9b81e88

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Mon Nov 30 11:16:46 2020 -0600

vkd3d-compiler: Default to HLSL as a source format when preprocessing.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 91c8e04..f1e597a 100644
--- a/programs/vkd3d-compiler/main.c
+++ b/programs/vkd3d-compiler/main.c
@@ -397,8 +397,8 @@ static bool parse_command_line(int argc, char **argv, struct options *options)
     };
 
     memset(options, 0, sizeof(*options));
-    options->source_type = VKD3D_SHADER_SOURCE_DXBC_TPF;
-    options->target_type = VKD3D_SHADER_TARGET_SPIRV_BINARY;
+    options->source_type = VKD3D_SHADER_SOURCE_NONE;
+    options->target_type = VKD3D_SHADER_TARGET_NONE;
     options->formatting = VKD3D_SHADER_COMPILE_OPTION_FORMATTING_INDENT
             | VKD3D_SHADER_COMPILE_OPTION_FORMATTING_HEADER;
 
@@ -483,6 +483,11 @@ static bool parse_command_line(int argc, char **argv, struct options *options)
     if (options->print_target_types)
         return true;
 
+    if (options->source_type == VKD3D_SHADER_SOURCE_NONE)
+        options->source_type = options->preprocess_only ? VKD3D_SHADER_SOURCE_HLSL : VKD3D_SHADER_SOURCE_DXBC_TPF;
+    if (options->target_type == VKD3D_SHADER_TARGET_NONE && !options->preprocess_only)
+        options->target_type = VKD3D_SHADER_TARGET_SPIRV_BINARY;
+
     if (!options->preprocess_only && !validate_target_type(options->source_type, options->target_type))
     {
         fprintf(stderr, "Target type '%s' is invalid for source type '%s'.\n",




More information about the wine-cvs mailing list