[PATCH vkd3d 4/4] vkd3d-compiler: Default to HLSL as a source format when preprocessing.
Henri Verbeet
hverbeet at gmail.com
Fri Nov 27 07:03:15 CST 2020
On Thu, 26 Nov 2020 at 21:25, Zebediah Figura <zfigura at codeweavers.com> wrote:
> @@ -483,7 +483,8 @@ static bool parse_command_line(int argc, char **argv, struct options *options)
> if (options->print_target_types)
> return true;
>
> - if (!validate_target_type(options->source_type, options->target_type))
> + if (options->source_type != VKD3D_SHADER_SOURCE_NONE && options->target_type != VKD3D_SHADER_TARGET_NONE
> + && !validate_target_type(options->source_type, options->target_type))
Perhaps simply "if (!options.preprocess_only &&
!validate_target_type(...))"? That would require resolving the default
source and target types in parse_command_line(), but that may not be a
bad thing.
> - if (!options.output_filename && get_target_type_info(options.target_type)->is_binary
> - && isatty(fileno(output)))
> + if (!options.output_filename && options.target_type != VKD3D_SHADER_TARGET_NONE
> + && get_target_type_info(options.target_type)->is_binary && isatty(fileno(output)))
> {
> fprintf(stderr, "Output is a tty and output format is binary, exiting.\n"
> "If this is really what you intended, specify the output explicitly.\n");
Perhaps we should test whether the source format is binary here with
-E. Although it may not end up being very useful in practice, I don't
think there's an inherent reason that vkd3d_shader_preprocess()
couldn't be used with binary formats.
More information about the wine-devel
mailing list