db_count_control |= S_028004_PERFECT_ZPASS_COUNTS(1);
db_render_override |= S_02800C_NOOP_CULL_DISABLE(1);
}
+
if (a->flush_depthstencil_through_cb) {
- db_render_control |= S_028000_DEPTH_COPY_ENABLE(1) |
- S_028000_STENCIL_COPY_ENABLE(1) |
+ assert(a->copy_depth || a->copy_stencil);
+
+ db_render_control |= S_028000_DEPTH_COPY_ENABLE(a->copy_depth) |
+ S_028000_STENCIL_COPY_ENABLE(a->copy_stencil) |
S_028000_COPY_CENTROID(1);
}
float depth = 1.0f;
struct r600_resource_texture *flushed_depth_texture = staging ?
staging : texture->flushed_depth_texture;
+ const struct util_format_description *desc =
+ util_format_description(texture->resource.b.b.format);
if (!staging && !texture->dirty_db_mask)
return;
rctx->family == CHIP_RV620 || rctx->family == CHIP_RV635)
depth = 0.0f;
- if (!rctx->db_misc_state.flush_depthstencil_through_cb) {
- /* Enable decompression in DB_RENDER_CONTROL */
- rctx->db_misc_state.flush_depthstencil_through_cb = true;
- r600_atom_dirty(rctx, &rctx->db_misc_state.atom);
- }
+ /* Enable decompression in DB_RENDER_CONTROL */
+ rctx->db_misc_state.flush_depthstencil_through_cb = true;
+ rctx->db_misc_state.copy_depth = util_format_has_depth(desc);
+ rctx->db_misc_state.copy_stencil = util_format_has_stencil(desc);
+ r600_atom_dirty(rctx, &rctx->db_misc_state.atom);
for (level = first_level; level <= last_level; level++) {
if (!staging && !(texture->dirty_db_mask & (1 << level)))
struct r600_atom atom;
bool occlusion_query_enabled;
bool flush_depthstencil_through_cb;
+ bool copy_depth, copy_stencil;
};
struct r600_cb_misc_state {
db_render_override |= S_028D10_NOOP_CULL_DISABLE(1);
}
if (a->flush_depthstencil_through_cb) {
- db_render_control |= S_028D0C_DEPTH_COPY_ENABLE(1) |
- S_028D0C_STENCIL_COPY_ENABLE(1) |
+ assert(a->copy_depth || a->copy_stencil);
+
+ db_render_control |= S_028D0C_DEPTH_COPY_ENABLE(a->copy_depth) |
+ S_028D0C_STENCIL_COPY_ENABLE(a->copy_stencil) |
S_028D0C_COPY_CENTROID(1);
}