[Mesa-dev] [RFC 2/2] anv: enable VK_EXT_shader_stencil_export

Kenneth Graunke kenneth at whitecape.org
Wed Feb 14 09:18:12 UTC 2018


On Sunday, February 11, 2018 6:26:41 PM PST Gustavo Lima Chaves wrote:
> ---
>  src/intel/vulkan/anv_extensions.py | 1 +
>  src/intel/vulkan/anv_pipeline.c    | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py
> index 581921e62a..628778caa6 100644
> --- a/src/intel/vulkan/anv_extensions.py
> +++ b/src/intel/vulkan/anv_extensions.py
> @@ -86,6 +86,7 @@ EXTENSIONS = [
>      Extension('VK_KHX_multiview',                         1, True),
>      Extension('VK_EXT_debug_report',                      8, True),
>      Extension('VK_EXT_external_memory_dma_buf',           1, True),
> +    Extension('VK_EXT_shader_stencil_export',             1, True),
>  ]
>  
>  class VkVersion:
> diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
> index e16a7a1994..a80ce686fd 100644
> --- a/src/intel/vulkan/anv_pipeline.c
> +++ b/src/intel/vulkan/anv_pipeline.c
> @@ -143,6 +143,7 @@ anv_shader_compile_to_nir(struct anv_pipeline *pipeline,
>           .multiview = true,
>           .variable_pointers = true,
>           .storage_16bit = device->instance->physicalDevice.info.gen >= 8,
> +         .stencil_export = true,
>        },
>     };
>  
> 

Hi Gustavo,

Intel hardware only gained the ability to write a stencil reference
value from the fragment shader on Skylake (Gen 9).  So, you'll probably
want to make this:

         .stencil_export = device->instance->physicalDevice.info.gen >= 9,

I don't know if there's something more you'll need to do in order to
avoid advertising the Vulkan extension (VK_EXT_shader_stencil_export)
on earlier generations, too.  I'll defer to Jason on that one.

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180214/05d0dbdd/attachment.sig>


More information about the mesa-dev mailing list