<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 27, 2017 at 11:32 AM, 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">This will be used in conjunction with the buffer of clear values.<br>
<br>
Signed-off-by: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
---<br>
src/intel/vulkan/anv_blorp.c | 41 ++++++++++++++++++++++++++++++<wbr>+++++++++++<br>
src/intel/vulkan/anv_private.h | 6 ++++++<br>
2 files changed, 47 insertions(+)<br>
<br>
diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c<br>
index 5e7d4b06b8..332ad14b37 100644<br>
--- a/src/intel/vulkan/anv_blorp.c<br>
+++ b/src/intel/vulkan/anv_blorp.c<br>
@@ -1611,3 +1611,44 @@ anv_gen8_hiz_op_resolve(struct anv_cmd_buffer *cmd_buffer,<br>
blorp_gen6_hiz_op(&batch, &surf, 0, 0, op);<br>
blorp_batch_finish(&batch);<br>
}<br>
+<br>
+void<br>
+anv_ccs_resolve(struct anv_cmd_buffer * const cmd_buffer,<br>
+ const struct anv_state surface_state,<br>
+ const struct anv_image * const image,<br>
+ const uint8_t level, const uint32_t layer,<br>
+ const enum blorp_fast_clear_op op)<br>
+{<br>
+ assert(cmd_buffer && image);<br>
+<br>
+ /* This image must have a CCS buffer. */<br>
+ assert(anv_image_has_color_<wbr>aux(image) &&<br>
+ image->samples == 1);<br>
+<br>
+ /* This level and layer must have auxiliary data. */<br>
+ assert(level < anv_color_aux_levels(image));<br>
+ assert(layer < anv_color_aux_layers(image, level));<br>
+<br>
+ /* Create a binding table for this surface state. */<br>
+ uint32_t binding_table;<br>
+ VkResult result =<br>
+ binding_table_for_surface_<wbr>state(cmd_buffer, surface_state,<br>
+ &binding_table);<br>
+ if (result != VK_SUCCESS)<br>
+ return;<br>
+<br>
+ struct blorp_batch batch;<br>
+ blorp_batch_init(&cmd_buffer-><wbr>device->blorp, &batch, cmd_buffer,<br>
+ BLORP_BATCH_NO_EMIT_DEPTH_<wbr>STENCIL);<br></blockquote><div><br></div><div>I'm not sure we actually want NO_EMIT_DEPTH_STENCIL here.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+ struct blorp_surf surf;<br>
+ get_blorp_surf_for_anv_image(<wbr>image, VK_IMAGE_ASPECT_COLOR_BIT,<br>
+ image->aux_usage == ISL_AUX_USAGE_CCS_E ?<br>
+ ISL_AUX_USAGE_CCS_E : ISL_AUX_USAGE_CCS_D,<br></blockquote><div><br></div><div>So, if aux_usage == NONE, we give it CCS_D? That seems a bit weird.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ &surf);<br>
+<br>
+ blorp_ccs_resolve_bt(&batch, binding_table, &surf, level, layer,<br>
+ image->color_surface.isl.<wbr>format, op);<br>
+<br>
+ blorp_batch_finish(&batch);<br>
+}<br>
diff --git a/src/intel/vulkan/anv_<wbr>private.h b/src/intel/vulkan/anv_<wbr>private.h<br>
index b49a5a0009..667176270a 100644<br>
--- a/src/intel/vulkan/anv_<wbr>private.h<br>
+++ b/src/intel/vulkan/anv_<wbr>private.h<br>
@@ -2040,6 +2040,12 @@ void<br>
anv_gen8_hiz_op_resolve(struct anv_cmd_buffer *cmd_buffer,<br>
const struct anv_image *image,<br>
enum blorp_hiz_op op);<br>
+void<br>
+anv_ccs_resolve(struct anv_cmd_buffer * const cmd_buffer,<br>
+ const struct anv_state surface_state,<br>
+ const struct anv_image * const image,<br>
+ const uint8_t level, const uint32_t layer,<br>
+ const enum blorp_fast_clear_op op);<br>
<br>
enum isl_aux_usage<br>
anv_layout_to_aux_usage(const struct gen_device_info * const devinfo,<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.12.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>