Lines Matching defs:rs
31 const DWORD *rs)
37 if (rs[D3DRS_ZENABLE]) {
39 dsa.depth_func = d3dcmpfunc_to_pipe_func(rs[D3DRS_ZFUNC]);
41 dsa.depth_writemask = !!rs[D3DRS_ZWRITEENABLE] &&
46 if (rs[D3DRS_STENCILENABLE]) {
48 dsa.stencil[0].func = d3dcmpfunc_to_pipe_func(rs[D3DRS_STENCILFUNC]);
49 dsa.stencil[0].fail_op = d3dstencilop_to_pipe_stencil_op(rs[D3DRS_STENCILFAIL]);
50 dsa.stencil[0].zpass_op = d3dstencilop_to_pipe_stencil_op(rs[D3DRS_STENCILPASS]);
51 dsa.stencil[0].zfail_op = d3dstencilop_to_pipe_stencil_op(rs[D3DRS_STENCILZFAIL]);
52 dsa.stencil[0].valuemask = rs[D3DRS_STENCILMASK];
53 dsa.stencil[0].writemask = rs[D3DRS_STENCILWRITEMASK];
55 if (rs[D3DRS_TWOSIDEDSTENCILMODE]) {
57 dsa.stencil[1].func = d3dcmpfunc_to_pipe_func(rs[D3DRS_CCW_STENCILFUNC]);
58 dsa.stencil[1].fail_op = d3dstencilop_to_pipe_stencil_op(rs[D3DRS_CCW_STENCILFAIL]);
59 dsa.stencil[1].zpass_op = d3dstencilop_to_pipe_stencil_op(rs[D3DRS_CCW_STENCILPASS]);
60 dsa.stencil[1].zfail_op = d3dstencilop_to_pipe_stencil_op(rs[D3DRS_CCW_STENCILZFAIL]);
66 if (rs[D3DRS_ALPHATESTENABLE]) {
68 dsa.alpha_func = d3dcmpfunc_to_pipe_func(rs[D3DRS_ALPHAFUNC]);
69 dsa.alpha_ref_value = (float)rs[D3DRS_ALPHAREF] / 255.0f;
78 const DWORD *rs)
84 rast.flatshade = rs[D3DRS_SHADEMODE] == D3DSHADE_FLAT;
89 rast.cull_face = d3dcull_to_pipe_face(rs[D3DRS_CULLMODE]);
90 rast.fill_front = d3dfillmode_to_pipe_polygon_mode(rs[D3DRS_FILLMODE]);
92 rast.offset_tri = !!(rs[D3DRS_DEPTHBIAS] | rs[D3DRS_SLOPESCALEDEPTHBIAS]);
95 rast.scissor = !!rs[D3DRS_SCISSORTESTENABLE];
101 rast.point_size_per_vertex = rs[NINED3DRS_VSPOINTSIZE];
102 rast.multisample = rs[NINED3DRS_MULTISAMPLE];
103 rast.line_smooth = !!rs[D3DRS_ANTIALIASEDLINEENABLE];
105 rast.line_last_pixel = !!rs[D3DRS_LASTPIXEL];
114 rast.clip_plane_enable = rs[D3DRS_CLIPPLANEENABLE];
117 rast.sprite_coord_enable = rs[D3DRS_POINTSPRITEENABLE] ? 0xff : 0x00;
120 if (rs[NINED3DRS_VSPOINTSIZE]) {
123 rast.point_size = CLAMP(asfloat(rs[D3DRS_POINTSIZE]),
124 asfloat(rs[D3DRS_POINTSIZE_MIN]),
125 asfloat(rs[D3DRS_POINTSIZE_MAX]));
134 rast.offset_units = asfloat(rs[D3DRS_DEPTHBIAS]) * (device->driver_caps.offset_units_unscaled ? 1.0f : (float)(1 << 23));
136 rast.offset_scale = asfloat(rs[D3DRS_SLOPESCALEDEPTHBIAS]);
143 nine_convert_blend_state_fixup(struct pipe_blend_state *blend, const DWORD *rs)
145 if (unlikely(rs[D3DRS_SRCBLEND] == D3DBLEND_BOTHSRCALPHA ||
146 rs[D3DRS_SRCBLEND] == D3DBLEND_BOTHINVSRCALPHA)) {
147 blend->rt[0].rgb_dst_factor = (rs[D3DRS_SRCBLEND] == D3DBLEND_BOTHSRCALPHA) ?
149 if (!rs[D3DRS_SEPARATEALPHABLENDENABLE])
152 if (unlikely(rs[D3DRS_SEPARATEALPHABLENDENABLE] &&
153 (rs[D3DRS_SRCBLENDALPHA] == D3DBLEND_BOTHSRCALPHA ||
154 rs[D3DRS_SRCBLENDALPHA] == D3DBLEND_BOTHINVSRCALPHA))) {
155 blend->rt[0].alpha_dst_factor = (rs[D3DRS_SRCBLENDALPHA] == D3DBLEND_BOTHSRCALPHA) ?
161 nine_convert_blend_state(struct pipe_blend_state *blend_state, const DWORD *rs)
167 blend.dither = !!rs[D3DRS_DITHERENABLE];
170 blend.alpha_to_coverage = !!(rs[NINED3DRS_ALPHACOVERAGE] & 5);
172 blend.rt[0].blend_enable = !!rs[D3DRS_ALPHABLENDENABLE];
174 blend.rt[0].rgb_func = d3dblendop_to_pipe_blend(rs[D3DRS_BLENDOP]);
175 blend.rt[0].rgb_src_factor = d3dblend_color_to_pipe_blendfactor(rs[D3DRS_SRCBLEND]);
176 blend.rt[0].rgb_dst_factor = d3dblend_color_to_pipe_blendfactor(rs[D3DRS_DESTBLEND]);
177 if (rs[D3DRS_SEPARATEALPHABLENDENABLE]) {
178 blend.rt[0].alpha_func = d3dblendop_to_pipe_blend(rs[D3DRS_BLENDOPALPHA]);
179 blend.rt[0].alpha_src_factor = d3dblend_alpha_to_pipe_blendfactor(rs[D3DRS_SRCBLENDALPHA]);
180 blend.rt[0].alpha_dst_factor = d3dblend_alpha_to_pipe_blendfactor(rs[D3DRS_DESTBLENDALPHA]);
184 blend.rt[0].alpha_src_factor = d3dblend_alpha_to_pipe_blendfactor(rs[D3DRS_SRCBLEND]);
185 blend.rt[0].alpha_dst_factor = d3dblend_alpha_to_pipe_blendfactor(rs[D3DRS_DESTBLEND]);
187 nine_convert_blend_state_fixup(&blend, rs); /* for BOTH[INV]SRCALPHA */
191 blend.rt[0].colormask = rs[D3DRS_COLORWRITEENABLE];
193 if (rs[D3DRS_COLORWRITEENABLE1] != rs[D3DRS_COLORWRITEENABLE] ||
194 rs[D3DRS_COLORWRITEENABLE2] != rs[D3DRS_COLORWRITEENABLE] ||
195 rs[D3DRS_COLORWRITEENABLE3] != rs[D3DRS_COLORWRITEENABLE]) {
200 blend.rt[1].colormask = rs[D3DRS_COLORWRITEENABLE1];
201 blend.rt[2].colormask = rs[D3DRS_COLORWRITEENABLE2];
202 blend.rt[3].colormask = rs[D3DRS_COLORWRITEENABLE3];
205 /* blend.force_srgb = !!rs[D3DRS_SRGBWRITEENABLE]; */