[v11 1/4] d3dx9: Implement fxlc constants (expressions) in effect.

Paul Gofman gofmanp at gmail.com
Wed Apr 13 15:47:53 CDT 2016


On 04/13/2016 10:59 PM, Matteo Bruni wrote:
> 2016-04-12 11:34 GMT+02:00 Paul Gofman <gofmanp at gmail.com>:
>
>> @@ -369,12 +410,17 @@ static HRESULT get_constants_desc(unsigned int *byte_code, struct d3dx_const_tab
>>              goto err_out;
>>          }
>>          count = 1;
>> -        hr = ID3DXConstantTable_GetConstantDesc(ctab, hc, &cdesc[i], &count);
>> -        if (FAILED(hr))
>> +        if (FAILED(hr = ID3DXConstantTable_GetConstantDesc(ctab, hc, &cdesc[i], &count)))
>>          {
>>              FIXME("Could not get constant desc, hr %#x.\n", hr);
>>              goto err_out;
>>          }
>> +        if (count != 1)
>> +        {
>> +            FIXME("Unexpected constant descriptors count %u.\n", count);
>> +            hr = D3DERR_INVALIDCALL;
>> +            goto err_out;
>> +        }
> Notice that, since you set count to 1 before calling
> GetConstantDesc(), the only possible results are 0 or 1 and the 0 case
> should be already handled by the "if (FAILED())" branch.
> You might use a temporary array of 3 elements and pass 3 as count,
> then only copy the first element to the destination so the rest of the
> code is unchanged while still giving a chance for the FIXME to
> trigger. Not sure it's worth it though, maybe just adding support for
> multiple descriptors (even only in struct d3dx_const_tab and the
> immediately related code) might be a better plan.
>
I would prefer to keep FIXME (adding a temporary buffer for proper
check) for now if possible, as adding a support to d3dx_const_tab looks
a bit tricky without any working example of this (which in turn requires
the support in ID3DXConstantTable to be tested).





More information about the wine-devel mailing list