Lines Matching refs:blend
142 nine_convert_blend_state_fixup(struct pipe_blend_state *blend, const DWORD *rs) in nine_convert_blend_state_fixup() argument
146 blend->rt[0].rgb_dst_factor = (rs[D3DRS_SRCBLEND] == D3DBLEND_BOTHSRCALPHA) ? in nine_convert_blend_state_fixup()
149 blend->rt[0].alpha_dst_factor = blend->rt[0].rgb_dst_factor; in nine_convert_blend_state_fixup()
154 blend->rt[0].alpha_dst_factor = (rs[D3DRS_SRCBLENDALPHA] == D3DBLEND_BOTHSRCALPHA) ? in nine_convert_blend_state_fixup()
162 struct pipe_blend_state blend; in nine_convert_blend_state() local
164 memset(&blend, 0, sizeof(blend)); /* memcmp safety */ in nine_convert_blend_state()
166 blend.dither = !!rs[D3DRS_DITHERENABLE]; in nine_convert_blend_state()
169 blend.alpha_to_coverage = rs[NINED3DRS_ALPHACOVERAGE] & 1; in nine_convert_blend_state()
171 blend.rt[0].blend_enable = !!rs[D3DRS_ALPHABLENDENABLE]; in nine_convert_blend_state()
172 if (blend.rt[0].blend_enable) { in nine_convert_blend_state()
173 blend.rt[0].rgb_func = d3dblendop_to_pipe_blend(rs[D3DRS_BLENDOP]); in nine_convert_blend_state()
174 blend.rt[0].rgb_src_factor = d3dblend_color_to_pipe_blendfactor(rs[D3DRS_SRCBLEND]); in nine_convert_blend_state()
175 blend.rt[0].rgb_dst_factor = d3dblend_color_to_pipe_blendfactor(rs[D3DRS_DESTBLEND]); in nine_convert_blend_state()
177 blend.rt[0].alpha_func = d3dblendop_to_pipe_blend(rs[D3DRS_BLENDOPALPHA]); in nine_convert_blend_state()
178 … blend.rt[0].alpha_src_factor = d3dblend_alpha_to_pipe_blendfactor(rs[D3DRS_SRCBLENDALPHA]); in nine_convert_blend_state()
179 … blend.rt[0].alpha_dst_factor = d3dblend_alpha_to_pipe_blendfactor(rs[D3DRS_DESTBLENDALPHA]); in nine_convert_blend_state()
182 blend.rt[0].alpha_func = blend.rt[0].rgb_func; in nine_convert_blend_state()
183 blend.rt[0].alpha_src_factor = d3dblend_alpha_to_pipe_blendfactor(rs[D3DRS_SRCBLEND]); in nine_convert_blend_state()
184 blend.rt[0].alpha_dst_factor = d3dblend_alpha_to_pipe_blendfactor(rs[D3DRS_DESTBLEND]); in nine_convert_blend_state()
186 nine_convert_blend_state_fixup(&blend, rs); /* for BOTH[INV]SRCALPHA */ in nine_convert_blend_state()
189 blend.max_rt = 3; /* Upper bound. Could be optimized to fb->nr_cbufs for example */ in nine_convert_blend_state()
190 blend.rt[0].colormask = rs[D3DRS_COLORWRITEENABLE]; in nine_convert_blend_state()
196 blend.independent_blend_enable = TRUE; in nine_convert_blend_state()
198 blend.rt[i] = blend.rt[0]; in nine_convert_blend_state()
199 blend.rt[1].colormask = rs[D3DRS_COLORWRITEENABLE1]; in nine_convert_blend_state()
200 blend.rt[2].colormask = rs[D3DRS_COLORWRITEENABLE2]; in nine_convert_blend_state()
201 blend.rt[3].colormask = rs[D3DRS_COLORWRITEENABLE3]; in nine_convert_blend_state()
206 *blend_state = blend; in nine_convert_blend_state()