<p dir="ltr"></p>
<p dir="ltr">On Jul 26, 2016 12:54 PM, "Anuj Phogat" <<a href="mailto:anuj.phogat@gmail.com">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">jason@jlekstrand.net</a>><br>
> Signed-off-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">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">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>
<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>
<p dir="ltr">--Jason</p>
<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>