radv: enable AMD_shader_ballot with RADV_PERFTEST_SHADER_BALLOT ('shader_ballot')
authorDaniel Schürmann <daniel.schuermann@campus.tu-berlin.de>
Wed, 9 May 2018 18:43:16 +0000 (20:43 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Thu, 13 Jun 2019 12:44:23 +0000 (12:44 +0000)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/amd/vulkan/radv_debug.h
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_extensions.py
src/amd/vulkan/radv_private.h
src/amd/vulkan/radv_shader.c

index 652a3b677d2f50db9e2b03ea3827ad9745731d54..aef0139c1b06f3fbc549ac63f0f9215c48fe604b 100644 (file)
@@ -61,6 +61,7 @@ enum {
        RADV_PERFTEST_OUT_OF_ORDER   =   0x8,
        RADV_PERFTEST_DCC_MSAA       =  0x10,
        RADV_PERFTEST_BO_LIST        =  0x20,
+       RADV_PERFTEST_SHADER_BALLOT  =  0x40,
 };
 
 bool
index 3b69e45749666a60cad94c3bcc7753a70b571692..487b75491d182116d95ae00c1bb96ef1179208ca 100644 (file)
@@ -371,6 +371,8 @@ radv_physical_device_init(struct radv_physical_device *device,
                                       (device->rad_info.chip_class >= GFX8 &&
                                        device->rad_info.me_fw_feature >= 41);
 
+       device->use_shader_ballot = device->instance->perftest_flags & RADV_PERFTEST_SHADER_BALLOT;
+
        radv_physical_device_init_mem_types(device);
        radv_fill_device_extension_table(device, &device->supported_extensions);
 
@@ -479,6 +481,7 @@ static const struct debug_control radv_perftest_options[] = {
        {"localbos", RADV_PERFTEST_LOCAL_BOS},
        {"dccmsaa", RADV_PERFTEST_DCC_MSAA},
        {"bolist", RADV_PERFTEST_BO_LIST},
+       {"shader_ballot", RADV_PERFTEST_SHADER_BALLOT},
        {NULL, 0}
 };
 
index 8f4fcad19834a81bc0c556163a52f1dfc8a27672..0a3c0759cca865216b3dfe903eb42398bc0fe956 100644 (file)
@@ -134,6 +134,7 @@ EXTENSIONS = [
     Extension('VK_AMD_gpu_shader_half_float',             1, 'device->rad_info.chip_class >= GFX8 && HAVE_LLVM >= 0x0800'),
     Extension('VK_AMD_gpu_shader_int16',                  1, 'device->rad_info.chip_class >= GFX8'),
     Extension('VK_AMD_rasterization_order',               1, 'device->has_out_of_order_rast'),
+    Extension('VK_AMD_shader_ballot',                     1, 'device->use_shader_ballot'),
     Extension('VK_AMD_shader_core_properties',            1, True),
     Extension('VK_AMD_shader_info',                       1, True),
     Extension('VK_AMD_shader_trinary_minmax',             1, True),
index 8f2e80b3017ad8cc71dbfd0f0472c964b74f8029..d6f396f0056565ad32a3eeda26ecc2dc813fe29f 100644 (file)
@@ -316,6 +316,9 @@ struct radv_physical_device {
        /* Whether LOAD_CONTEXT_REG packets are supported. */
        bool has_load_ctx_reg_pkt;
 
+       /* Whether to enable the AMD_shader_ballot extension */
+       bool use_shader_ballot;
+
        /* This is the drivers on-disk cache used as a fallback as opposed to
         * the pipeline cache defined by apps.
         */
index 3e1098de79f1272b3d0c6dff78197e4c680d2f64..c3bbf3fdda7cee8653f0c316ea6d15b2aa202898 100644 (file)
@@ -246,7 +246,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
                        .lower_ubo_ssbo_access_to_offsets = true,
                        .caps = {
                                .amd_gcn_shader = true,
-                               .amd_shader_ballot = false,
+                               .amd_shader_ballot = device->instance->perftest_flags & RADV_PERFTEST_SHADER_BALLOT,
                                .amd_trinary_minmax = true,
                                .derivative_group = true,
                                .descriptor_array_dynamic_indexing = true,