<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>After having gone trough the code a second time. I think the cleanest way to tackle this is that:</div><div>- Keep D3D9 blend factor as is (if D3D9 and D3D11 functions will not be called on the same device, then this is safe)<br></div><div>- Store the blend state, factor, and mask in "OMSetBlendState", and call "wined3d_device_set_blend_state" for storing the state, and emit the CS.</div><div>- 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.<br></div><div><br></div><div>I have a draft patch here attached that works. I need to just write the tests for D3D11<br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">El mar., 9 oct. 2018 a las 23:40, DarkZeros (<<a href="mailto:mailszeros@gmail.com">mailszeros@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi,</div><div><br></div><div>I think the best place is to put it under "wined3d_blend_state", not inside the "wined3d_blend_state_desc".</div><div>And also reuse the CS of the blend state for the blend factor.</div><div>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. <br></div><div><br></div><div>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.</div><div><br></div><div>I will do all the modifications soon and post another patch.</div><div><br></div><div>Cheers.<br></div><div><br></div><div>BR,</div><div>Daniel<br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">El mar., 9 oct. 2018 a las 19:28, Stefan Dösinger (<<a href="mailto:stefandoesinger@gmail.com" target="_blank">stefandoesinger@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Am 2018-10-09 um 16:31 schrieb Henri Verbeet:<br>
> Hi Daniel, thank you for the patch. Unfortunately the blend factor<br>
> should be part of the wined3d_blend_state object<br>
Are you sure this is the way to go? Creating a blend state object for<br>
every possible color combination seems highly inefficient.<br>
<br>
It could work if we add a setter to change the blend factor after<br>
creating a wined3d blend state object, but I don't see an advantage over<br>
Daniel's approach.<br>
</blockquote></div>
</blockquote></div>