spirv: Sort supported capabilities
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 7 Jan 2019 16:28:23 +0000 (10:28 -0600)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 8 Jan 2019 00:41:15 +0000 (18:41 -0600)
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/amd/vulkan/radv_shader.c
src/compiler/shader_info.h
src/intel/vulkan/anv_pipeline.c
src/mesa/drivers/dri/i965/brw_context.c

index cc4bd1684f86254db3098b2ee0e1d6bb5b57b598..9ca586486c40b0f4a9a12ae07be874e24c14d4bd 100644 (file)
@@ -221,32 +221,32 @@ radv_shader_compile_to_nir(struct radv_device *device,
                const struct spirv_to_nir_options spirv_options = {
                        .lower_ubo_ssbo_access_to_offsets = true,
                        .caps = {
+                               .descriptor_array_dynamic_indexing = true,
                                .device_group = true,
                                .draw_parameters = true,
                                .float64 = true,
+                               .gcn_shader = true,
+                               .geometry_streams = true,
                                .image_read_without_format = true,
                                .image_write_without_format = true,
-                               .tessellation = true,
-                               .int64 = true,
                                .int16 = true,
+                               .int64 = true,
                                .multiview = true,
+                               .runtime_descriptor_array = true,
+                               .shader_viewport_index_layer = true,
+                               .stencil_export = true,
+                               .storage_16bit = true,
+                               .storage_image_ms = true,
                                .subgroup_arithmetic = true,
                                .subgroup_ballot = true,
                                .subgroup_basic = true,
                                .subgroup_quad = true,
                                .subgroup_shuffle = true,
                                .subgroup_vote = true,
-                               .variable_pointers = true,
-                               .gcn_shader = true,
-                               .trinary_minmax = true,
-                               .shader_viewport_index_layer = true,
-                               .descriptor_array_dynamic_indexing = true,
-                               .runtime_descriptor_array = true,
-                               .stencil_export = true,
-                               .storage_16bit = true,
-                               .geometry_streams = true,
+                               .tessellation = true,
                                .transform_feedback = true,
-                               .storage_image_ms = true,
+                               .trinary_minmax = true,
+                               .variable_pointers = true,
                        },
                        .ubo_ptr_type = glsl_vector_type(GLSL_TYPE_UINT, 2),
                        .ssbo_ptr_type = glsl_vector_type(GLSL_TYPE_UINT, 2),
index 05f37c8d197944d6625a9ce8da5e197a06de4697..dc47cd7656d95809085b0a0ef7d863250dc9c858 100644 (file)
@@ -33,38 +33,38 @@ extern "C" {
 #endif
 
 struct spirv_supported_capabilities {
-   bool float64;
-   bool image_ms_array;
-   bool tessellation;
+   bool atomic_storage;
+   bool descriptor_array_dynamic_indexing;
    bool device_group;
    bool draw_parameters;
+   bool float64;
+   bool geometry_streams;
+   bool gcn_shader;
+   bool image_ms_array;
    bool image_read_without_format;
    bool image_write_without_format;
+   bool int16;
    bool int64;
+   bool int64_atomics;
    bool min_lod;
    bool multiview;
-   bool variable_pointers;
-   bool storage_16bit;
-   bool int16;
+   bool post_depth_coverage;
+   bool runtime_descriptor_array;
    bool shader_viewport_index_layer;
+   bool stencil_export;
+   bool storage_8bit;
+   bool storage_16bit;
+   bool storage_image_ms;
    bool subgroup_arithmetic;
    bool subgroup_ballot;
    bool subgroup_basic;
    bool subgroup_quad;
    bool subgroup_shuffle;
    bool subgroup_vote;
-   bool gcn_shader;
-   bool trinary_minmax;
-   bool descriptor_array_dynamic_indexing;
-   bool runtime_descriptor_array;
-   bool stencil_export;
-   bool atomic_storage;
-   bool storage_8bit;
-   bool post_depth_coverage;
+   bool tessellation;
    bool transform_feedback;
-   bool geometry_streams;
-   bool int64_atomics;
-   bool storage_image_ms;
+   bool trinary_minmax;
+   bool variable_pointers;
 };
 
 typedef struct shader_info {
index 4269e618eba48d9f0b181dd8ecbce86bf11a5d6e..750e258c2d2cae1e0679f23d898a65abc361be9f 100644 (file)
@@ -136,27 +136,27 @@ anv_shader_compile_to_nir(struct anv_pipeline *pipeline,
    struct spirv_to_nir_options spirv_options = {
       .lower_workgroup_access_to_offsets = true,
       .caps = {
-         .float64 = device->instance->physicalDevice.info.gen >= 8,
-         .int64 = device->instance->physicalDevice.info.gen >= 8,
-         .tessellation = true,
          .device_group = true,
          .draw_parameters = true,
+         .float64 = device->instance->physicalDevice.info.gen >= 8,
          .image_write_without_format = true,
+         .int16 = device->instance->physicalDevice.info.gen >= 8,
+         .int64 = device->instance->physicalDevice.info.gen >= 8,
          .min_lod = true,
          .multiview = true,
-         .variable_pointers = true,
-         .storage_16bit = device->instance->physicalDevice.info.gen >= 8,
-         .int16 = device->instance->physicalDevice.info.gen >= 8,
+         .post_depth_coverage = device->instance->physicalDevice.info.gen >= 9,
          .shader_viewport_index_layer = true,
+         .stencil_export = device->instance->physicalDevice.info.gen >= 9,
+         .storage_8bit = device->instance->physicalDevice.info.gen >= 8,
+         .storage_16bit = device->instance->physicalDevice.info.gen >= 8,
          .subgroup_arithmetic = true,
          .subgroup_basic = true,
          .subgroup_ballot = true,
          .subgroup_quad = true,
          .subgroup_shuffle = true,
          .subgroup_vote = true,
-         .stencil_export = device->instance->physicalDevice.info.gen >= 9,
-         .storage_8bit = device->instance->physicalDevice.info.gen >= 8,
-         .post_depth_coverage = device->instance->physicalDevice.info.gen >= 9,
+         .tessellation = true,
+         .variable_pointers = true,
       },
       .ubo_ptr_type = glsl_vector_type(GLSL_TYPE_UINT, 2),
       .ssbo_ptr_type = glsl_vector_type(GLSL_TYPE_UINT, 2),
index 6ba64e4e06d7f683c4a6ca91c62fa7ef98ce83ee..505da9896b369a445bec5c321a106ffa10e80086 100644 (file)
@@ -390,15 +390,15 @@ brw_initialize_spirv_supported_capabilities(struct brw_context *brw)
     */
    assert(devinfo->gen >= 7);
 
+   ctx->Const.SpirVCapabilities.atomic_storage = devinfo->gen >= 7;
+   ctx->Const.SpirVCapabilities.draw_parameters = true;
    ctx->Const.SpirVCapabilities.float64 = devinfo->gen >= 8;
+   ctx->Const.SpirVCapabilities.geometry_streams = devinfo->gen >= 7;
+   ctx->Const.SpirVCapabilities.image_write_without_format = true;
    ctx->Const.SpirVCapabilities.int64 = devinfo->gen >= 8;
    ctx->Const.SpirVCapabilities.tessellation = true;
-   ctx->Const.SpirVCapabilities.draw_parameters = true;
-   ctx->Const.SpirVCapabilities.image_write_without_format = true;
-   ctx->Const.SpirVCapabilities.variable_pointers = true;
-   ctx->Const.SpirVCapabilities.atomic_storage = devinfo->gen >= 7;
    ctx->Const.SpirVCapabilities.transform_feedback = devinfo->gen >= 7;
-   ctx->Const.SpirVCapabilities.geometry_streams = devinfo->gen >= 7;
+   ctx->Const.SpirVCapabilities.variable_pointers = true;
 }
 
 static void