radv: only use specialised 3D meta paths on GFX9.
authorDave Airlie <airlied@redhat.com>
Mon, 8 Jul 2019 19:08:09 +0000 (05:08 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 8 Jul 2019 20:32:28 +0000 (06:32 +1000)
GFX10 appears to act like GFX8 here.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta_blit2d.c
src/amd/vulkan/radv_meta_bufimage.c

index 1fb5529b410eaae59eac2cfda21160371cac1552..8142faef5f80bcb002c644a39de233588e0d4768 100644 (file)
@@ -408,7 +408,7 @@ radv_meta_blit2d(struct radv_cmd_buffer *cmd_buffer,
                 unsigned num_rects,
                 struct radv_meta_blit2d_rect *rects)
 {
                 unsigned num_rects,
                 struct radv_meta_blit2d_rect *rects)
 {
-       bool use_3d = cmd_buffer->device->physical_device->rad_info.chip_class >= GFX9 &&
+       bool use_3d = cmd_buffer->device->physical_device->rad_info.chip_class == GFX9 &&
                (src_img && src_img->image->type == VK_IMAGE_TYPE_3D);
        enum blit2d_src_type src_type = src_buf ? BLIT2D_SRC_TYPE_BUFFER :
                use_3d ? BLIT2D_SRC_TYPE_IMAGE_3D : BLIT2D_SRC_TYPE_IMAGE;
                (src_img && src_img->image->type == VK_IMAGE_TYPE_3D);
        enum blit2d_src_type src_type = src_buf ? BLIT2D_SRC_TYPE_BUFFER :
                use_3d ? BLIT2D_SRC_TYPE_IMAGE_3D : BLIT2D_SRC_TYPE_IMAGE;
@@ -1308,7 +1308,7 @@ VkResult
 radv_device_init_meta_blit2d_state(struct radv_device *device, bool on_demand)
 {
        VkResult result;
 radv_device_init_meta_blit2d_state(struct radv_device *device, bool on_demand)
 {
        VkResult result;
-       bool create_3d = device->physical_device->rad_info.chip_class >= GFX9;
+       bool create_3d = device->physical_device->rad_info.chip_class == GFX9;
 
        for (unsigned log2_samples = 0; log2_samples < 1 + MAX_SAMPLES_LOG2; log2_samples++) {
                for (unsigned src = 0; src < BLIT2D_NUM_SRC_TYPES; src++) {
 
        for (unsigned log2_samples = 0; log2_samples < 1 + MAX_SAMPLES_LOG2; log2_samples++) {
                for (unsigned src = 0; src < BLIT2D_NUM_SRC_TYPES; src++) {
index 4c8bfa0462b1e72f7e7f04a244bb09ec318b5fe4..a2a62798c339bf12f4855b3d365080c55146e263 100644 (file)
@@ -135,7 +135,7 @@ radv_device_init_meta_itob_state(struct radv_device *device)
        struct radv_shader_module cs_3d = { .nir = NULL };
 
        cs.nir = build_nir_itob_compute_shader(device, false);
        struct radv_shader_module cs_3d = { .nir = NULL };
 
        cs.nir = build_nir_itob_compute_shader(device, false);
-       if (device->physical_device->rad_info.chip_class >= GFX9)
+       if (device->physical_device->rad_info.chip_class == GFX9)
                cs_3d.nir = build_nir_itob_compute_shader(device, true);
 
        /*
                cs_3d.nir = build_nir_itob_compute_shader(device, true);
 
        /*
@@ -211,7 +211,7 @@ radv_device_init_meta_itob_state(struct radv_device *device)
        if (result != VK_SUCCESS)
                goto fail;
 
        if (result != VK_SUCCESS)
                goto fail;
 
-       if (device->physical_device->rad_info.chip_class >= GFX9) {
+       if (device->physical_device->rad_info.chip_class == GFX9) {
                VkPipelineShaderStageCreateInfo pipeline_shader_stage_3d = {
                        .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
                        .stage = VK_SHADER_STAGE_COMPUTE_BIT,
                VkPipelineShaderStageCreateInfo pipeline_shader_stage_3d = {
                        .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
                        .stage = VK_SHADER_STAGE_COMPUTE_BIT,
@@ -256,7 +256,7 @@ radv_device_finish_meta_itob_state(struct radv_device *device)
                                        &state->alloc);
        radv_DestroyPipeline(radv_device_to_handle(device),
                             state->itob.pipeline, &state->alloc);
                                        &state->alloc);
        radv_DestroyPipeline(radv_device_to_handle(device),
                             state->itob.pipeline, &state->alloc);
-       if (device->physical_device->rad_info.chip_class >= GFX9)
+       if (device->physical_device->rad_info.chip_class == GFX9)
                radv_DestroyPipeline(radv_device_to_handle(device),
                                     state->itob.pipeline_3d, &state->alloc);
 }
                radv_DestroyPipeline(radv_device_to_handle(device),
                                     state->itob.pipeline_3d, &state->alloc);
 }
@@ -361,7 +361,7 @@ radv_device_init_meta_btoi_state(struct radv_device *device)
        struct radv_shader_module cs = { .nir = NULL };
        struct radv_shader_module cs_3d = { .nir = NULL };
        cs.nir = build_nir_btoi_compute_shader(device, false);
        struct radv_shader_module cs = { .nir = NULL };
        struct radv_shader_module cs_3d = { .nir = NULL };
        cs.nir = build_nir_btoi_compute_shader(device, false);
-       if (device->physical_device->rad_info.chip_class >= GFX9)
+       if (device->physical_device->rad_info.chip_class == GFX9)
                cs_3d.nir = build_nir_btoi_compute_shader(device, true);
        /*
         * two descriptors one for the image being sampled
                cs_3d.nir = build_nir_btoi_compute_shader(device, true);
        /*
         * two descriptors one for the image being sampled
@@ -436,7 +436,7 @@ radv_device_init_meta_btoi_state(struct radv_device *device)
        if (result != VK_SUCCESS)
                goto fail;
 
        if (result != VK_SUCCESS)
                goto fail;
 
-       if (device->physical_device->rad_info.chip_class >= GFX9) {
+       if (device->physical_device->rad_info.chip_class == GFX9) {
                VkPipelineShaderStageCreateInfo pipeline_shader_stage_3d = {
                        .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
                        .stage = VK_SHADER_STAGE_COMPUTE_BIT,
                VkPipelineShaderStageCreateInfo pipeline_shader_stage_3d = {
                        .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
                        .stage = VK_SHADER_STAGE_COMPUTE_BIT,
@@ -785,7 +785,7 @@ radv_device_init_meta_itoi_state(struct radv_device *device)
        struct radv_shader_module cs = { .nir = NULL };
        struct radv_shader_module cs_3d = { .nir = NULL };
        cs.nir = build_nir_itoi_compute_shader(device, false);
        struct radv_shader_module cs = { .nir = NULL };
        struct radv_shader_module cs_3d = { .nir = NULL };
        cs.nir = build_nir_itoi_compute_shader(device, false);
-       if (device->physical_device->rad_info.chip_class >= GFX9)
+       if (device->physical_device->rad_info.chip_class == GFX9)
                cs_3d.nir = build_nir_itoi_compute_shader(device, true);
        /*
         * two descriptors one for the image being sampled
                cs_3d.nir = build_nir_itoi_compute_shader(device, true);
        /*
         * two descriptors one for the image being sampled
@@ -860,7 +860,7 @@ radv_device_init_meta_itoi_state(struct radv_device *device)
        if (result != VK_SUCCESS)
                goto fail;
 
        if (result != VK_SUCCESS)
                goto fail;
 
-       if (device->physical_device->rad_info.chip_class >= GFX9) {
+       if (device->physical_device->rad_info.chip_class == GFX9) {
                VkPipelineShaderStageCreateInfo pipeline_shader_stage_3d = {
                        .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
 .stage = VK_SHADER_STAGE_COMPUTE_BIT,
                VkPipelineShaderStageCreateInfo pipeline_shader_stage_3d = {
                        .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
 .stage = VK_SHADER_STAGE_COMPUTE_BIT,
@@ -904,7 +904,7 @@ radv_device_finish_meta_itoi_state(struct radv_device *device)
                                        &state->alloc);
        radv_DestroyPipeline(radv_device_to_handle(device),
                             state->itoi.pipeline, &state->alloc);
                                        &state->alloc);
        radv_DestroyPipeline(radv_device_to_handle(device),
                             state->itoi.pipeline, &state->alloc);
-       if (device->physical_device->rad_info.chip_class >= GFX9)
+       if (device->physical_device->rad_info.chip_class == GFX9)
                radv_DestroyPipeline(radv_device_to_handle(device),
                                     state->itoi.pipeline_3d, &state->alloc);
 }
                radv_DestroyPipeline(radv_device_to_handle(device),
                                     state->itoi.pipeline_3d, &state->alloc);
 }
@@ -1191,7 +1191,7 @@ radv_device_init_meta_cleari_state(struct radv_device *device)
        struct radv_shader_module cs = { .nir = NULL };
        struct radv_shader_module cs_3d = { .nir = NULL };
        cs.nir = build_nir_cleari_compute_shader(device, false);
        struct radv_shader_module cs = { .nir = NULL };
        struct radv_shader_module cs_3d = { .nir = NULL };
        cs.nir = build_nir_cleari_compute_shader(device, false);
-       if (device->physical_device->rad_info.chip_class >= GFX9)
+       if (device->physical_device->rad_info.chip_class == GFX9)
                cs_3d.nir = build_nir_cleari_compute_shader(device, true);
 
        /*
                cs_3d.nir = build_nir_cleari_compute_shader(device, true);
 
        /*
@@ -1261,7 +1261,7 @@ radv_device_init_meta_cleari_state(struct radv_device *device)
                goto fail;
 
 
                goto fail;
 
 
-       if (device->physical_device->rad_info.chip_class >= GFX9) {
+       if (device->physical_device->rad_info.chip_class == GFX9) {
                /* compute shader */
                VkPipelineShaderStageCreateInfo pipeline_shader_stage_3d = {
                        .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
                /* compute shader */
                VkPipelineShaderStageCreateInfo pipeline_shader_stage_3d = {
                        .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
@@ -1706,7 +1706,7 @@ radv_meta_image_to_buffer(struct radv_cmd_buffer *cmd_buffer,
        create_bview(cmd_buffer, dst->buffer, dst->offset, dst->format, &dst_view);
        itob_bind_descriptors(cmd_buffer, &src_view, &dst_view);
 
        create_bview(cmd_buffer, dst->buffer, dst->offset, dst->format, &dst_view);
        itob_bind_descriptors(cmd_buffer, &src_view, &dst_view);
 
-       if (device->physical_device->rad_info.chip_class >= GFX9 &&
+       if (device->physical_device->rad_info.chip_class == GFX9 &&
            src->image->type == VK_IMAGE_TYPE_3D)
                pipeline = cmd_buffer->device->meta_state.itob.pipeline_3d;
 
            src->image->type == VK_IMAGE_TYPE_3D)
                pipeline = cmd_buffer->device->meta_state.itob.pipeline_3d;
 
@@ -1875,7 +1875,7 @@ radv_meta_buffer_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
        create_iview(cmd_buffer, dst, &dst_view);
        btoi_bind_descriptors(cmd_buffer, &src_view, &dst_view);
 
        create_iview(cmd_buffer, dst, &dst_view);
        btoi_bind_descriptors(cmd_buffer, &src_view, &dst_view);
 
-       if (device->physical_device->rad_info.chip_class >= GFX9 &&
+       if (device->physical_device->rad_info.chip_class == GFX9 &&
            dst->image->type == VK_IMAGE_TYPE_3D)
                pipeline = cmd_buffer->device->meta_state.btoi.pipeline_3d;
        radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
            dst->image->type == VK_IMAGE_TYPE_3D)
                pipeline = cmd_buffer->device->meta_state.btoi.pipeline_3d;
        radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
@@ -2060,7 +2060,7 @@ radv_meta_image_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
 
        itoi_bind_descriptors(cmd_buffer, &src_view, &dst_view);
 
 
        itoi_bind_descriptors(cmd_buffer, &src_view, &dst_view);
 
-       if (device->physical_device->rad_info.chip_class >= GFX9 &&
+       if (device->physical_device->rad_info.chip_class == GFX9 &&
            (src->image->type == VK_IMAGE_TYPE_3D || dst->image->type == VK_IMAGE_TYPE_3D))
                pipeline = cmd_buffer->device->meta_state.itoi.pipeline_3d;
        radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
            (src->image->type == VK_IMAGE_TYPE_3D || dst->image->type == VK_IMAGE_TYPE_3D))
                pipeline = cmd_buffer->device->meta_state.itoi.pipeline_3d;
        radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
@@ -2201,7 +2201,7 @@ radv_meta_clear_image_cs(struct radv_cmd_buffer *cmd_buffer,
        create_iview(cmd_buffer, dst, &dst_iview);
        cleari_bind_descriptors(cmd_buffer, &dst_iview);
 
        create_iview(cmd_buffer, dst, &dst_iview);
        cleari_bind_descriptors(cmd_buffer, &dst_iview);
 
-       if (device->physical_device->rad_info.chip_class >= GFX9 &&
+       if (device->physical_device->rad_info.chip_class == GFX9 &&
            dst->image->type == VK_IMAGE_TYPE_3D)
                pipeline = cmd_buffer->device->meta_state.cleari.pipeline_3d;
 
            dst->image->type == VK_IMAGE_TYPE_3D)
                pipeline = cmd_buffer->device->meta_state.cleari.pipeline_3d;