[PATCH vkd3d v2 4/4] vkd3d-shader: Import the HLSL compiler from Wine.

Zebediah Figura (she/her) zfigura at codeweavers.com
Tue Jan 26 16:21:31 CST 2021


On 1/26/21 1:17 PM, Henri Verbeet wrote:
> On Mon, 25 Jan 2021 at 18:24, Zebediah Figura <zfigura at codeweavers.com> wrote:
>> @@ -126,9 +126,20 @@ libs/vkd3d-shader/preproc.tab.c libs/vkd3d-shader/preproc.tab.h &: libs/vkd3d-sh
>>         @$(MKDIR_P) libs/vkd3d-shader
>>         $(VKD3D_V_BISON)$(BISON) $(YFLAGS) -d -o libs/vkd3d-shader/preproc.tab.c $<
>>
>> -BUILT_SOURCES += libs/vkd3d-shader/preproc.tab.h
>> +libs/vkd3d-shader/hlsl.yy.c: $(srcdir)/libs/vkd3d-shader/hlsl.l
>> +       $(VKD3D_V_FLEX)$(FLEX) $(LFLAGS) -o $@ $<
>> +
>> +libs/vkd3d-shader/hlsl.tab.c libs/vkd3d-shader/hlsl.tab.h &: libs/vkd3d-shader/hlsl.y
>> +       $(VKD3D_V_BISON)$(BISON) $(YFLAGS) -d -o libs/vkd3d-shader/hlsl.tab.c $<
>> +
> Should those have an @$(MKDIR_P) as well?
> 
>> +int hlsl_compile_shader(const char *text, const struct vkd3d_shader_compile_info *compile_info,
>> +        struct vkd3d_shader_code *dxbc, struct vkd3d_shader_message_context *message_context)
>> +{
>> +    const struct vkd3d_shader_hlsl_source_info *hlsl_source_info;
>> +    const struct hlsl_profile_info *profile;
>> +
>> +    if (!(hlsl_source_info = vkd3d_find_struct(compile_info->next, HLSL_SOURCE_INFO)))
>> +    {
>> +        ERR("No HLSL source info given.\n");
>> +        return VKD3D_ERROR_INVALID_ARGUMENT;
>> +    }
>> +
>> +    if (!(profile = get_target_info(hlsl_source_info->profile)))
>> +    {
>> +        FIXME("Unknown compilation target %s.\n", debugstr_a(hlsl_source_info->profile));
>> +        return VKD3D_ERROR_NOT_IMPLEMENTED;
>> +    }
>> +
>> +    vkd3d_shader_dump_shader(profile->type, &compile_info->source);
>> +
> That's fine, but you should probably handle the new shader types
> introduced by this patch in shader_get_type_prefix().
> 


Thanks for catching those; resent with both fixed.

-------------- 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/20210126/52eb968f/attachment.sig>


More information about the wine-devel mailing list