| 926 | } |
| 927 | |
| 928 | void encode_stencil(u32 &front, u32 &back) const |
| 929 | { |
| 930 | front = BGFX_STENCIL_NONE; |
| 931 | back = BGFX_STENCIL_NONE; |
| 932 | |
| 933 | if (!_stencil_enable.value()) |
| 934 | return; |
| 935 | |
| 936 | front |= _bgfx_stencil_func_map[_stencil_func.value()]; |
| 937 | front |= BGFX_STENCIL_FUNC_REF(_stencil_ref.value()); |
| 938 | front |= BGFX_STENCIL_FUNC_RMASK(_stencil_mask.value()); |
| 939 | front |= _bgfx_stencil_fail_op_map[_stencil_fail.value()]; |
| 940 | front |= _bgfx_stencil_depth_fail_op_map[_stencil_depth_fail.value()]; |
| 941 | front |= _bgfx_stencil_depth_pass_op_map[_stencil_depth_pass.value()]; |
| 942 | |
| 943 | back |= _bgfx_stencil_func_map[_stencil_func_back.value()]; |
| 944 | back |= BGFX_STENCIL_FUNC_REF(_stencil_ref_back.value()); |
| 945 | back |= BGFX_STENCIL_FUNC_RMASK(_stencil_mask_back.value()); |
| 946 | back |= _bgfx_stencil_fail_op_map[_stencil_fail_back.value()]; |
| 947 | back |= _bgfx_stencil_depth_fail_op_map[_stencil_depth_fail_back.value()]; |
| 948 | back |= _bgfx_stencil_depth_pass_op_map[_stencil_depth_pass_back.value()]; |
| 949 | } |
| 950 | }; |
| 951 | |
| 952 | struct StateIndex |