radv/gfx10: implement VK_EXT_post_depth_coverage
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 16 Jul 2019 15:11:50 +0000 (17:11 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 17 Jul 2019 06:32:39 +0000 (08:32 +0200)
I did implement this extension a while ago but it didn't work
on pre GFX10 for some reasons. Now all CTS pass.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_extensions.py
src/amd/vulkan/radv_nir_to_llvm.c
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_shader.c
src/amd/vulkan/radv_shader.h

index 8b6ba6a4df0cc51163491f031cd15cc05b25caef..e9addad0035d68e4aee7a2d7079598aeb9d1a4d6 100644 (file)
@@ -120,6 +120,7 @@ EXTENSIONS = [
     Extension('VK_EXT_memory_priority',                   1, True),
     Extension('VK_EXT_pci_bus_info',                      2, True),
     Extension('VK_EXT_pipeline_creation_feedback',        1, True),
+    Extension('VK_EXT_post_depth_coverage',               1, 'device->rad_info.chip_class >= GFX10'),
     Extension('VK_EXT_queue_family_foreign',              1, True),
     Extension('VK_EXT_sample_locations',                  1, True),
     Extension('VK_EXT_sampler_filter_minmax',             1, 'device->rad_info.chip_class >= GFX7'),
index a689003d4730a20540890be3fde03e0e00f45348..3e18303879ec230520cda3f9d1619f4de24317ed 100644 (file)
@@ -4637,6 +4637,7 @@ ac_fill_shader_info(struct radv_shader_variant_info *shader_info, struct nir_sha
                 break;
         case MESA_SHADER_FRAGMENT:
                 shader_info->fs.early_fragment_test = nir->info.fs.early_fragment_tests;
+                shader_info->fs.post_depth_coverage = nir->info.fs.post_depth_coverage;
                 break;
         case MESA_SHADER_GEOMETRY:
                 shader_info->gs.vertices_in = nir->info.gs.vertices_in;
index a22e605ca1c6ee95c72c0cbde5d6ba610eee66ad..a3323ae8135d0595721d9d2ea5ab55307001817e 100644 (file)
@@ -3849,6 +3849,7 @@ radv_compute_db_shader_control(const struct radv_device *device,
                S_02880C_MASK_EXPORT_ENABLE(mask_export_enable) |
                S_02880C_Z_ORDER(z_order) |
                S_02880C_DEPTH_BEFORE_SHADER(ps->info.fs.early_fragment_test) |
+               S_02880C_PRE_SHADER_DEPTH_COVERAGE_ENABLE(ps->info.fs.post_depth_coverage) |
                S_02880C_EXEC_ON_HIER_FAIL(ps->info.info.ps.writes_memory) |
                S_02880C_EXEC_ON_NOOP(ps->info.info.ps.writes_memory) |
                S_02880C_DUAL_QUAD_DISABLE(disable_rbplus);
index 6bafcb2f8692382caf6c632a075dacbb8aa45599..bcc050a86ccd04036b8cfc1d96180480dc14ec1d 100644 (file)
@@ -270,6 +270,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
                                .int64_atomics = true,
                                .multiview = true,
                                .physical_storage_buffer_address = true,
+                               .post_depth_coverage = true,
                                .runtime_descriptor_array = true,
                                .shader_viewport_index_layer = true,
                                .stencil_export = true,
index 360591349a86935e191b7afc3e5291504a28a445..fea0d1c8df17ae7c01ed6cc5fcc2f86b013b3b63 100644 (file)
@@ -283,6 +283,7 @@ struct radv_shader_variant_info {
                        uint32_t float16_shaded_mask;
                        bool can_discard;
                        bool early_fragment_test;
+                       bool post_depth_coverage;
                } fs;
                struct {
                        unsigned block_size[3];