[PATCH v2 6/6] d3dcompiler: Return an ID3D10Blob from parse_hlsl().
Zebediah Figura
zfigura at codeweavers.com
Thu Jun 11 15:06:01 CDT 2020
On 6/11/20 3:04 PM, Matteo Bruni wrote:
> On Mon, Jun 8, 2020 at 11:50 PM Zebediah Figura <z.figura12 at gmail.com> wrote:
>>
>> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
>> ---
>> dlls/d3dcompiler_43/compiler.c | 49 ++++++-----------------
>> dlls/d3dcompiler_43/d3dcompiler_private.h | 4 +-
>> dlls/d3dcompiler_43/hlsl.l | 14 +++----
>> dlls/d3dcompiler_43/hlsl.y | 10 +++--
>> dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 2 +-
>> 5 files changed, 29 insertions(+), 50 deletions(-)
>>
>> diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c
>> index 9fc7c1d7734..78fb0c46cc0 100644
>> --- a/dlls/d3dcompiler_43/compiler.c
>> +++ b/dlls/d3dcompiler_43/compiler.c
>> @@ -752,12 +752,11 @@ static const struct target_info * get_target_info(const char *target)
>> }
>>
>> static HRESULT compile_shader(const char *preproc_shader, const char *target, const char *entrypoint,
>> - ID3DBlob **shader_blob, ID3DBlob **error_messages)
>> + ID3DBlob **shader, ID3DBlob **error_messages)
>> {
>> - struct bwriter_shader *shader;
>> + DWORD size, major, minor;
>> char *messages = NULL;
>> HRESULT hr;
>> - DWORD *res, size, major, minor;
>> ID3DBlob *buffer;
>> char *pos;
>> enum shader_type shader_type;
>> @@ -787,7 +786,7 @@ static HRESULT compile_shader(const char *preproc_shader, const char *target, co
>> }
>> }
>>
>> - shader = parse_hlsl_shader(preproc_shader, shader_type, major, minor, entrypoint, &messages);
>> + hr = parse_hlsl_shader(preproc_shader, shader_type, major, minor, entrypoint, shader, &messages);
>
> Nothing really new, but it feels a bit awkward that
> parse_hlsl_shader() is supposed to generate the complete shader. I
> think it's just a matter of naming, replacing parse_hlsl_shader() and
> parse_hlsl() with e.g. compile_hlsl_shader() / compile_hlsl() is
> probably all there is to it.
>
Agreed; I'll queue a follow-up patch for that.
More information about the wine-devel
mailing list