* color by simply changing the clear color without modifying either
* surface.
*
- * 2) Compressed w/ Clear: In this state, neither the auxiliary surface
+ * 2) Partial Clear: In this state, each block in the auxiliary surface
+ * contains either the magic clear or pass-through value. See Clear and
+ * Pass-through for more details.
+ *
+ * 3) Compressed w/ Clear: In this state, neither the auxiliary surface
* nor the primary surface has a complete representation of the data.
* Instead, both surfaces must be used together or else rendering
* corruption may occur. Depending on the auxiliary compression format
* values. Blocks may also be in the clear state (see Clear) and have
* their value taken from outside the surface.
*
- * 3) Compressed w/o Clear: This state is identical to the state above
+ * 4) Compressed w/o Clear: This state is identical to the state above
* except that no blocks are in the clear state. In this state, all of
* the data required to reconstruct the final sample values is contained
* in the auxiliary and primary surface and the clear value is not
* considered.
*
- * 4) Resolved: In this state, the primary surface contains 100% of the
+ * 5) Resolved: In this state, the primary surface contains 100% of the
* data. The auxiliary surface is also valid so the surface can be
* validly used with or without aux enabled. The auxiliary surface may,
* however, contain non-trivial data and any update to the primary
* surface with aux disabled will cause the two to get out of sync.
*
- * 5) Pass-through: In this state, the primary surface contains 100% of the
+ * 6) Pass-through: In this state, the primary surface contains 100% of the
* data and every block in the auxiliary surface contains a magic value
* which indicates that the auxiliary surface should be ignored and the
* only the primary surface should be considered. Updating the primary
* cause the auxiliary buffer to contain non-trivial data and no longer
* be in the pass-through state.
*
- * 5) Aux Invalid: In this state, the primary surface contains 100% of the
+ * 7) Aux Invalid: In this state, the primary surface contains 100% of the
* data and the auxiliary surface is completely bogus. Any attempt to
* use the auxiliary surface is liable to result in rendering
* corruption. The only thing that one can do to re-enable aux once
* 1) Fast Clear: This operation writes the magic "clear" value to the
* auxiliary surface. This operation will safely transition any slice
* of a surface from any state to the clear state so long as the entire
- * slice is fast cleared at once.
+ * slice is fast cleared at once. A fast clear that only covers part of
+ * a slice of a surface is called a partial fast clear.
*
* 2) Full Resolve: This operation combines the auxiliary surface data
* with the primary surface data and writes the result to the primary.
* Draw w/ Aux
* +----------+
* | |
- * | +-------------+ Draw w/ Aux +-------------+
- * +------>| Compressed |<---------------------| Clear |
- * | w/ Clear | | |
- * +-------------+ +-------------+
- * | | |
- * Partial | | |
- * Resolve | | Full Resolve |
- * | +----------------------------+ | Full
- * | | | Resolve
- * Draw w/ aux | | |
- * +----------+ | | |
- * | | \|/ \|/ \|/
- * | +-------------+ Full Resolve +-------------+
- * +------>| Compressed |--------------------->| Resolved |
- * | w/o Clear |<---------------------| |
- * +-------------+ Draw w/ Aux +-------------+
- * /|\ | |
- * | Draw | | Draw
- * | w/ Aux | | w/o Aux
- * | Ambiguate | |
- * | +----------------------------+ |
- * Draw w/o Aux | | | Draw w/o Aux
- * +----------+ | | | +----------+
- * | | | \|/ \|/ | |
- * | +-------------+ Ambiguate +-------------+ |
- * +------>| Pass- |<---------------------| Aux |<------+
- * | through | | Invalid |
- * +-------------+ +-------------+
+ * | +-------------+ Draw w/ Aux +-------------+
+ * +------>| Compressed |<-------------------| Clear |
+ * | w/ Clear |----->----+ | |
+ * +-------------+ | +-------------+
+ * | /|\ | | |
+ * | | | | |
+ * | | +------<-----+ | Draw w/
+ * | | | | Clear Only
+ * | | Full | | +----------+
+ * Partial | | Resolve | \|/ | |
+ * Resolve | | | +-------------+ |
+ * | | | | Partial |<------+
+ * | | | | Clear |<----------+
+ * | | | +-------------+ |
+ * | | | | |
+ * | | +------>---------+ Full |
+ * | | | Resolve |
+ * Draw w/ aux | | Partial Fast Clear | |
+ * +----------+ | +--------------------------+ | |
+ * | | \|/ | \|/ |
+ * | +-------------+ Full Resolve +-------------+ |
+ * +------>| Compressed |------------------->| Resolved | |
+ * | w/o Clear |<-------------------| | |
+ * +-------------+ Draw w/ Aux +-------------+ |
+ * /|\ | | |
+ * | Draw | | Draw |
+ * | w/ Aux | | w/o Aux |
+ * | Ambiguate | | |
+ * | +--------------------------+ | |
+ * Draw w/o Aux | | | Draw w/o Aux |
+ * +----------+ | | | +----------+ |
+ * | | | \|/ \|/ | | |
+ * | +-------------+ Ambiguate +-------------+ | |
+ * +------>| Pass- |<-------------------| Aux |<------+ |
+ * +------>| through | | Invalid | |
+ * | +-------------+ +-------------+ |
+ * | | | |
+ * +----------+ +-----------------------------------------------------+
+ * Draw w/ Partial Fast Clear
+ * Clear Only
*
*
* While the above general theory applies to all forms of auxiliary
* CCS_D: Single-sample fast-clears (also called CCS_D in ISL) are one of
* the simplest forms of compression since they don't do anything
* beyond clear color tracking. They really only support three of
- * the six states: Clear, Compressed w/ Clear, and Pass-through. The
+ * the six states: Clear, Partial Clear, and Pass-through. The
* only CCS_D operation is "Resolve" which maps to a full resolve
* followed by an ambiguate.
*
*/
enum isl_aux_state {
ISL_AUX_STATE_CLEAR = 0,
+ ISL_AUX_STATE_PARTIAL_CLEAR,
ISL_AUX_STATE_COMPRESSED_CLEAR,
ISL_AUX_STATE_COMPRESSED_NO_CLEAR,
ISL_AUX_STATE_RESOLVED,
case ISL_AUX_STATE_PASS_THROUGH:
return BLORP_FAST_CLEAR_OP_NONE;
+ case ISL_AUX_STATE_PARTIAL_CLEAR:
case ISL_AUX_STATE_RESOLVED:
case ISL_AUX_STATE_AUX_INVALID:
case ISL_AUX_STATE_COMPRESSED_NO_CLEAR:
case ISL_AUX_STATE_PASS_THROUGH:
return BLORP_FAST_CLEAR_OP_NONE;
+ case ISL_AUX_STATE_PARTIAL_CLEAR:
case ISL_AUX_STATE_RESOLVED:
case ISL_AUX_STATE_AUX_INVALID:
break;
}
break;
+ case ISL_AUX_STATE_PARTIAL_CLEAR:
case ISL_AUX_STATE_RESOLVED:
case ISL_AUX_STATE_AUX_INVALID:
unreachable("Invalid aux state for CCS_E");
/* Nothing to do */
break;
+ case ISL_AUX_STATE_PARTIAL_CLEAR:
case ISL_AUX_STATE_COMPRESSED_NO_CLEAR:
case ISL_AUX_STATE_RESOLVED:
case ISL_AUX_STATE_AUX_INVALID:
case ISL_AUX_STATE_RESOLVED:
case ISL_AUX_STATE_PASS_THROUGH:
case ISL_AUX_STATE_AUX_INVALID:
+ case ISL_AUX_STATE_PARTIAL_CLEAR:
unreachable("Invalid aux state for MCS");
}
}
case ISL_AUX_STATE_RESOLVED:
case ISL_AUX_STATE_PASS_THROUGH:
case ISL_AUX_STATE_AUX_INVALID:
+ case ISL_AUX_STATE_PARTIAL_CLEAR:
unreachable("Invalid aux state for MCS");
}
}
if (aux_usage == ISL_AUX_USAGE_HIZ)
hiz_op = BLORP_HIZ_OP_HIZ_RESOLVE;
break;
+
+ case ISL_AUX_STATE_PARTIAL_CLEAR:
+ unreachable("Invalid HiZ state");
}
if (hiz_op != BLORP_HIZ_OP_NONE) {
case ISL_AUX_STATE_AUX_INVALID:
assert(aux_usage != ISL_AUX_USAGE_HIZ);
break;
+
+ case ISL_AUX_STATE_PARTIAL_CLEAR:
+ unreachable("Invalid HiZ state");
}
}