<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 5, 2016 at 11:37 PM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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></blockquote><div>I just pushed the patches to rework emit_rs_state to be the same on gen8 and gen7, so you'll have to rebase but I think things are much cleaner now.<br><br></div><div>For this patch in particular, we should probably rename it to something more like "anv/pipeline/gen7: Set multisample modes"  because it doesn't really "enable" multisampling.  In some sense, multisampling was already enabled, just badly.<br><br></div><div>The other obvious thing that we need to do for MSAA on gen7 is to actually advertise sampleRateShading.  Everything else should be there with this patch, we just need to enable it and make sure we're passing the tests.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
<div class="gmail_extra"><br><div class="gmail_quote">On Aug 5, 2016 4:55 PM, "Lionel Landwerlin" <<a href="mailto:llandwerlin@gmail.com" target="_blank">llandwerlin@gmail.com</a>> wrote:<br type="attribution"><blockquote 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.reso<wbr>lve_image.whole_4_bit<br>
dEQP-VK.api.copy_and_blit.reso<wbr>lve_image.whole_8_bit<br>
dEQP-VK.api.copy_and_blit.reso<wbr>lve_image.partial_4_bit<br>
dEQP-VK.api.copy_and_blit.reso<wbr>lve_image.partial_8_bit<br>
dEQP-VK.api.copy_and_blit.reso<wbr>lve_image.with_regions_4_bit<br>
dEQP-VK.api.copy_and_blit.reso<wbr>lve_image.with_regions_8_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" target="_blank">lionel.g.landwerlin@intel.com</a><wbr>><br>
Cc: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>><br>
---<br>
 src/intel/vulkan/gen7_pipelin<wbr>e.c | 24 +++++++++++++++++-------<br>
 1 file changed, 17 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/gen7_pipeli<wbr>ne.c b/src/intel/vulkan/gen7_pipeli<wbr>ne.c<br>
index 6acdd85..5ddb922 100644<br>
--- a/src/intel/vulkan/gen7_pipeli<wbr>ne.c<br>
+++ b/src/intel/vulkan/gen7_pipeli<wbr>ne.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_i<wbr>nfo *extra)<br>
 {<br>
    struct GENX(3DSTATE_SF) sf = {<br>
@@ -56,7 +57,8 @@ gen7_emit_rs_state(struct anv_pipeline *pipeline,<br>
       /* uint32_t                                     <wbr>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>
       .TriangleStripListProvokingVe<wbr>rtexSelect   = 0,<br>
@@ -107,8 +109,16 @@ genX(graphics_pipeline_create)<wbr>(<br>
    assert(pCreateInfo->pVertexInp<wbr>utState);<br>
    emit_vertex_input(pipeline, pCreateInfo->pVertexInputState<wbr>, extra);<br>
<br>
+   if (pCreateInfo->pMultisampleStat<wbr>e &&<br>
+       pCreateInfo->pMultisampleStat<wbr>e->rasterizationSamples > 1)<br>
+      anv_finishme("VK_STRUCTURE_TYP<wbr>E_PIPELINE_MULTISAMPLE_STATE_<wbr>CREATE_INFO");<br>
+<br>
+   uint32_t samples = pCreateInfo->pMultisampleState ?<br>
+                      pCreateInfo->pMultisampleState<wbr>->rasterizationSamples : 1;<br>
+<br>
    assert(pCreateInfo->pRasteriza<wbr>tionState);<br>
-   gen7_emit_rs_state(pipeline, pCreateInfo->pRasterizationSta<wbr>te, extra);<br>
+   gen7_emit_rs_state(pipeline, pCreateInfo->pRasterizationSta<wbr>te,<br>
+                      samples, extra);<br></blockquote></div></div></div></div></blockquote><div><br></div><div>I think I marginally prefer passing pMultisampleState in, but I'm ok with samples since that's all we actually need.  Meh<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
    emit_ds_state(pipeline, pCreateInfo->pDepthStencilStat<wbr>e, pass, subpass);<br>
<br>
@@ -121,11 +131,6 @@ genX(graphics_pipeline_create)<wbr>(<br>
                      pCreateInfo->pRasterizationSta<wbr>te, extra);<br>
    emit_3dstate_streamout(pipelin<wbr>e, pCreateInfo->pRasterizationSta<wbr>te);<br>
<br>
-   if (pCreateInfo->pMultisampleStat<wbr>e &&<br>
-       pCreateInfo->pMultisampleStat<wbr>e->rasterizationSamples > 1)<br>
-      anv_finishme("VK_STRUCTURE_TYP<wbr>E_PIPELINE_MULTISAMPLE_STATE_<wbr>CREATE_INFO");<br>
-<br>
-   uint32_t samples = 1;<br>
    uint32_t log2_samples = __builtin_ffs(samples) - 1;<br>
<br>
    anv_batch_emit(&pipeline->batc<wbr>h, GENX(3DSTATE_MULTISAMPLE), ms) {<br>
@@ -312,6 +317,11 @@ genX(graphics_pipeline_create)<wbr>(<br>
          }<br>
<br>
          wm.BarycentricInterpolationMod<wbr>e        = wm_prog_data->barycentric_inte<wbr>rp_modes;<br>
+<br>
+         wm.MultisampleRasterizationMo<wbr>de        = samples > 1 ?<br>
+                                                  MSRASTMODE_ON_PATTERN : MSRASTMODE_OFF_PIXEL;<br>
+         wm.MultisampleDispatchMode             = wm_prog_data->persample_dispat<wbr>ch ?<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" target="_blank">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>
</div></div></blockquote></div><br></div></div>