[PATCH vkd3d 3/7] vkd3d-utils: Introduce D3DPreprocess().

Henri Verbeet hverbeet at gmail.com
Tue Sep 29 09:44:44 CDT 2020


On Tue, 29 Sep 2020 at 07:11, Zebediah Figura <zfigura at codeweavers.com> wrote:
> +HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename,
> +        const D3D_SHADER_MACRO *macros, ID3DInclude *include,
> +        ID3DBlob **preprocessed_blob, ID3DBlob **messages_blob)
> +{
> +    struct vkd3d_shader_preprocess_info preprocess_info;
> +    struct vkd3d_shader_compile_info compile_info;
> +    struct vkd3d_shader_code preprocessed_code;
> +    const D3D_SHADER_MACRO *macro;
> +    char *messages;
> +    HRESULT hr;
> +    int ret;
> +
> +    TRACE("data %p, size %lu, filename %s, macros %p, include %p, preprocessed_blob %p, messages_blob %p.\n",
> +            data, size, debugstr_a(filename), macros, include, preprocessed_blob, messages_blob);
> +
> +    compile_info.type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO;
> +    compile_info.next = &preprocess_info;
> +    compile_info.source.code = data;
> +    compile_info.source.size = size;
> +    compile_info.source_type = VKD3D_SHADER_SOURCE_HLSL;
> +    compile_info.target_type = VKD3D_SHADER_SOURCE_HLSL;
That's not a valid target type, and will be interpreted as
VKD3D_SHADER_TARGET_SPIRV_TEXT. We should probably just pass
VKD3D_SHADER_TARGET_NONE here and specify "target_type" as ignored for
vkd3d_shader_preprocess(), but it would also be fine to introduce
VKD3D_SHADER_TARGET_HLSL.



More information about the wine-devel mailing list