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

Zebediah Figura zfigura at codeweavers.com
Tue Sep 29 10:21:09 CDT 2020


On 9/29/20 9:44 AM, Henri Verbeet wrote:
> 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.
> 

Yes, that was probably a copy-paste error.

I'm rather inclined to like the first option better.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200929/7c0b3742/attachment.sig>


More information about the wine-devel mailing list