*/
switch (state->func) {
case PIPE_FUNC_EQUAL:
- if (state->value_mask == stencil_max_value) {
+ if (state->valuemask == stencil_max_value) {
/* stencil_pass = fragment_mask & (s == reference) */
spe_compare_equal_uint(f, stencil_pass_reg, fbS_reg, state->ref_value);
spe_and(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
else {
/* stencil_pass = fragment_mask & ((s&mask) == (reference&mask)) */
uint tmp_masked_stencil = spe_allocate_available_register(f);
- spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->value_mask);
+ spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->valuemask);
spe_compare_equal_uint(f, stencil_pass_reg, tmp_masked_stencil,
- state->value_mask & state->ref_value);
+ state->valuemask & state->ref_value);
spe_and(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
spe_release_register(f, tmp_masked_stencil);
}
break;
case PIPE_FUNC_NOTEQUAL:
- if (state->value_mask == stencil_max_value) {
+ if (state->valuemask == stencil_max_value) {
/* stencil_pass = fragment_mask & ~(s == reference) */
spe_compare_equal_uint(f, stencil_pass_reg, fbS_reg, state->ref_value);
spe_andc(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
else {
/* stencil_pass = fragment_mask & ~((s&mask) == (reference&mask)) */
int tmp_masked_stencil = spe_allocate_available_register(f);
- spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->value_mask);
+ spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->valuemask);
spe_compare_equal_uint(f, stencil_pass_reg, tmp_masked_stencil,
- state->value_mask & state->ref_value);
+ state->valuemask & state->ref_value);
spe_andc(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
spe_release_register(f, tmp_masked_stencil);
}
break;
case PIPE_FUNC_LESS:
- if (state->value_mask == stencil_max_value) {
+ if (state->valuemask == stencil_max_value) {
/* stencil_pass = fragment_mask & (reference < s) */
spe_compare_greater_uint(f, stencil_pass_reg, fbS_reg, state->ref_value);
spe_and(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
else {
/* stencil_pass = fragment_mask & ((reference&mask) < (s & mask)) */
int tmp_masked_stencil = spe_allocate_available_register(f);
- spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->value_mask);
+ spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->valuemask);
spe_compare_greater_uint(f, stencil_pass_reg, tmp_masked_stencil,
- state->value_mask & state->ref_value);
+ state->valuemask & state->ref_value);
spe_and(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
spe_release_register(f, tmp_masked_stencil);
}
break;
case PIPE_FUNC_GREATER:
- if (state->value_mask == stencil_max_value) {
+ if (state->valuemask == stencil_max_value) {
/* stencil_pass = fragment_mask & (reference > s) */
/* There's no convenient Compare Less Than Immediate instruction, so
* we'll have to do this one the harder way, by loading a register and
/* stencil_pass = fragment_mask & ((reference&mask) > (s&mask)) */
int tmp_reg = spe_allocate_available_register(f);
int tmp_masked_stencil = spe_allocate_available_register(f);
- spe_load_uint(f, tmp_reg, state->value_mask & state->ref_value);
- spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->value_mask);
+ spe_load_uint(f, tmp_reg, state->valuemask & state->ref_value);
+ spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->valuemask);
spe_clgt(f, stencil_pass_reg, tmp_reg, tmp_masked_stencil);
spe_and(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
spe_release_register(f, tmp_reg);
break;
case PIPE_FUNC_GEQUAL:
- if (state->value_mask == stencil_max_value) {
+ if (state->valuemask == stencil_max_value) {
/* stencil_pass = fragment_mask & (reference >= s)
* = fragment_mask & ~(s > reference) */
spe_compare_greater_uint(f, stencil_pass_reg, fbS_reg,
else {
/* stencil_pass = fragment_mask & ~((s&mask) > (reference&mask)) */
int tmp_masked_stencil = spe_allocate_available_register(f);
- spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->value_mask);
+ spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->valuemask);
spe_compare_greater_uint(f, stencil_pass_reg, tmp_masked_stencil,
- state->value_mask & state->ref_value);
+ state->valuemask & state->ref_value);
spe_andc(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
spe_release_register(f, tmp_masked_stencil);
}
break;
case PIPE_FUNC_LEQUAL:
- if (state->value_mask == stencil_max_value) {
+ if (state->valuemask == stencil_max_value) {
/* stencil_pass = fragment_mask & (reference <= s) ]
* = fragment_mask & ~(reference > s) */
/* As above, we have to do this by loading a register */
/* stencil_pass = fragment_mask & ~((reference&mask) > (s&mask)) */
int tmp_reg = spe_allocate_available_register(f);
int tmp_masked_stencil = spe_allocate_available_register(f);
- spe_load_uint(f, tmp_reg, state->ref_value & state->value_mask);
- spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->value_mask);
+ spe_load_uint(f, tmp_reg, state->ref_value & state->valuemask);
+ spe_and_uint(f, tmp_masked_stencil, fbS_reg, state->valuemask);
spe_clgt(f, stencil_pass_reg, tmp_reg, tmp_masked_stencil);
spe_andc(f, stencil_pass_reg, fragment_mask_reg, stencil_pass_reg);
spe_release_register(f, tmp_reg);
need_to_calculate_stencil_values = FALSE;
need_to_writemask_stencil_values = FALSE;
}
- else if (stencil->write_mask == 0x0) {
+ else if (stencil->writemask == 0x0) {
/* All changes are writemasked out, so no need to calculate
* what those changes might be, and no need to write anything back.
*/
need_to_calculate_stencil_values = FALSE;
need_to_writemask_stencil_values = FALSE;
}
- else if (stencil->write_mask == 0xff) {
+ else if (stencil->writemask == 0xff) {
/* Still trivial, but a little less so. We need to write the stencil
* values, but we don't need to mask them.
*/
*/
spe_comment(f, 0, "Computing stencil writemask");
stencil_writemask_reg = spe_allocate_available_register(f);
- spe_load_uint(f, stencil_writemask_reg, dsa->stencil[facing].write_mask);
+ spe_load_uint(f, stencil_writemask_reg, dsa->stencil[facing].writemask);
}
/* At least one-sided stenciling must be on. Generate code that
int face_stencil = spe_allocate_available_register(f);
int stencil_src = stencil;
const unsigned ref = (dsa->stencil[face].ref_value
- & dsa->stencil[face].value_mask);
+ & dsa->stencil[face].valuemask);
boolean complement = FALSE;
int stored;
int tmp = spe_allocate_available_register(f);
if ((dsa->stencil[face].func != PIPE_FUNC_NEVER)
&& (dsa->stencil[face].func != PIPE_FUNC_ALWAYS)
- && (dsa->stencil[face].value_mask != 0x0ff)) {
+ && (dsa->stencil[face].valuemask != 0x0ff)) {
stored = spe_allocate_available_register(f);
- spe_andi(f, stored, stencil, dsa->stencil[face].value_mask);
+ spe_andi(f, stored, stencil, dsa->stencil[face].valuemask);
} else {
stored = stencil;
}
* - For depth-pass if the stencil test is NEVER
* - Any of the 3 conditions if the operation is KEEP
*/
- if (dsa->stencil[face].write_mask != 0) {
+ if (dsa->stencil[face].writemask != 0) {
if ((dsa->stencil[face].func != PIPE_FUNC_ALWAYS)
&& (dsa->stencil[face].fail_op != PIPE_STENCIL_OP_KEEP)) {
if (complement) {
*/
if (stencil_src == stencil) {
spe_release_register(f, face_stencil);
- } else if (dsa->stencil[face].write_mask != 0x0ff) {
+ } else if (dsa->stencil[face].writemask != 0x0ff) {
int tmp = spe_allocate_available_register(f);
- spe_il(f, tmp, dsa->stencil[face].write_mask);
+ spe_il(f, tmp, dsa->stencil[face].writemask);
spe_selb(f, stencil_src, stencil, stencil_src, tmp);
spe_release_register(f, tmp);
dsa->stencil[i].zpass_op);
printf("# ref value / value mask / write mask: %02x %02x %02x\n",
dsa->stencil[i].ref_value,
- dsa->stencil[i].value_mask,
- dsa->stencil[i].write_mask);
+ dsa->stencil[i].valuemask,
+ dsa->stencil[i].writemask);
}
printf("\t.text\n");
struct i915_depth_stencil_state *cso = CALLOC_STRUCT( i915_depth_stencil_state );
{
- int testmask = depth_stencil->stencil[0].value_mask & 0xff;
- int writemask = depth_stencil->stencil[0].write_mask & 0xff;
+ int testmask = depth_stencil->stencil[0].valuemask & 0xff;
+ int writemask = depth_stencil->stencil[0].writemask & 0xff;
cso->stencil_modes4 |= (_3DSTATE_MODES_4_CMD |
ENABLE_STENCIL_TEST_MASK |
int dfop = i915_translate_stencil_op(depth_stencil->stencil[1].zfail_op);
int dpop = i915_translate_stencil_op(depth_stencil->stencil[1].zpass_op);
int ref = depth_stencil->stencil[1].ref_value & 0xff;
- int tmask = depth_stencil->stencil[1].value_mask & 0xff;
- int wmask = depth_stencil->stencil[1].write_mask & 0xff;
+ int tmask = depth_stencil->stencil[1].valuemask & 0xff;
+ int wmask = depth_stencil->stencil[1].writemask & 0xff;
cso->bfo[0] = (_3DSTATE_BACKFACE_STENCIL_OPS |
BFO_ENABLE_STENCIL_FUNCS |
cc.cc0.stencil_pass_depth_pass_op = brw_translate_stencil_op(
brw->attribs.DepthStencil->stencil[0].zpass_op);
cc.cc1.stencil_ref = brw->attribs.DepthStencil->stencil[0].ref_value;
- cc.cc1.stencil_write_mask = brw->attribs.DepthStencil->stencil[0].write_mask;
- cc.cc1.stencil_test_mask = brw->attribs.DepthStencil->stencil[0].value_mask;
+ cc.cc1.stencil_write_mask = brw->attribs.DepthStencil->stencil[0].writemask;
+ cc.cc1.stencil_test_mask = brw->attribs.DepthStencil->stencil[0].valuemask;
if (brw->attribs.DepthStencil->stencil[1].enabled) {
cc.cc0.bf_stencil_enable = brw->attribs.DepthStencil->stencil[1].enabled;
cc.cc0.bf_stencil_pass_depth_pass_op = brw_translate_stencil_op(
brw->attribs.DepthStencil->stencil[1].zpass_op);
cc.cc1.bf_stencil_ref = brw->attribs.DepthStencil->stencil[1].ref_value;
- cc.cc2.bf_stencil_write_mask = brw->attribs.DepthStencil->stencil[1].write_mask;
- cc.cc2.bf_stencil_test_mask = brw->attribs.DepthStencil->stencil[1].value_mask;
+ cc.cc2.bf_stencil_write_mask = brw->attribs.DepthStencil->stencil[1].writemask;
+ cc.cc2.bf_stencil_test_mask = brw->attribs.DepthStencil->stencil[1].valuemask;
}
/* Not really sure about this:
*/
- if (brw->attribs.DepthStencil->stencil[0].write_mask ||
- brw->attribs.DepthStencil->stencil[1].write_mask)
+ if (brw->attribs.DepthStencil->stencil[0].writemask ||
+ brw->attribs.DepthStencil->stencil[1].writemask)
cc.cc0.stencil_write_enable = 1;
}
if (brw->attribs.DepthStencil->stencil[0].enabled) {
lookup |= IZ_STENCIL_TEST_ENABLE_BIT;
- if (brw->attribs.DepthStencil->stencil[0].write_mask ||
- brw->attribs.DepthStencil->stencil[1].write_mask)
+ if (brw->attribs.DepthStencil->stencil[0].writemask ||
+ brw->attribs.DepthStencil->stencil[1].writemask)
lookup |= IZ_STENCIL_WRITE_ENABLE_BIT;
}
hw->depth.test_enable = cso->depth.enabled ? 1 : 0;
hw->stencil.enable = cso->stencil[0].enabled ? 1 : 0;
- hw->stencil.wmask = cso->stencil[0].write_mask;
+ hw->stencil.wmask = cso->stencil[0].writemask;
hw->stencil.func = nvgl_comparison_op(cso->stencil[0].func);
hw->stencil.ref = cso->stencil[0].ref_value;
- hw->stencil.vmask = cso->stencil[0].value_mask;
+ hw->stencil.vmask = cso->stencil[0].valuemask;
hw->stencil.fail = nvgl_stencil_op(cso->stencil[0].fail_op);
hw->stencil.zfail = nvgl_stencil_op(cso->stencil[0].zfail_op);
hw->stencil.zpass = nvgl_stencil_op(cso->stencil[0].zpass_op);
hw->depth.test_enable = cso->depth.enabled ? 1 : 0;
hw->stencil.enable = cso->stencil[0].enabled ? 1 : 0;
- hw->stencil.wmask = cso->stencil[0].write_mask;
+ hw->stencil.wmask = cso->stencil[0].writemask;
hw->stencil.func = nvgl_comparison_op(cso->stencil[0].func);
hw->stencil.ref = cso->stencil[0].ref_value;
- hw->stencil.vmask = cso->stencil[0].value_mask;
+ hw->stencil.vmask = cso->stencil[0].valuemask;
hw->stencil.fail = nvgl_stencil_op(cso->stencil[0].fail_op);
hw->stencil.zfail = nvgl_stencil_op(cso->stencil[0].zfail_op);
hw->stencil.zpass = nvgl_stencil_op(cso->stencil[0].zpass_op);
if (cso->stencil[0].enabled) {
so_method(so, rankine, NV34TCL_STENCIL_FRONT_ENABLE, 8);
so_data (so, cso->stencil[0].enabled ? 1 : 0);
- so_data (so, cso->stencil[0].write_mask);
+ so_data (so, cso->stencil[0].writemask);
so_data (so, nvgl_comparison_op(cso->stencil[0].func));
so_data (so, cso->stencil[0].ref_value);
- so_data (so, cso->stencil[0].value_mask);
+ so_data (so, cso->stencil[0].valuemask);
so_data (so, nvgl_stencil_op(cso->stencil[0].fail_op));
so_data (so, nvgl_stencil_op(cso->stencil[0].zfail_op));
so_data (so, nvgl_stencil_op(cso->stencil[0].zpass_op));
if (cso->stencil[1].enabled) {
so_method(so, rankine, NV34TCL_STENCIL_BACK_ENABLE, 8);
so_data (so, cso->stencil[1].enabled ? 1 : 0);
- so_data (so, cso->stencil[1].write_mask);
+ so_data (so, cso->stencil[1].writemask);
so_data (so, nvgl_comparison_op(cso->stencil[1].func));
so_data (so, cso->stencil[1].ref_value);
- so_data (so, cso->stencil[1].value_mask);
+ so_data (so, cso->stencil[1].valuemask);
so_data (so, nvgl_stencil_op(cso->stencil[1].fail_op));
so_data (so, nvgl_stencil_op(cso->stencil[1].zfail_op));
so_data (so, nvgl_stencil_op(cso->stencil[1].zpass_op));
if (cso->stencil[0].enabled) {
so_method(so, curie, NV40TCL_STENCIL_FRONT_ENABLE, 8);
so_data (so, cso->stencil[0].enabled ? 1 : 0);
- so_data (so, cso->stencil[0].write_mask);
+ so_data (so, cso->stencil[0].writemask);
so_data (so, nvgl_comparison_op(cso->stencil[0].func));
so_data (so, cso->stencil[0].ref_value);
- so_data (so, cso->stencil[0].value_mask);
+ so_data (so, cso->stencil[0].valuemask);
so_data (so, nvgl_stencil_op(cso->stencil[0].fail_op));
so_data (so, nvgl_stencil_op(cso->stencil[0].zfail_op));
so_data (so, nvgl_stencil_op(cso->stencil[0].zpass_op));
if (cso->stencil[1].enabled) {
so_method(so, curie, NV40TCL_STENCIL_BACK_ENABLE, 8);
so_data (so, cso->stencil[1].enabled ? 1 : 0);
- so_data (so, cso->stencil[1].write_mask);
+ so_data (so, cso->stencil[1].writemask);
so_data (so, nvgl_comparison_op(cso->stencil[1].func));
so_data (so, cso->stencil[1].ref_value);
- so_data (so, cso->stencil[1].value_mask);
+ so_data (so, cso->stencil[1].valuemask);
so_data (so, nvgl_stencil_op(cso->stencil[1].fail_op));
so_data (so, nvgl_stencil_op(cso->stencil[1].zfail_op));
so_data (so, nvgl_stencil_op(cso->stencil[1].zpass_op));
so_data (so, nvgl_comparison_op(cso->stencil[0].func));
so_method(so, tesla, NV50TCL_STENCIL_BACK_FUNC_REF, 3);
so_data (so, cso->stencil[0].ref_value);
- so_data (so, cso->stencil[0].write_mask);
- so_data (so, cso->stencil[0].value_mask);
+ so_data (so, cso->stencil[0].writemask);
+ so_data (so, cso->stencil[0].valuemask);
} else {
so_method(so, tesla, NV50TCL_STENCIL_BACK_ENABLE, 1);
so_data (so, 0);
so_data (so, nvgl_stencil_op(cso->stencil[1].zpass_op));
so_data (so, nvgl_comparison_op(cso->stencil[1].func));
so_data (so, cso->stencil[1].ref_value);
- so_data (so, cso->stencil[1].write_mask);
- so_data (so, cso->stencil[1].value_mask);
+ so_data (so, cso->stencil[1].writemask);
+ so_data (so, cso->stencil[1].valuemask);
} else {
so_method(so, tesla, NV50TCL_STENCIL_FRONT_ENABLE, 1);
so_data (so, 0);
zFailOp = softpipe->depth_stencil->stencil[face].zfail_op;
zPassOp = softpipe->depth_stencil->stencil[face].zpass_op;
ref = softpipe->depth_stencil->stencil[face].ref_value;
- wrtMask = softpipe->depth_stencil->stencil[face].write_mask;
- valMask = softpipe->depth_stencil->stencil[face].value_mask;
+ wrtMask = softpipe->depth_stencil->stencil[face].writemask;
+ valMask = softpipe->depth_stencil->stencil[face].valuemask;
assert(ps); /* shouldn't get here if there's no stencil buffer */
trace_dump_member(uint, &state->stencil[i], zpass_op);
trace_dump_member(uint, &state->stencil[i], zfail_op);
trace_dump_member(uint, &state->stencil[i], ref_value);
- trace_dump_member(uint, &state->stencil[i], value_mask);
- trace_dump_member(uint, &state->stencil[i], write_mask);
+ trace_dump_member(uint, &state->stencil[i], valuemask);
+ trace_dump_member(uint, &state->stencil[i], writemask);
trace_dump_struct_end();
trace_dump_elem_end();
}
unsigned fail_op:3; /**< PIPE_STENCIL_OP_x */
unsigned zpass_op:3; /**< PIPE_STENCIL_OP_x */
unsigned zfail_op:3; /**< PIPE_STENCIL_OP_x */
- ubyte ref_value;
- ubyte value_mask;
- ubyte write_mask;
+ ubyte ref_value;
+ ubyte valuemask;
+ ubyte writemask;
};
dsa.stencil[i].zpass_op = PIPE_STENCIL_OP_KEEP;
dsa.stencil[i].zfail_op = PIPE_STENCIL_OP_KEEP;
dsa.stencil[i].ref_value = 0;
- dsa.stencil[i].value_mask = 0;
- dsa.stencil[i].write_mask = 0;
+ dsa.stencil[i].valuemask = 0;
+ dsa.stencil[i].writemask = 0;
}
dsa.alpha.enabled = 0;
dsa.alpha.func = PIPE_FUNC_ALWAYS;
dsa->stencil[0].zfail_op = gl_stencil_op_to_pipe(st->ctx->Stencil.ZFailFunc[0]);
dsa->stencil[0].zpass_op = gl_stencil_op_to_pipe(st->ctx->Stencil.ZPassFunc[0]);
dsa->stencil[0].ref_value = st->ctx->Stencil.Ref[0] & 0xff;
- dsa->stencil[0].value_mask = st->ctx->Stencil.ValueMask[0] & 0xff;
- dsa->stencil[0].write_mask = st->ctx->Stencil.WriteMask[0] & 0xff;
+ dsa->stencil[0].valuemask = st->ctx->Stencil.ValueMask[0] & 0xff;
+ dsa->stencil[0].writemask = st->ctx->Stencil.WriteMask[0] & 0xff;
if (st->ctx->Stencil._TestTwoSide) {
dsa->stencil[1].enabled = 1;
dsa->stencil[1].zfail_op = gl_stencil_op_to_pipe(st->ctx->Stencil.ZFailFunc[1]);
dsa->stencil[1].zpass_op = gl_stencil_op_to_pipe(st->ctx->Stencil.ZPassFunc[1]);
dsa->stencil[1].ref_value = st->ctx->Stencil.Ref[1] & 0xff;
- dsa->stencil[1].value_mask = st->ctx->Stencil.ValueMask[1] & 0xff;
- dsa->stencil[1].write_mask = st->ctx->Stencil.WriteMask[1] & 0xff;
+ dsa->stencil[1].valuemask = st->ctx->Stencil.ValueMask[1] & 0xff;
+ dsa->stencil[1].writemask = st->ctx->Stencil.WriteMask[1] & 0xff;
}
else {
dsa->stencil[1] = dsa->stencil[0];
depth_stencil.stencil[0].zpass_op = PIPE_STENCIL_OP_REPLACE;
depth_stencil.stencil[0].zfail_op = PIPE_STENCIL_OP_REPLACE;
depth_stencil.stencil[0].ref_value = ctx->Stencil.Clear;
- depth_stencil.stencil[0].value_mask = 0xff;
- depth_stencil.stencil[0].write_mask = ctx->Stencil.WriteMask[0] & 0xff;
+ depth_stencil.stencil[0].valuemask = 0xff;
+ depth_stencil.stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff;
}
cso_set_depth_stencil_alpha(st->cso_context, &depth_stencil);