[PATCH vkd3d v2 4/4] vkd3d-shader: Import the HLSL compiler from Wine.
Henri Verbeet
hverbeet at gmail.com
Tue Jan 26 13:17:35 CST 2021
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().
More information about the wine-devel
mailing list