<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 11, 2018 at 1:42 PM, Nanley Chery <span dir="ltr"><<a href="mailto:nanleychery@gmail.com" target="_blank">nanleychery@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We want to add and use a function that accesses the auxiliary buffer's<br>
clear_color_bo and doesn't care if it has an MCS or HiZ buffer<br>
specifically.<br>
---<br>
src/mesa/drivers/dri/i965/brw_<wbr>blorp.c | 4 +-<br>
src/mesa/drivers/dri/i965/brw_<wbr>clear.c | 4 +-<br>
src/mesa/drivers/dri/i965/brw_<wbr>wm.c | 2 +-<br>
src/mesa/drivers/dri/i965/<wbr>gen6_depth_state.c | 6 +-<br>
src/mesa/drivers/dri/i965/<wbr>gen7_misc_state.c | 4 +-<br>
src/mesa/drivers/dri/i965/<wbr>gen8_depth_state.c | 6 +-<br>
src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 106 +++++++++++++-------------<br>
src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h | 42 ++++------<br>
src/mesa/drivers/dri/i965/<wbr>intel_tex_image.c | 2 +-<br>
9 files changed, 80 insertions(+), 96 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
index 962a316c5cf..a1882abb7cb 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
@@ -1212,7 +1212,7 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,<br>
<br>
/* If the MCS buffer hasn't been allocated yet, we need to allocate it now.<br>
*/<br>
- if (can_fast_clear && !irb->mt->mcs_buf) {<br>
+ if (can_fast_clear && !irb->mt->aux_buf) {<br>
assert(irb->mt->aux_usage == ISL_AUX_USAGE_CCS_D);<br>
if (!intel_miptree_alloc_ccs(brw, irb->mt)) {<br>
/* There are a few reasons in addition to out-of-memory, that can<br>
@@ -1611,7 +1611,7 @@ intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,<br>
brw_emit_pipe_control_flush(<wbr>brw, PIPE_CONTROL_DEPTH_STALL);<br>
}<br>
<br>
- assert(mt->aux_usage == ISL_AUX_USAGE_HIZ && mt->hiz_buf);<br>
+ assert(mt->aux_usage == ISL_AUX_USAGE_HIZ && mt->aux_buf);<br>
<br>
struct isl_surf isl_tmp[2];<br>
struct blorp_surf surf;<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_clear.c b/src/mesa/drivers/dri/i965/<wbr>brw_clear.c<br>
index 487de9b8997..3d540d6d905 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_clear.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_clear.c<br>
@@ -240,7 +240,7 @@ brw_fast_clear_depth(struct gl_context *ctx)<br>
* buffer when doing a fast clear. Since we are skipping the fast<br>
* clear here, we need to update the clear color ourselves.<br>
*/<br>
- uint32_t clear_offset = mt->hiz_buf->clear_color_<wbr>offset;<br>
+ uint32_t clear_offset = mt->aux_buf->clear_color_<wbr>offset;<br>
union isl_color_value clear_color = { .f32 = { clear_value, } };<br>
<br>
/* We can't update the clear color while the hardware is still using<br>
@@ -249,7 +249,7 @@ brw_fast_clear_depth(struct gl_context *ctx)<br>
*/<br>
brw_emit_pipe_control_flush(<wbr>brw, PIPE_CONTROL_CS_STALL);<br>
for (int i = 0; i < 4; i++) {<br>
- brw_store_data_imm32(brw, mt->hiz_buf->clear_color_bo,<br>
+ brw_store_data_imm32(brw, mt->aux_buf->clear_color_bo,<br>
clear_offset + i * 4, clear_color.u32[i]);<br>
}<br>
brw_emit_pipe_control_flush(<wbr>brw, PIPE_CONTROL_STATE_CACHE_<wbr>INVALIDATE);<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_wm.c b/src/mesa/drivers/dri/i965/<wbr>brw_wm.c<br>
index 68d4ab88d77..94048cd758f 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_wm.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_wm.c<br>
@@ -384,7 +384,7 @@ brw_populate_sampler_prog_key_<wbr>data(struct gl_context *ctx,<br>
if (intel_tex->mt->aux_usage == ISL_AUX_USAGE_MCS) {<br>
assert(devinfo->gen >= 7);<br>
assert(intel_tex->mt->surf.<wbr>samples > 1);<br>
- assert(intel_tex->mt->mcs_buf)<wbr>;<br>
+ assert(intel_tex->mt->aux_buf)<wbr>;<br>
assert(intel_tex->mt->surf.<wbr>msaa_layout == ISL_MSAA_LAYOUT_ARRAY);<br>
key->compressed_multisample_<wbr>layout_mask |= 1 << s;<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>gen6_depth_state.c b/src/mesa/drivers/dri/i965/<wbr>gen6_depth_state.c<br>
index 3a66b42fec1..8a1d5808051 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>gen6_depth_state.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>gen6_depth_state.c<br>
@@ -160,13 +160,13 @@ gen6_emit_depth_stencil_hiz(<wbr>struct brw_context *brw,<br>
assert(depth_mt);<br>
<br>
uint32_t offset;<br>
- isl_surf_get_image_offset_B_<wbr>tile_sa(&depth_mt->hiz_buf-><wbr>surf,<br>
+ isl_surf_get_image_offset_B_<wbr>tile_sa(&depth_mt->aux_buf-><wbr>surf,<br>
lod, 0, 0, &offset, NULL, NULL);<br>
<br>
BEGIN_BATCH(3);<br>
OUT_BATCH((_3DSTATE_HIER_<wbr>DEPTH_BUFFER << 16) | (3 - 2));<br>
- OUT_BATCH(depth_mt->hiz_buf-><wbr>surf.row_pitch - 1);<br>
- OUT_RELOC(depth_mt->hiz_buf-><wbr>bo, RELOC_WRITE, offset);<br>
+ OUT_BATCH(depth_mt->aux_buf-><wbr>surf.row_pitch - 1);<br>
+ OUT_RELOC(depth_mt->aux_buf-><wbr>bo, RELOC_WRITE, offset);<br>
ADVANCE_BATCH();<br>
} else {<br>
BEGIN_BATCH(3);<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>gen7_misc_state.c b/src/mesa/drivers/dri/i965/<wbr>gen7_misc_state.c<br>
index 58f0a1bdbfd..1ce76585f2b 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>gen7_misc_state.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>gen7_misc_state.c<br>
@@ -149,8 +149,8 @@ gen7_emit_depth_stencil_hiz(<wbr>struct brw_context *brw,<br>
BEGIN_BATCH(3);<br>
OUT_BATCH(GEN7_3DSTATE_HIER_<wbr>DEPTH_BUFFER << 16 | (3 - 2));<br>
OUT_BATCH((mocs << 25) |<br>
- (depth_mt->hiz_buf->pitch - 1));<br>
- OUT_RELOC(depth_mt->hiz_buf-><wbr>bo, RELOC_WRITE, 0);<br>
+ (depth_mt->aux_buf->pitch - 1));<br>
+ OUT_RELOC(depth_mt->aux_buf-><wbr>bo, RELOC_WRITE, 0);<br>
ADVANCE_BATCH();<br>
}<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>gen8_depth_state.c b/src/mesa/drivers/dri/i965/<wbr>gen8_depth_state.c<br>
index 27705d35df9..0fc027313b4 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>gen8_depth_state.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>gen8_depth_state.c<br>
@@ -94,9 +94,9 @@ emit_depth_packets(struct brw_context *brw,<br>
assert(depth_mt);<br>
BEGIN_BATCH(5);<br>
OUT_BATCH(GEN7_3DSTATE_HIER_<wbr>DEPTH_BUFFER << 16 | (5 - 2));<br>
- OUT_BATCH((depth_mt->hiz_buf-><wbr>pitch - 1) | mocs_wb << 25);<br>
- OUT_RELOC64(depth_mt->hiz_buf-<wbr>>bo, RELOC_WRITE, 0);<br>
- OUT_BATCH(depth_mt->hiz_buf-><wbr>qpitch >> 2);<br>
+ OUT_BATCH((depth_mt->aux_buf-><wbr>pitch - 1) | mocs_wb << 25);<br>
+ OUT_RELOC64(depth_mt->aux_buf-<wbr>>bo, RELOC_WRITE, 0);<br>
+ OUT_BATCH(depth_mt->aux_buf-><wbr>qpitch >> 2);<br>
ADVANCE_BATCH();<br>
}<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
index ba5b02bc0aa..c5791835409 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
@@ -950,7 +950,7 @@ create_ccs_buf_for_image(<wbr>struct brw_context *brw,<br>
assert(mt->last_level == 0);<br>
<br>
/* We shouldn't already have a CCS */<br>
- assert(!mt->mcs_buf);<br>
+ assert(!mt->aux_buf);<br>
<br>
if (!isl_surf_get_ccs_surf(&brw-><wbr>isl_dev, &mt->surf, &temp_ccs_surf,<br>
image->aux_pitch))<br>
@@ -959,14 +959,14 @@ create_ccs_buf_for_image(<wbr>struct brw_context *brw,<br>
assert(image->aux_offset < image->bo->size);<br>
assert(temp_ccs_surf.size <= image->bo->size - image->aux_offset);<br>
<br>
- mt->mcs_buf = calloc(sizeof(*mt->mcs_buf), 1);<br>
- if (mt->mcs_buf == NULL)<br>
+ mt->aux_buf = calloc(sizeof(*mt->aux_buf), 1);<br>
+ if (mt->aux_buf == NULL)<br>
return false;<br>
<br>
mt->aux_state = create_aux_state_map(mt, initial_state);<br>
if (!mt->aux_state) {<br>
- free(mt->mcs_buf);<br>
- mt->mcs_buf = NULL;<br>
+ free(mt->aux_buf);<br>
+ mt->aux_buf = NULL;<br>
return false;<br>
}<br>
<br>
@@ -977,24 +977,24 @@ create_ccs_buf_for_image(<wbr>struct brw_context *brw,<br>
*/<br>
const struct gen_device_info *devinfo = &brw->screen->devinfo;<br>
if (devinfo->gen >= 10) {<br>
- mt->mcs_buf->clear_color_bo =<br>
+ mt->aux_buf->clear_color_bo =<br>
brw_bo_alloc(brw->bufmgr, "clear_color_bo",<br>
brw->isl_dev.ss.clear_color_<wbr>state_size);<br>
- if (!mt->mcs_buf->clear_color_bo) {<br>
- free(mt->mcs_buf);<br>
- mt->mcs_buf = NULL;<br>
+ if (!mt->aux_buf->clear_color_bo) {<br>
+ free(mt->aux_buf);<br>
+ mt->aux_buf = NULL;<br>
return false;<br>
}<br>
}<br>
<br>
- mt->mcs_buf->bo = image->bo;<br>
+ mt->aux_buf->bo = image->bo;<br>
brw_bo_reference(image->bo);<br>
<br>
- mt->mcs_buf->offset = image->aux_offset;<br>
- mt->mcs_buf->size = image->bo->size - image->aux_offset;<br>
- mt->mcs_buf->pitch = image->aux_pitch;<br>
- mt->mcs_buf->qpitch = 0;<br>
- mt->mcs_buf->surf = temp_ccs_surf;<br>
+ mt->aux_buf->offset = image->aux_offset;<br>
+ mt->aux_buf->size = image->bo->size - image->aux_offset;<br>
+ mt->aux_buf->pitch = image->aux_pitch;<br>
+ mt->aux_buf->qpitch = 0;<br>
+ mt->aux_buf->surf = temp_ccs_surf;<br>
<br>
return true;<br>
}<br>
@@ -1249,7 +1249,7 @@ intel_miptree_release(struct intel_mipmap_tree **mt)<br>
brw_bo_unreference((*mt)->bo);<br>
intel_miptree_release(&(*mt)-><wbr>stencil_mt);<br>
intel_miptree_release(&(*mt)-><wbr>r8stencil_mt);<br>
- intel_miptree_aux_buffer_free(<wbr>intel_miptree_get_aux_buffer(*<wbr>mt));<br>
+ intel_miptree_aux_buffer_free(<wbr>(*mt)->aux_buf);<br>
free_aux_state_map((*mt)->aux_<wbr>state);<br>
<br>
intel_miptree_release(&(*mt)-><wbr>plane[0]);<br>
@@ -1660,7 +1660,7 @@ intel_miptree_init_mcs(struct brw_context *brw,<br>
struct intel_mipmap_tree *mt,<br>
int init_value)<br>
{<br>
- assert(mt->mcs_buf != NULL);<br>
+ assert(mt->aux_buf != NULL);<br>
<br>
/* From the Ivy Bridge PRM, Vol 2 Part 1 p326:<br>
*<br>
@@ -1672,16 +1672,16 @@ intel_miptree_init_mcs(struct brw_context *brw,<br>
*<br>
* Note: the clear value for MCS buffers is all 1's, so we memset to 0xff.<br>
*/<br>
- void *map = brw_bo_map(brw, mt->mcs_buf->bo, MAP_WRITE | MAP_RAW);<br>
+ void *map = brw_bo_map(brw, mt->aux_buf->bo, MAP_WRITE | MAP_RAW);<br>
if (unlikely(map == NULL)) {<br>
fprintf(stderr, "Failed to map mcs buffer into GTT\n");<br>
- brw_bo_unreference(mt->mcs_<wbr>buf->bo);<br>
- free(mt->mcs_buf);<br>
+ brw_bo_unreference(mt->aux_<wbr>buf->bo);<br>
+ free(mt->aux_buf);<br>
return;<br>
}<br>
void *data = map;<br>
- memset(data, init_value, mt->mcs_buf->size);<br>
- brw_bo_unmap(mt->mcs_buf->bo);<br>
+ memset(data, init_value, mt->aux_buf->size);<br>
+ brw_bo_unmap(mt->aux_buf->bo);<br>
}<br>
<br>
static struct intel_miptree_aux_buffer *<br>
@@ -1737,7 +1737,7 @@ intel_miptree_alloc_mcs(struct brw_context *brw,<br>
GLuint num_samples)<br>
{<br>
assert(brw->screen->devinfo.<wbr>gen >= 7); /* MCS only used on Gen7+ */<br>
- assert(mt->mcs_buf == NULL);<br>
+ assert(mt->aux_buf == NULL);<br>
assert(mt->aux_usage == ISL_AUX_USAGE_MCS);<br>
<br>
/* Multisampled miptrees are only supported for single level. */<br>
@@ -1759,9 +1759,9 @@ intel_miptree_alloc_mcs(struct brw_context *brw,<br>
* to be just used by the GPU.<br>
*/<br>
const uint32_t alloc_flags = 0;<br>
- mt->mcs_buf = intel_alloc_aux_buffer(brw, "mcs-miptree",<br>
+ mt->aux_buf = intel_alloc_aux_buffer(brw, "mcs-miptree",<br>
&temp_mcs_surf, alloc_flags, mt);<br>
- if (!mt->mcs_buf) {<br>
+ if (!mt->aux_buf) {<br>
free(aux_state);<br>
return false;<br>
}<br>
@@ -1777,7 +1777,7 @@ bool<br>
intel_miptree_alloc_ccs(struct brw_context *brw,<br>
struct intel_mipmap_tree *mt)<br>
{<br>
- assert(mt->mcs_buf == NULL);<br>
+ assert(mt->aux_buf == NULL);<br>
assert(mt->aux_usage == ISL_AUX_USAGE_CCS_E ||<br>
mt->aux_usage == ISL_AUX_USAGE_CCS_D);<br>
<br>
@@ -1808,9 +1808,9 @@ intel_miptree_alloc_ccs(struct brw_context *brw,<br>
*/<br>
const uint32_t alloc_flags = mt->aux_usage == ISL_AUX_USAGE_CCS_E ?<br>
BO_ALLOC_ZEROED : BO_ALLOC_BUSY;<br>
- mt->mcs_buf = intel_alloc_aux_buffer(brw, "ccs-miptree",<br>
+ mt->aux_buf = intel_alloc_aux_buffer(brw, "ccs-miptree",<br>
&temp_ccs_surf, alloc_flags, mt);<br>
- if (!mt->mcs_buf) {<br>
+ if (!mt->aux_buf) {<br>
free(aux_state);<br>
return false;<br>
}<br>
@@ -1832,7 +1832,7 @@ intel_miptree_level_enable_<wbr>hiz(struct brw_context *brw,<br>
{<br>
const struct gen_device_info *devinfo = &brw->screen->devinfo;<br>
<br>
- assert(mt->hiz_buf);<br>
+ assert(mt->aux_buf);<br>
assert(mt->surf.size > 0);<br>
<br>
if (devinfo->gen >= 8 || devinfo->is_haswell) {<br>
@@ -1860,7 +1860,7 @@ bool<br>
intel_miptree_alloc_hiz(struct brw_context *brw,<br>
struct intel_mipmap_tree *mt)<br>
{<br>
- assert(mt->hiz_buf == NULL);<br>
+ assert(mt->aux_buf == NULL);<br>
assert(mt->aux_usage == ISL_AUX_USAGE_HIZ);<br>
<br>
enum isl_aux_state **aux_state =<br>
@@ -1875,10 +1875,10 @@ intel_miptree_alloc_hiz(struct brw_context *brw,<br>
assert(ok);<br>
<br>
const uint32_t alloc_flags = BO_ALLOC_BUSY;<br>
- mt->hiz_buf = intel_alloc_aux_buffer(brw, "hiz-miptree",<br>
+ mt->aux_buf = intel_alloc_aux_buffer(brw, "hiz-miptree",<br>
&temp_hiz_surf, alloc_flags, mt);<br>
<br>
- if (!mt->hiz_buf) {<br>
+ if (!mt->aux_buf) {<br>
free(aux_state);<br>
return false;<br>
}<br>
@@ -1951,7 +1951,7 @@ intel_miptree_sample_with_hiz(<wbr>struct brw_context *brw,<br>
return false;<br>
}<br>
<br>
- if (!mt->hiz_buf) {<br>
+ if (!mt->aux_buf) {<br>
return false;<br>
}<br>
<br>
@@ -2031,7 +2031,7 @@ intel_miptree_has_color_<wbr>unresolved(const struct intel_mipmap_tree *mt,<br>
{<br>
assert(_mesa_is_format_color_<wbr>format(mt->format));<br>
<br>
- if (!mt->mcs_buf)<br>
+ if (!mt->aux_buf)<br>
return false;<br>
<br>
/* Clamp the level range to fit the miptree */<br>
@@ -2058,7 +2058,7 @@ intel_miptree_check_color_<wbr>resolve(const struct brw_context *brw,<br>
const struct intel_mipmap_tree *mt,<br>
unsigned level, unsigned layer)<br>
{<br>
- if (!mt->mcs_buf)<br>
+ if (!mt->aux_buf)<br>
return;<br>
<br>
/* Fast color clear is supported for mipmapped surfaces only on Gen8+. */<br>
@@ -2450,7 +2450,7 @@ intel_miptree_prepare_access(<wbr>struct brw_context *brw,<br>
break;<br>
<br>
case ISL_AUX_USAGE_MCS:<br>
- assert(mt->mcs_buf);<br>
+ assert(mt->aux_buf);<br>
assert(start_level == 0 && num_levels == 1);<br>
const uint32_t level_layers =<br>
miptree_layer_range_length(mt, 0, start_layer, num_layers);<br>
@@ -2462,7 +2462,7 @@ intel_miptree_prepare_access(<wbr>struct brw_context *brw,<br>
<br>
case ISL_AUX_USAGE_CCS_D:<br>
case ISL_AUX_USAGE_CCS_E:<br>
- if (!mt->mcs_buf)<br>
+ if (!mt->aux_buf)<br>
return;<br>
<br>
for (uint32_t l = 0; l < num_levels; l++) {<br>
@@ -2478,7 +2478,7 @@ intel_miptree_prepare_access(<wbr>struct brw_context *brw,<br>
break;<br>
<br>
case ISL_AUX_USAGE_HIZ:<br>
- assert(mt->hiz_buf);<br>
+ assert(mt->aux_buf);<br>
for (uint32_t l = 0; l < num_levels; l++) {<br>
const uint32_t level = start_level + l;<br>
if (!intel_miptree_level_has_hiz(<wbr>mt, level))<br>
@@ -2512,7 +2512,7 @@ intel_miptree_finish_write(<wbr>struct brw_context *brw,<br>
break;<br>
<br>
case ISL_AUX_USAGE_MCS:<br>
- assert(mt->mcs_buf);<br>
+ assert(mt->aux_buf);<br>
for (uint32_t a = 0; a < num_layers; a++) {<br>
intel_miptree_finish_mcs_<wbr>write(brw, mt, start_layer + a,<br>
aux_usage);<br>
@@ -2521,7 +2521,7 @@ intel_miptree_finish_write(<wbr>struct brw_context *brw,<br>
<br>
case ISL_AUX_USAGE_CCS_D:<br>
case ISL_AUX_USAGE_CCS_E:<br>
- if (!mt->mcs_buf)<br>
+ if (!mt->aux_buf)<br>
return;<br>
<br>
for (uint32_t a = 0; a < num_layers; a++) {<br>
@@ -2552,7 +2552,7 @@ intel_miptree_get_aux_state(<wbr>const struct intel_mipmap_tree *mt,<br>
intel_miptree_check_level_<wbr>layer(mt, level, layer);<br>
<br>
if (_mesa_is_format_color_format(<wbr>mt->format)) {<br>
- assert(mt->mcs_buf != NULL);<br>
+ assert(mt->aux_buf != NULL);<br>
assert(mt->surf.samples == 1 ||<br>
mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY);<br>
} else if (mt->format == MESA_FORMAT_S_UINT8) {<br>
@@ -2573,7 +2573,7 @@ intel_miptree_set_aux_state(<wbr>struct brw_context *brw,<br>
num_layers = miptree_layer_range_length(mt, level, start_layer, num_layers);<br>
<br>
if (_mesa_is_format_color_format(<wbr>mt->format)) {<br>
- assert(mt->mcs_buf != NULL);<br>
+ assert(mt->aux_buf != NULL);<br>
assert(mt->surf.samples == 1 ||<br>
mt->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY);<br>
} else if (mt->format == MESA_FORMAT_S_UINT8) {<br>
@@ -2636,7 +2636,7 @@ intel_miptree_texture_aux_<wbr>usage(struct brw_context *brw,<br>
<br>
case ISL_AUX_USAGE_CCS_D:<br>
case ISL_AUX_USAGE_CCS_E:<br>
- if (!mt->mcs_buf) {<br>
+ if (!mt->aux_buf) {<br>
assert(mt->aux_usage == ISL_AUX_USAGE_CCS_D);<br>
return ISL_AUX_USAGE_NONE;<br>
}<br>
@@ -2724,12 +2724,12 @@ intel_miptree_render_aux_<wbr>usage(struct brw_context *brw,<br>
<br>
switch (mt->aux_usage) {<br>
case ISL_AUX_USAGE_MCS:<br>
- assert(mt->mcs_buf);<br>
+ assert(mt->aux_buf);<br>
return ISL_AUX_USAGE_MCS;<br>
<br>
case ISL_AUX_USAGE_CCS_D:<br>
case ISL_AUX_USAGE_CCS_E:<br>
- if (!mt->mcs_buf) {<br>
+ if (!mt->aux_buf) {<br>
assert(mt->aux_usage == ISL_AUX_USAGE_CCS_D);<br>
return ISL_AUX_USAGE_NONE;<br>
}<br>
@@ -2784,7 +2784,7 @@ intel_miptree_prepare_depth(<wbr>struct brw_context *brw,<br>
uint32_t start_layer, uint32_t layer_count)<br>
{<br>
intel_miptree_prepare_access(<wbr>brw, mt, level, 1, start_layer, layer_count,<br>
- mt->aux_usage, mt->hiz_buf != NULL);<br>
+ mt->aux_usage, mt->aux_buf != NULL);<br>
}<br>
<br>
void<br>
@@ -2795,7 +2795,7 @@ intel_miptree_finish_depth(<wbr>struct brw_context *brw,<br>
{<br>
if (depth_written) {<br>
intel_miptree_finish_write(<wbr>brw, mt, level, start_layer, layer_count,<br>
- mt->hiz_buf != NULL);<br>
+ mt->aux_buf != NULL);<br>
}<br>
}<br>
<br>
@@ -2819,7 +2819,7 @@ intel_miptree_prepare_<wbr>external(struct brw_context *brw,<br>
assert(mt->surf.logical_<wbr>level0_px.depth == 1);<br>
assert(mt->surf.logical_<wbr>level0_px.array_len == 1);<br>
assert(mt->surf.samples == 1);<br>
- assert(mt->mcs_buf != NULL);<br>
+ assert(mt->aux_buf != NULL);<br>
<br>
aux_usage = mod_info->aux_usage;<br>
supports_fast_clear = mod_info->supports_clear_<wbr>color;<br>
@@ -2834,7 +2834,7 @@ void<br>
intel_miptree_finish_external(<wbr>struct brw_context *brw,<br>
struct intel_mipmap_tree *mt)<br>
{<br>
- if (!mt->mcs_buf)<br>
+ if (!mt->aux_buf)<br>
return;<br>
<br>
/* We don't know the actual aux state of the aux surface. The previous<br>
@@ -2875,11 +2875,9 @@ intel_miptree_make_shareable(<wbr>struct brw_context *brw,<br>
0, INTEL_REMAINING_LAYERS,<br>
ISL_AUX_USAGE_NONE, false);<br>
<br>
- struct intel_miptree_aux_buffer *aux_buf = intel_miptree_get_aux_buffer(<wbr>mt);<br>
- if (aux_buf) {<br>
- intel_miptree_aux_buffer_free(<wbr>aux_buf);<br>
- mt->mcs_buf = NULL;<br>
- mt->hiz_buf = NULL;<br>
+ if (mt->aux_buf) {<br>
+ intel_miptree_aux_buffer_free(<wbr>mt->aux_buf);<br>
+ mt->aux_buf = NULL;<br>
<br>
for (uint32_t l = mt->first_level; l <= mt->last_level; ++l) {<br>
mt->level[l].has_hiz = false;<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
index 8fe5c4add67..643de962d31 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
@@ -272,16 +272,6 @@ struct intel_mipmap_tree<br>
*/<br>
uint32_t offset;<br>
<br>
- /**<br>
- * \brief HiZ aux buffer<br>
- *<br>
- * To allocate the hiz buffer, use intel_miptree_alloc_hiz().<br>
- *<br>
- * To determine if hiz is enabled, do not check this pointer. Instead, use<br>
- * intel_miptree_level_has_hiz().<br>
- */<br>
- struct intel_miptree_aux_buffer *hiz_buf;<br>
-<br>
/**<br>
* \brief The type of auxiliary compression used by this miptree.<br>
*<br>
@@ -335,15 +325,22 @@ struct intel_mipmap_tree<br>
bool r8stencil_needs_update;<br>
<br>
/**<br>
- * \brief MCS auxiliary buffer.<br>
+ * \brief MCS or HiZ auxiliary buffer.<br></blockquote><div><br></div><div>We need to talk about CCS here too. Probably break color into "multisampled color" and "single-sampled color"<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ *<br>
+ * For color miptrees:<br>
+ * This buffer contains the "multisample control surface", which stores<br>
+ * the necessary information to implement compressed MSAA<br>
+ * (INTEL_MSAA_FORMAT_CMS) and "fast color clear" behaviour on Gen7+.<br>
+ *<br>
+ * NULL if no MCS buffer is in use for this surface.<br>
*<br>
- * This buffer contains the "multisample control surface", which stores<br>
- * the necessary information to implement compressed MSAA<br>
- * (INTEL_MSAA_FORMAT_CMS) and "fast color clear" behaviour on Gen7+.<br>
+ * For depth miptrees:<br>
+ * To allocate the hiz buffer, use intel_miptree_alloc_hiz().<br>
*<br>
- * NULL if no MCS buffer is in use for this surface.<br>
+ * To determine if hiz is enabled, do not check this pointer. Instead,<br>
+ * use intel_miptree_level_has_hiz().<br>
*/<br>
- struct intel_miptree_aux_buffer *mcs_buf;<br>
+ struct intel_miptree_aux_buffer *aux_buf;<br>
<br>
/**<br>
* Planes 1 and 2 in case this is a planar surface.<br>
@@ -488,18 +485,7 @@ get_isl_dim_layout(const struct gen_device_info *devinfo,<br>
static inline struct intel_miptree_aux_buffer *<br>
intel_miptree_get_aux_buffer(<wbr>const struct intel_mipmap_tree *mt)<br>
{<br>
- switch (mt->aux_usage) {<br>
- case ISL_AUX_USAGE_MCS:<br>
- case ISL_AUX_USAGE_CCS_D:<br>
- case ISL_AUX_USAGE_CCS_E:<br>
- return mt->mcs_buf;<br>
- case ISL_AUX_USAGE_HIZ:<br>
- return mt->hiz_buf;<br>
- case ISL_AUX_USAGE_NONE:<br>
- return NULL;<br>
- default:<br>
- unreachable("Invalid aux_usage!\n");<br>
- }<br>
+ return mt->aux_buf;<br></blockquote><div><br></div><div>This patch removes 2 of the 4 uses of this function created in patch 3. Can we remove the other two and then just drop the function?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
}<br>
<br>
void<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_tex_image.c b/src/mesa/drivers/dri/i965/<wbr>intel_tex_image.c<br>
index e25bc9a0c08..3fd227ad05d 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_tex_image.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_tex_image.c<br>
@@ -543,7 +543,7 @@ intelReleaseTexBuffer(__<wbr>DRIcontext *pDRICtx, GLint target,<br>
* should be a no-op in almost all cases. On the off chance that someone<br>
* ever triggers this, we should at least warn them.<br>
*/<br>
- if (intel_tex->mt->mcs_buf &&<br>
+ if (intel_tex->mt->aux_buf &&<br>
intel_miptree_get_aux_state(<wbr>intel_tex->mt, 0, 0) !=<br>
isl_drm_modifier_get_default_<wbr>aux_state(intel_tex->mt->drm_<wbr>modifier)) {<br>
_mesa_warning(ctx, "Aux state changed between BindTexImage and "<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.16.2<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>