<p dir="ltr">On Aug 5, 2016 11:37 PM, "Jason Ekstrand" <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
><br>
> 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>
<p dir="ltr">Also, I think I've mentioned this somewhere before, but I think it is time to unify emit_rs_state between gen7 and gen8 and move it to genX_pipeline_until.h.  This shouldn't be too bad but requires a bit of creativity since it's one packet on gen7 but two on gen8+.  Unifying it based on the gen8 version should also help us make sure we haven't missed anything.</p>
<p dir="ltr">> On Aug 5, 2016 4:55 PM, "Lionel Landwerlin" <<a href="mailto:llandwerlin@gmail.com">llandwerlin@gmail.com</a>> wrote:<br>
>><br>
>> Fixes the following failures :<br>
>><br>
>> dEQP-VK.api.copy_and_blit.resolve_image.whole_4_bit<br>
>> dEQP-VK.api.copy_and_blit.resolve_image.whole_8_bit<br>
>> dEQP-VK.api.copy_and_blit.resolve_image.partial_4_bit<br>
>> dEQP-VK.api.copy_and_blit.resolve_image.partial_8_bit<br>
>> dEQP-VK.api.copy_and_blit.resolve_image.with_regions_4_bit<br>
>> dEQP-VK.api.copy_and_blit.resolve_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">lionel.g.landwerlin@intel.com</a>><br>
>> Cc: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>><br>
>> ---<br>
>>  src/intel/vulkan/gen7_pipeline.c | 24 +++++++++++++++++-------<br>
>>  1 file changed, 17 insertions(+), 7 deletions(-)<br>
>><br>
>> diff --git a/src/intel/vulkan/gen7_pipeline.c b/src/intel/vulkan/gen7_pipeline.c<br>
>> index 6acdd85..5ddb922 100644<br>
>> --- a/src/intel/vulkan/gen7_pipeline.c<br>
>> +++ b/src/intel/vulkan/gen7_pipeline.c<br>
>> @@ -37,6 +37,7 @@<br>
>>  static void<br>
>>  gen7_emit_rs_state(struct anv_pipeline *pipeline,<br>
>>                     const VkPipelineRasterizationStateCreateInfo *info,<br>
>> +                   uint32_t samples,<br>
>>                     const struct anv_graphics_pipeline_create_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                                     LineEndCapAntialiasingRegionWidth; */<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>
>>        .TriangleStripListProvokingVertexSelect   = 0,<br>
>> @@ -107,8 +109,16 @@ genX(graphics_pipeline_create)(<br>
>>     assert(pCreateInfo->pVertexInputState);<br>
>>     emit_vertex_input(pipeline, pCreateInfo->pVertexInputState, extra);<br>
>><br>
>> +   if (pCreateInfo->pMultisampleState &&<br>
>> +       pCreateInfo->pMultisampleState->rasterizationSamples > 1)<br>
>> +      anv_finishme("VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO");<br>
>> +<br>
>> +   uint32_t samples = pCreateInfo->pMultisampleState ?<br>
>> +                      pCreateInfo->pMultisampleState->rasterizationSamples : 1;<br>
>> +<br>
>>     assert(pCreateInfo->pRasterizationState);<br>
>> -   gen7_emit_rs_state(pipeline, pCreateInfo->pRasterizationState, extra);<br>
>> +   gen7_emit_rs_state(pipeline, pCreateInfo->pRasterizationState,<br>
>> +                      samples, extra);<br>
>><br>
>>     emit_ds_state(pipeline, pCreateInfo->pDepthStencilState, pass, subpass);<br>
>><br>
>> @@ -121,11 +131,6 @@ genX(graphics_pipeline_create)(<br>
>>                       pCreateInfo->pRasterizationState, extra);<br>
>>     emit_3dstate_streamout(pipeline, pCreateInfo->pRasterizationState);<br>
>><br>
>> -   if (pCreateInfo->pMultisampleState &&<br>
>> -       pCreateInfo->pMultisampleState->rasterizationSamples > 1)<br>
>> -      anv_finishme("VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO");<br>
>> -<br>
>> -   uint32_t samples = 1;<br>
>>     uint32_t log2_samples = __builtin_ffs(samples) - 1;<br>
>><br>
>>     anv_batch_emit(&pipeline->batch, GENX(3DSTATE_MULTISAMPLE), ms) {<br>
>> @@ -312,6 +317,11 @@ genX(graphics_pipeline_create)(<br>
>>           }<br>
>><br>
>>           wm.BarycentricInterpolationMode        = wm_prog_data->barycentric_interp_modes;<br>
>> +<br>
>> +         wm.MultisampleRasterizationMode        = samples > 1 ?<br>
>> +                                                  MSRASTMODE_ON_PATTERN : MSRASTMODE_OFF_PIXEL;<br>
>> +         wm.MultisampleDispatchMode             = wm_prog_data->persample_dispatch ?<br>
>> +                                                  MSDISPMODE_PERSAMPLE : MSDISPMODE_PERPIXEL;<br>
>>        }<br>
>>     }<br>
>><br>
>> --<br>
>> 2.8.1<br>
>><br>
>> _______________________________________________<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">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
><br>
></p>