Re: [PATCH 1/2] d3d11: Make blend_factor optional in d3d11_immediate_context_OMSetBlendState(). (try 2)
On 23 November 2015 at 11:14, Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> wrote:
static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11DeviceContext *iface, - ID3D11BlendState *blend_state, const FLOAT blend_factor[4], UINT sample_mask) + ID3D11BlendState *blend_state, const FLOAT arg_blend_factor[4], UINT sample_mask) { struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + static const FLOAT default_blend_factor[4] = {1.0f, 1.0f, 1.0f, 1.0f}; Please just use "float". (Yeah, there are a couple of other places in d3d11 that use "FLOAT", but it's silly.)
+ const FLOAT *blend_factor; ... + blend_factor = arg_blend_factor ? arg_blend_factor : default_blend_factor; You don't need this. You can just do: if (!blend_factor) blend_factor = default_blend_factor;
participants (1)
-
Henri Verbeet