<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 Tue, Jul 26, 2016 at 7:27 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div><p dir="ltr"></p>
<p dir="ltr">On Jul 26, 2016 12:54 PM, "Anuj Phogat" <<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>> wrote:<br>
><br>
> Fixes ~45 DEQP sample shading tests:<br>
> ./deqp-vk --deqp-case=dEQP-VK.pipeline.multisample.min_sample_shading*<br>
><br>
> Many tests exited with VK_ERROR_OUT_OF_DEVICE_MEMORY without this patch.<br>
><br>
> Cc: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br>
> Signed-off-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>><br>
><br>
> ---<br>
> Another patch enabling the sample shading is required to test this patch.<br>
> I'll send out the enabling patch once we pass all the sample shading tests.<br>
> Use <a href="https://github.com/aphogat/mesa" target="_blank">https://github.com/aphogat/mesa</a>, branch: review to test the patch.<br>
> ---<br>
> src/intel/vulkan/gen7_pipeline.c | 9 ++++++++-<br>
> src/intel/vulkan/gen8_pipeline.c | 12 ++++++++----<br>
> 2 files changed, 16 insertions(+), 5 deletions(-)<br>
><br>
> diff --git a/src/intel/vulkan/gen7_pipeline.c b/src/intel/vulkan/gen7_pipeline.c<br>
> index 8ce50be..23535f5 100644<br>
> --- a/src/intel/vulkan/gen7_pipeline.c<br>
> +++ b/src/intel/vulkan/gen7_pipeline.c<br>
> @@ -249,6 +249,8 @@ genX(graphics_pipeline_create)(<br>
> anv_finishme("primitive_id needs sbe swizzling setup");<br>
><br>
> emit_3dstate_sbe(pipeline);<br>
> + bool per_sample_ps = pCreateInfo->pMultisampleState &&<br>
> + pCreateInfo->pMultisampleState->sampleShadingEnable;<br>
><br>
> anv_batch_emit(&pipeline->batch, GENX(3DSTATE_PS), ps) {<br>
> ps.KernelStartPointer0 = pipeline->ps_ksp0;<br>
> @@ -274,7 +276,12 @@ genX(graphics_pipeline_create)(<br>
><br>
> ps._32PixelDispatchEnable = false;<br>
> ps._16PixelDispatchEnable = wm_prog_data->dispatch_16;<br>
> - ps._8PixelDispatchEnable = wm_prog_data->dispatch_8;<br>
> + /* On all hardware generations, the only configurations supporting<br>
> + * persample dispatch are in which only one dispatch width is enabled.<br>
> + */<br>
> + ps._8PixelDispatchEnable = wm_prog_data->dispatch_8 &&<br>
> + (!per_sample_ps ||<br>
> + !wm_prog_data->dispatch_16);</p>
</div></div><p dir="ltr">I don't think we need to do this. brw_compile_fs in brw_fs.cpp should handle this for us based on the shader key. We should be able to just set the shader key bits correctly and then trust brw_compile_fs to give us only one dispatch width.</p></blockquote><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline">Sounds better. I'll look into how I accommodate the logic in brw_compile_fs. Thanks.</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"><span><font color="#888888">
<p dir="ltr">--Jason</p></font></span><div><div>
<p dir="ltr">><br>
> ps.DispatchGRFStartRegisterforConstantSetupData0 =<br>
> wm_prog_data->base.dispatch_grf_start_reg,<br>
> diff --git a/src/intel/vulkan/gen8_pipeline.c b/src/intel/vulkan/gen8_pipeline.c<br>
> index cc10d3a..bde7660 100644<br>
> --- a/src/intel/vulkan/gen8_pipeline.c<br>
> +++ b/src/intel/vulkan/gen8_pipeline.c<br>
> @@ -333,12 +333,19 @@ genX(graphics_pipeline_create)(<br>
> }<br>
> } else {<br>
> emit_3dstate_sbe(pipeline);<br>
> + bool per_sample_ps = pCreateInfo->pMultisampleState &&<br>
> + pCreateInfo->pMultisampleState->sampleShadingEnable;<br>
><br>
> anv_batch_emit(&pipeline->batch, GENX(3DSTATE_PS), ps) {<br>
> ps.KernelStartPointer0 = pipeline->ps_ksp0;<br>
> ps.KernelStartPointer1 = 0;<br>
> ps.KernelStartPointer2 = pipeline->ps_ksp0 + wm_prog_data->prog_offset_2;<br>
> - ps._8PixelDispatchEnable = wm_prog_data->dispatch_8;<br>
> + /* On all hardware generations, the only configurations supporting<br>
> + * persample dispatch are in which only one dispatch width is enabled.<br>
> + */<br>
> + ps._8PixelDispatchEnable = wm_prog_data->dispatch_8 &&<br>
> + (!per_sample_ps ||<br>
> + !wm_prog_data->dispatch_16);<br>
> ps._16PixelDispatchEnable = wm_prog_data->dispatch_16;<br>
> ps._32PixelDispatchEnable = false;<br>
> ps.SingleProgramFlow = false;<br>
> @@ -365,9 +372,6 @@ genX(graphics_pipeline_create)(<br>
> wm_prog_data->dispatch_grf_start_reg_2;<br>
> }<br>
><br>
> - bool per_sample_ps = pCreateInfo->pMultisampleState &&<br>
> - pCreateInfo->pMultisampleState->sampleShadingEnable;<br>
> -<br>
> anv_batch_emit(&pipeline->batch, GENX(3DSTATE_PS_EXTRA), ps) {<br>
> ps.PixelShaderValid = true;<br>
> ps.PixelShaderKillsPixel = wm_prog_data->uses_kill;<br>
> --<br>
> 2.5.5<br>
></p>
</div></div></blockquote></div><br></div></div>