<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 5, 2016 at 1:23 PM, Anuj Phogat <span dir="ltr"><<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Aug 5, 2016 at 10:05 AM, Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a><wbr>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Fixes 6 failures from dEQP-VK.api.copy_and_blit.reso<wbr>lve_image.*<br></blockquote></span><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">No tests are run with --deqp-case=dEQP-VK.api.copy_a<wbr>nd_blit.resolve_image.*</div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline"><br></div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">This is what i'm seeing on hsw without this patch:</div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">./deqp-vk --deqp-case=dEQP-VK.api.copy_a<wbr>nd_blit*</div></div><div><div style="display:inline"><div><font face="verdana, sans-serif">Test run totals:</font></div><div><font face="verdana, sans-serif"> Passed: 9/11 (81.8%)</font></div><div><font face="verdana, sans-serif"> Failed: 0/11 (0.0%)</font></div><div><font face="verdana, sans-serif"> Not supported: 2/11 (18.2%)</font></div><div><font face="verdana, sans-serif"> Warnings: 0/11 (0.0%)</font></div></div></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
Tested on IVB/HSW<br>
<br>
v2: Program multisample dispatch mode correctly<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>
---<br>
src/intel/vulkan/gen7_pipelin<wbr>e.c | 46 ++++++++++++++++++++++++++----<wbr>----------<br>
1 file changed, 30 insertions(+), 16 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..2611a2d 100644<br>
--- a/src/intel/vulkan/gen7_pipeli<wbr>ne.c<br>
+++ b/src/intel/vulkan/gen7_pipeli<wbr>ne.c<br>
@@ -36,27 +36,34 @@<br>
<br>
static void<br>
gen7_emit_rs_state(struct anv_pipeline *pipeline,<br>
- const VkPipelineRasterizationStateCr<wbr>eateInfo *info,<br>
+ const VkPipelineRasterizationStateCr<wbr>eateInfo *rs_info,<br>
+ const VkPipelineMultisampleStateCrea<wbr>teInfo *ms_info,<br>
const struct anv_graphics_pipeline_create_i<wbr>nfo *extra)<br>
{<br>
+ uint32_t samples = 1;<br>
+<br>
+ if (ms_info)<br>
+ samples = ms_info->rasterizationSamples;<br>
+<br>
struct GENX(3DSTATE_SF) sf = {<br>
GENX(3DSTATE_SF_header),<br>
<br>
/* LegacyGlobalDepthBiasEnable */<br>
<br>
.StatisticsEnable = true,<br>
- .FrontFaceFillMode = vk_to_gen_fillmode[info->polyg<wbr>onMode],<br>
- .BackFaceFillMode = vk_to_gen_fillmode[info->polyg<wbr>onMode],<br>
+ .FrontFaceFillMode = vk_to_gen_fillmode[rs_info->po<wbr>lygonMode],<br>
+ .BackFaceFillMode = vk_to_gen_fillmode[rs_info->po<wbr>lygonMode],<br>
.ViewTransformEnable = !(extra && extra->use_rectlist),<br>
- .FrontWinding = vk_to_gen_front_face[info->fro<wbr>ntFace],<br>
+ .FrontWinding = vk_to_gen_front_face[rs_info-><wbr>frontFace],<br>
/* bool AntiAliasingEnable; */<br>
<br>
- .CullMode = vk_to_gen_cullmode[info->cullM<wbr>ode],<br>
+ .CullMode = vk_to_gen_cullmode[rs_info->cu<wbr>llMode],<br>
<br>
/* uint32_t LineEndCapAntialiasingRegionW<wbr>idth; */<br>
.ScissorRectangleEnable = !(extra && extra->use_rectlist),<br>
<br>
- /* uint32_t MultisampleRasterizationMode; */<br>
+ .MultisampleRasterizationMode = samples > 1 ?<br>
+ MSDISPMODE_PERPIXEL : MSDISPMODE_PERSAMPLE,<br>
/* bool LastPixelEnable; */<br>
<br>
.TriangleStripListProvokingVe<wbr>rtexSelect = 0,<br>
@@ -67,9 +74,9 @@ gen7_emit_rs_state(struct anv_pipeline *pipeline,<br>
/* uint32_t VertexSubPixelPrecisionSelect<wbr>; */<br>
.UsePointWidthState = false,<br>
.PointWidth = 1.0,<br>
- .GlobalDepthOffsetEnableSolid = info->depthBiasEnable,<br>
- .GlobalDepthOffsetEnableWirefr<wbr>ame = info->depthBiasEnable,<br>
- .GlobalDepthOffsetEnablePoint = info->depthBiasEnable,<br>
+ .GlobalDepthOffsetEnableSolid = rs_info->depthBiasEnable,<br>
+ .GlobalDepthOffsetEnableWirefr<wbr>ame = rs_info->depthBiasEnable,<br>
+ .GlobalDepthOffsetEnablePoint = rs_info->depthBiasEnable,<br>
};<br>
<br>
GENX(3DSTATE_SF_pack)(NULL, &pipeline->gen7.sf, &sf);<br>
@@ -108,7 +115,8 @@ genX(graphics_pipeline_create)<wbr>(<br>
emit_vertex_input(pipeline, pCreateInfo->pVertexInputState<wbr>, extra);<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>
+ pCreateInfo->pMultisampleState<wbr>, extra);<br></blockquote></div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">It'll be nice to split the patch in to two:</div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">- First one carries changes for info -> rs_info.</div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">- Second one with rest of the changes.</div></div></div></div></div></blockquote><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline">On second look we don't need ms_info in gen7_emit_rs_state. We should</div></div><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline">use wm_prog_data to set </div> MultisampleRasterizationMode<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline">. However I noted</div></div><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline">that we're not setting this bit on i965.</div></div><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">FYI: I've few wip patches in my 'dev' branch at <a href="https://github.com/aphogat/mesa.git">https://github.com/aphogat/mesa.git</a></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">One of them is duplicating some work in this patch. I'm working on fixing 8 failing</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">multisample tests (./deqp-vk --deqp-case=dEQP-VK.pipeline.multisample*) with</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">this branch, before I send out the series for review. That said, I'll be happy to</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">land your patch with all comments fixed.</div></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Thanks</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Anuj</div><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline"></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
emit_ds_state(pipeline, pCreateInfo->pDepthStencilStat<wbr>e, pass, subpass);<br>
<br>
@@ -121,14 +129,13 @@ 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_C<wbr>REATE_INFO");<br>
-<br>
- uint32_t samples = 1;<br>
+ uint32_t samples = pCreateInfo->pMultisampleState<wbr>->rasterizationSamples;<br>
uint32_t log2_samples = __builtin_ffs(samples) - 1;<br>
<br>
anv_batch_emit(&pipeline->batc<wbr>h, GENX(3DSTATE_MULTISAMPLE), ms) {<br>
+#if GEN_IS_HASWELL<br>
+ ms.MultiSampleEnable = samples > 1;<br>
+#endif<br></blockquote></span><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">We're not setting this bit in i965 driver without any issues. There is also a h/w</div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">issue listed in docs </div><span style="font-family:verdana,sans-serif">for this bit on hsw.</span></div><span class=""><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline"></div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
ms.PixelLocation = PIXLOC_CENTER;<br>
ms.NumberofMultisamples = log2_samples;<br>
}<br>
@@ -139,7 +146,7 @@ genX(graphics_pipeline_create)<wbr>(<br>
<br>
const struct brw_vs_prog_data *vs_prog_data = get_vs_prog_data(pipeline);<br>
<br>
-#if 0<br>
+#if 0<br>
/* From gen7_vs_state.c */<br>
<br>
/**<br>
@@ -233,6 +240,8 @@ genX(graphics_pipeline_create)<wbr>(<br>
wm.LineAntialiasingRegionWidth<wbr> = 1; /* 1.0 pixels */<br>
wm.EarlyDepthStencilControl = EDSC_NORMAL;<br>
wm.PointRasterizationRule = RASTRULE_UPPER_RIGHT;<br>
+ wm.MultisampleDispatchMode = samples > 1 ?<br>
+ MSDISPMODE_PERPIXEL : MSDISPMODE_PERSAMPLE;<br></blockquote></span><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">Use </div> wm_prog_data->persample_dispa<wbr>tch<div style="font-family:verdana,sans-serif;font-size:small;display:inline"> here. I'm not sure if we really</div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">need this when there is no fragment shader.</div></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
}<br>
<br>
/* Even if no fragments are ever dispatched, the hardware hangs if we<br>
@@ -312,6 +321,11 @@ genX(graphics_pipeline_create)<wbr>(<br>
}<br>
<br>
wm.BarycentricInterpolationMod<wbr>e = wm_prog_data->barycentric_inte<wbr>rp_modes;<br>
+<br>
+ wm.MultisampleDispatchMode = samples > 1 ?<br>
+ MSRASTMODE_ON_PATTERN : MSRASTMODE_OFF_PIXEL;<br></blockquote></span><div> Use wm_prog_data->persample_dispat<wbr>ch here.</div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
+ wm.MultisampleDispatchMode = wm_prog_data->persample_dispat<wbr>ch ?<br>
+ MSDISPMODE_PERSAMPLE : MSDISPMODE_PERPIXEL;<br></blockquote></span><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">You're setting the same field twice with different values here. Keep the 2nd line</div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">aligned to </div> <div style="font-family:verdana,sans-serif;font-size:small;display:inline">"wm_prog_data->persample_dis<wbr>patch".</div></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
}<br>
}<br>
<span><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></span></blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>