[Mesa-dev] [PATCH 2/2] anv/gen9: expose VK_EXT_post_depth_coverage

Jason Ekstrand jason at jlekstrand.net
Fri Sep 15 21:20:49 UTC 2017


On Fri, Sep 15, 2017 at 11:18 AM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:

> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>
> Note that the use of ICMS_INNER_CONSERVATIVE disagrees with the GL driver.
> Perhaps it's more performant than ICMS_NORMAL and is otherwise permitted?
> Not sure, so I left it as-is.
>
> Also note that there are no tests for this, and I have not verified
> anything
> besides the fact that the ext shows up on a gen9 device.
>

Yeah... That's kind-of the problem with basically any EXT vulkan extension
and why I haven't hooked any of them (including this one) up yet.  Could I
interest you in at least writing a crucible test?


>  src/intel/vulkan/anv_extensions.py |  2 ++
>  src/intel/vulkan/anv_pipeline.c    |  1 +
>  src/intel/vulkan/genX_pipeline.c   | 13 +++++++++++--
>  3 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_
> extensions.py
> index acec785959..5170d48aff 100644
> --- a/src/intel/vulkan/anv_extensions.py
> +++ b/src/intel/vulkan/anv_extensions.py
> @@ -76,6 +76,8 @@ EXTENSIONS = [
>      Extension('VK_KHR_xlib_surface',                      6,
> 'VK_USE_PLATFORM_XLIB_KHR'),
>      Extension('VK_KHX_multiview',                         1, True),
>      Extension('VK_EXT_debug_report',                      8, True),
> +    Extension('VK_EXT_post_depth_coverage',               1,
> +              'device->instance->physicalDevice.info.gen >= 9'),
>

"device" in this case is the physical device.  Just "device->info.gen >= 9"
should be sufficient.


>  ]
>
>  class VkVersion:
> diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_
> pipeline.c
> index 94e99d8437..30d9d3df90 100644
> --- a/src/intel/vulkan/anv_pipeline.c
> +++ b/src/intel/vulkan/anv_pipeline.c
> @@ -130,6 +130,7 @@ anv_shader_compile_to_nir(struct anv_pipeline
> *pipeline,
>        .image_write_without_format = true,
>        .multiview = true,
>        .variable_pointers = true,
> +      .post_depth_coverage = device->instance->physicalDevice.info.gen
> >= 9,
>     };
>
>     nir_function *entry_point =
> diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_
> pipeline.c
> index 6dfa49b873..84140cd523 100644
> --- a/src/intel/vulkan/genX_pipeline.c
> +++ b/src/intel/vulkan/genX_pipeline.c
> @@ -1532,6 +1532,16 @@ emit_3dstate_ps_extra(struct anv_pipeline *pipeline,
>        return;
>     }
>
> +#if GEN_GEN >= 9
> +   uint32_t coverage = ICMS_NONE;
> +   if (wm_prog_data->uses_sample_mask) {
> +      if (wm_prog_data->post_depth_coverage)
> +         coverage = ICMS_DEPTH_COVERAGE;
> +      else
> +         coverage = ICMS_INNER_CONSERVATIVE;
> +   }
> +#endif
> +
>     anv_batch_emit(&pipeline->batch, GENX(3DSTATE_PS_EXTRA), ps) {
>        ps.PixelShaderValid              = true;
>        ps.AttributeEnable               = wm_prog_data->num_varying_inputs
> > 0;
> @@ -1583,8 +1593,7 @@ emit_3dstate_ps_extra(struct anv_pipeline *pipeline,
>
>  #if GEN_GEN >= 9
>        ps.PixelShaderPullsBary    = wm_prog_data->pulls_bary;
> -      ps.InputCoverageMaskState  = wm_prog_data->uses_sample_mask ?
> -                                   ICMS_INNER_CONSERVATIVE : ICMS_NONE;
> +      ps.InputCoverageMaskState  = coverage;
>

In the GL driver, we have this nice little if-ladder.  I think I'd prefer
that to having a temporary and pulling it into it's own "#if GEN_GEN >= 9"
block.


>  #else
>        ps.PixelShaderUsesInputCoverageMask = wm_prog_data->uses_sample_
> mask;
>  #endif
> --
> 2.13.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170915/47e45925/attachment.html>


More information about the mesa-dev mailing list