[PATCH vkd3d 4/4] vkd3d-compiler: Default to HLSL as a source format when preprocessing.

Henri Verbeet hverbeet at gmail.com
Mon Nov 30 07:05:47 CST 2020


On Fri, 27 Nov 2020 at 20:01, Zebediah Figura (she/her)
<zfigura at codeweavers.com> wrote:
> On 11/27/20 7:03 AM, Henri Verbeet wrote:
> > On Thu, 26 Nov 2020 at 21:25, Zebediah Figura <zfigura at codeweavers.com> wrote:
> >> -    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.
> >
> Maybe if it were something like m4, yeah, but the HLSL preprocessor is
> very whitespace-sensitive. Although we could introduce a custom m4-like
> preprocessor for other formats...
>
Sure, we could have different preprocessors for different formats. (Or
even different preprocessors for the same format, if it came to that.)
As far as vkd3d-compiler is concerned though, none of that should
really matter; if "options.preprocess_only" is set, the format of the
output is determined by "options.source_type".

> [Perhaps we should also add something like
> vkd3d_shader_get_supported_preprocessor_types()?]
Possibly, although at least initially we could probably get away with
simply returning a copy of the input for source formats that do not
have an inherent associated preprocessor.



More information about the wine-devel mailing list