<p dir="ltr">I am going to try and give this a proper look on Monday.  Given how sketchy the multisampling support is on gen7 at the moment, I am a but concerned that it doesn't fix more tests.  What's left to fix for MSAA?</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Aug 5, 2016 4:55 PM, "Lionel Landwerlin" <<a href="mailto:llandwerlin@gmail.com">llandwerlin@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fixes the following failures :<br>
<br>
dEQP-VK.api.copy_and_blit.<wbr>resolve_image.whole_4_bit<br>
dEQP-VK.api.copy_and_blit.<wbr>resolve_image.whole_8_bit<br>
dEQP-VK.api.copy_and_blit.<wbr>resolve_image.partial_4_bit<br>
dEQP-VK.api.copy_and_blit.<wbr>resolve_image.partial_8_bit<br>
dEQP-VK.api.copy_and_blit.<wbr>resolve_image.with_regions_4_<wbr>bit<br>
dEQP-VK.api.copy_and_blit.<wbr>resolve_image.with_regions_8_<wbr>bit<br>
<br>
Tested on IVB/HSW<br>
<br>
v2: Check pMultisampleState is not NULL<br>
<br>
v3: Drop rasterization state rename (Anuj)<br>
  Â  Fix value of MultisampleRasterizationMode in 3DSTATE_SF<br>
<br>
Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com">lionel.g.landwerlin@intel.com</a><wbr>><br>
Cc: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>><br>
---<br>
 src/intel/vulkan/gen7_<wbr>pipeline.c | 24 +++++++++++++++++-------<br>
 1 file changed, 17 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/gen7_<wbr>pipeline.c b/src/intel/vulkan/gen7_<wbr>pipeline.c<br>
index 6acdd85..5ddb922 100644<br>
--- a/src/intel/vulkan/gen7_<wbr>pipeline.c<br>
+++ b/src/intel/vulkan/gen7_<wbr>pipeline.c<br>
@@ -37,6 +37,7 @@<br>
 static void<br>
 gen7_emit_rs_state(struct anv_pipeline *pipeline,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  const VkPipelineRasterizationStateCr<wbr>eateInfo *info,<br>
+  Â  Â  Â  Â  Â  Â  Â  Â  Â uint32_t samples,<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  const struct anv_graphics_pipeline_create_<wbr>info *extra)<br>
 {<br>
  Â  struct GENX(3DSTATE_SF) sf = {<br>
@@ -56,7 +57,8 @@ gen7_emit_rs_state(struct anv_pipeline *pipeline,<br>
  Â  Â  Â /* uint32_t  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â LineEndCapAntialiasingRegionWi<wbr>dth; */<br>
  Â  Â  Â .ScissorRectangleEnable  Â  Â  Â  Â  Â  Â  Â  Â  Â =  !(extra && extra->use_rectlist),<br>
<br>
-  Â  Â  /* uint32_t  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â MultisampleRasterizationMode; */<br>
+  Â  Â  .MultisampleRasterizationMode  Â  Â  Â  Â  Â  Â = samples > 1 ?<br>
+  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  MSRASTMODE_ON_PATTERN : MSRASTMODE_OFF_PIXEL,<br>
  Â  Â  Â /* bool  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â LastPixelEnable; */<br>
<br>
  Â  Â  Â .<wbr>TriangleStripListProvokingVert<wbr>exSelect  Â = 0,<br>
@@ -107,8 +109,16 @@ genX(graphics_pipeline_create)<wbr>(<br>
  Â  assert(pCreateInfo-><wbr>pVertexInputState);<br>
  Â  emit_vertex_input(pipeline, pCreateInfo-><wbr>pVertexInputState, extra);<br>
<br>
+  Â if (pCreateInfo-><wbr>pMultisampleState &&<br>
+  Â  Â  Â pCreateInfo-><wbr>pMultisampleState-><wbr>rasterizationSamples > 1)<br>
+  Â  Â  anv_finishme("VK_STRUCTURE_<wbr>TYPE_PIPELINE_MULTISAMPLE_<wbr>STATE_CREATE_INFO");<br>
+<br>
+  Â uint32_t samples = pCreateInfo->pMultisampleState ?<br>
+  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  pCreateInfo-><wbr>pMultisampleState-><wbr>rasterizationSamples : 1;<br>
+<br>
  Â  assert(pCreateInfo-><wbr>pRasterizationState);<br>
-  Â gen7_emit_rs_state(pipeline, pCreateInfo-><wbr>pRasterizationState, extra);<br>
+  Â gen7_emit_rs_state(pipeline, pCreateInfo-><wbr>pRasterizationState,<br>
+  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  samples, extra);<br>
<br>
  Â  emit_ds_state(pipeline, pCreateInfo-><wbr>pDepthStencilState, pass, subpass);<br>
<br>
@@ -121,11 +131,6 @@ genX(graphics_pipeline_create)<wbr>(<br>
  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  pCreateInfo-><wbr>pRasterizationState, extra);<br>
  Â  emit_3dstate_streamout(<wbr>pipeline, pCreateInfo-><wbr>pRasterizationState);<br>
<br>
-  Â if (pCreateInfo-><wbr>pMultisampleState &&<br>
-  Â  Â  Â pCreateInfo-><wbr>pMultisampleState-><wbr>rasterizationSamples > 1)<br>
-  Â  Â  anv_finishme("VK_STRUCTURE_<wbr>TYPE_PIPELINE_MULTISAMPLE_<wbr>STATE_CREATE_INFO");<br>
-<br>
-  Â uint32_t samples = 1;<br>
  Â  uint32_t log2_samples = __builtin_ffs(samples) - 1;<br>
<br>
  Â  anv_batch_emit(&pipeline-><wbr>batch, GENX(3DSTATE_MULTISAMPLE), ms) {<br>
@@ -312,6 +317,11 @@ genX(graphics_pipeline_create)<wbr>(<br>
  Â  Â  Â  Â  }<br>
<br>
  Â  Â  Â  Â  wm.<wbr>BarycentricInterpolationMode  Â  Â  Â  = wm_prog_data->barycentric_<wbr>interp_modes;<br>
+<br>
+  Â  Â  Â  Â wm.<wbr>MultisampleRasterizationMode  Â  Â  Â  = samples > 1 ?<br>
+  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  MSRASTMODE_ON_PATTERN : MSRASTMODE_OFF_PIXEL;<br>
+  Â  Â  Â  Â wm.MultisampleDispatchMode  Â  Â  Â  Â  Â  Â = wm_prog_data->persample_<wbr>dispatch ?<br>
+  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  MSDISPMODE_PERSAMPLE : MSDISPMODE_PERPIXEL;<br>
  Â  Â  Â }<br>
  Â  }<br>
<font color="#888888"><br>
--<br>
2.8.1<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></blockquote></div><br></div>