Home | History | Annotate | Download | only in llvmpipe

Lines Matching refs:stencil

30  * Depth/stencil testing to LLVM IR translation.
32 * To be done accurately/efficiently the depth/stencil test must be done with
33 * the same type/format of the depth/stencil buffer, which implies massaging
35 * type/format for depth/stencil values internally and only convert when
41 * place (we could avoid this by doing depth/stencil testing in linear format,
42 * which would be easy for late depth/stencil test as we could do that after
81 * Do the stencil test comparison (compare FB stencil values against ref value).
82 * This will be used twice when generating two-sided stencil code.
83 * \param stencil the front/back stencil state
84 * \param stencilRef the stencil reference value, replicated as a vector
85 * \param stencilVals vector of stencil values from framebuffer
90 const struct pipe_stencil_state *stencil,
110 assert(stencil->enabled);
112 if (stencil->valuemask != stencilMax) {
114 LLVMValueRef valuemask = lp_build_const_int_vec(bld->gallivm, type, stencil->valuemask);
120 res = lp_build_cmp(bld, stencil->func, stencilRef, stencilVals);
127 * Do the one or two-sided stencil test comparison.
134 const struct pipe_stencil_state stencil[2],
141 assert(stencil[0].enabled);
144 res = lp_build_stencil_test_single(bld, &stencil[0],
147 if (stencil[1].enabled && front_facing != NULL) {
151 back_res = lp_build_stencil_test_single(bld, &stencil[1],
162 * Apply the stencil operator (add/sub/keep/etc) to the given vector
163 * of stencil values.
164 * \return new stencil values vector
168 const struct pipe_stencil_state *stencil,
184 stencil_op = stencil->fail_op;
187 stencil_op = stencil->zfail_op;
190 stencil_op = stencil->zpass_op;
229 assert(0 && "bad stencil op mode");
238 * Do the one or two-sided stencil test op/update.
242 const struct pipe_stencil_state stencil[2],
253 assert(stencil[0].enabled);
256 res = lp_build_stencil_op_single(bld, &stencil[0], op,
259 if (stencil[1].enabled && front_facing != NULL) {
263 back_res = lp_build_stencil_op_single(bld, &stencil[1], op,
269 if (stencil[0].writemask != 0xff ||
270 (stencil[1].enabled && front_facing != NULL && stencil[1].writemask != 0xff)) {
271 /* mask &= stencil[0].writemask */
273 stencil[0].writemask);
274 if (stencil[1].enabled && stencil[1].writemask != stencil[0].writemask && front_facing != NULL) {
276 stencil[1].writemask);
295 * Return a type that matches the depth/stencil format.
381 * to put the stencil bits in the least significant position.
515 * Load depth/stencil values.
518 * \param type the data type of the fragment depth/stencil values
519 * \param format_desc description of the depth/stencil surface
522 * \param depth_ptr pointer to the depth/stencil values of this 4x4 block
523 * \param depth_stride stride of the depth/stencil buffer
585 /* Load current z/stencil values from z/stencil buffer */
644 * Store depth/stencil values.
648 * \param type the data type of the fragment depth/stencil values
649 * \param format_desc description of the depth/stencil surface
655 * \param depth_ptr pointer to the depth/stencil values of this 4x4 block
656 * \param depth_stride stride of the depth/stencil buffer
658 * \param s_value the stencil values to store (with padding)
801 * Generate code for performing depth and/or stencil tests.
805 * \param stencil the front/back stencil state
806 * \param type the data type of the fragment depth/stencil values
807 * \param format_desc description of the depth/stencil surface
809 * \param stencil_refs the front/back stencil ref values (scalar)
810 * \param z_src the incoming depth/stencil values (n 2x2 quad values, float32)
811 * \param zs_dst the depth/stencil values in framebuffer
817 const struct pipe_stencil_state stencil[2],
858 /* Pick the type matching the depth-stencil format. */
865 /* FIXME: for non-float depth/stencil might generate better code
867 * For stencil we'd almost certainly want to pack to 8xi16 values,
879 assert(depth->enabled || stencil[0].enabled);
885 if (stencil[0].enabled) {
914 /* Setup build context for stencil vals */
918 /* Compute and apply the Z/stencil bitmasks and shifts.
963 if (stencil[0].enabled) {
978 * (Try piglit stencil-twoside.)
1010 s_pass_mask = lp_build_stencil_test(&s_bld, stencil,
1014 /* apply stencil-fail operator */
1017 stencil_vals = lp_build_stencil_op(&s_bld, stencil, S_FAIL_OP,
1064 /* mask off bits that failed stencil test */
1069 if (!stencil[0].enabled) {
1071 * if stencil is disabled because we still need to update the stencil
1093 if (stencil[0].enabled) {
1094 /* update stencil buffer values according to z pass/fail result */
1099 stencil_vals = lp_build_stencil_op(&s_bld, stencil, Z_FAIL_OP,
1105 stencil_vals = lp_build_stencil_op(&s_bld, stencil, Z_PASS_OP,
1111 /* No depth test: apply Z-pass operator to stencil buffer values which
1112 * passed the stencil test.
1115 stencil_vals = lp_build_stencil_op(&s_bld, stencil, Z_PASS_OP,
1120 /* Put Z and stencil bits in the right place */
1129 /* Finally, merge the z/stencil values */
1147 if (depth->enabled && stencil[0].enabled)