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

Zebediah Figura (she/her) zfigura at codeweavers.com
Fri Nov 27 10:31:05 CST 2020


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:
>> @@ -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.

That seems reasonable, sure.

> 
>> -    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...

[Perhaps we should also add something like
vkd3d_shader_get_supported_preprocessor_types()?]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x0D9D358A07A17840.asc
Type: application/pgp-keys
Size: 1769 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20201127/3a66b558/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20201127/3a66b558/attachment.sig>


More information about the wine-devel mailing list