[PATCH] wined3d: Refactor blend factor from DWORD to wined3d_color

DarkZeros mailszeros at gmail.com
Wed Oct 10 20:22:00 CDT 2018


After having gone trough the code a second time. I think the cleanest way
to tackle this is that:
- Keep D3D9 blend factor as is (if D3D9 and D3D11 functions will not be
called on the same device, then this is safe)
- Store the blend state, factor, and mask in "OMSetBlendState", and call
"wined3d_device_set_blend_state" for storing the state, and emit the CS.
- In the exec of blend state invalidate the Blend state and blend factor,
calling the appropiate calls. This makes sense since for D3D11 the call
OMSetBlendState does all the state & factor & mask change atomically.

I have a draft patch here attached that works. I need to just write the
tests for D3D11

El mar., 9 oct. 2018 a las 23:40, DarkZeros (<mailszeros at gmail.com>)
escribió:

> Hi,
>
> I think the best place is to put it under "wined3d_blend_state", not
> inside the "wined3d_blend_state_desc".
> And also reuse the CS of the blend state for the blend factor.
> The only thing I am worried about is if we are setting the blend factor
> each time the blend state is changed, even if they are unrelated.
>
> Also this patch as it currently is, is breaking some d3d state tests (just
> the test, the blending works fine), because they will have to be updated to
> check the new state area.
>
> I will do all the modifications soon and post another patch.
>
> Cheers.
>
> BR,
> Daniel
>
> El mar., 9 oct. 2018 a las 19:28, Stefan Dösinger (<
> stefandoesinger at gmail.com>) escribió:
>
>> Hi,
>>
>> Am 2018-10-09 um 16:31 schrieb Henri Verbeet:
>> > Hi Daniel, thank you for the patch. Unfortunately the blend factor
>> > should be part of the wined3d_blend_state object
>> Are you sure this is the way to go? Creating a blend state object for
>> every possible color combination seems highly inefficient.
>>
>> It could work if we add a setter to change the blend factor after
>> creating a wined3d blend state object, but I don't see an advantage over
>> Daniel's approach.
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20181011/1e586503/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-wined3d-Add-blend_factor-to-blend_state.patch
Type: text/x-patch
Size: 14523 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20181011/1e586503/attachment-0001.bin>


More information about the wine-devel mailing list