radv/gfx10: enable 1D textures

Submitted by Samuel Pitoiset on July 11, 2019, 3:22 p.m.

Details

Message ID 20190711152222.10249-1-samuel.pitoiset@gmail.com
State New
Headers show
Series "radv/gfx10: enable 1D textures" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Samuel Pitoiset July 11, 2019, 3:22 p.m.
Mirror RadeonSI. This also fixes crashes in addrlib.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 src/amd/vulkan/radv_image.c                        | 4 ++--
 src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c | 6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 368bd5d839d..ccbec36849e 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -649,7 +649,7 @@  gfx10_make_texture_descriptor(struct radv_device *device,
 	}
 
 	type = radv_tex_dim(image->type, view_type, image->info.array_size, image->info.samples,
-			    is_storage_image, device->physical_device->rad_info.chip_class >= GFX9);
+			    is_storage_image, device->physical_device->rad_info.chip_class == GFX9);
 	if (type == V_008F1C_SQ_RSRC_IMG_1D_ARRAY) {
 	        height = 1;
 		depth = image->info.array_size;
@@ -796,7 +796,7 @@  si_make_texture_descriptor(struct radv_device *device,
 			data_format = V_008F14_IMG_DATA_FORMAT_S8_16;
 	}
 	type = radv_tex_dim(image->type, view_type, image->info.array_size, image->info.samples,
-			    is_storage_image, device->physical_device->rad_info.chip_class >= GFX9);
+			    is_storage_image, device->physical_device->rad_info.chip_class == GFX9);
 	if (type == V_008F1C_SQ_RSRC_IMG_1D_ARRAY) {
 	        height = 1;
 		depth = image->info.array_size;
diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
index 3f4cad861c2..598baa2addc 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
@@ -90,8 +90,10 @@  static int radv_amdgpu_winsys_surface_init(struct radeon_winsys *_ws,
 	struct ac_surf_config config;
 
 	memcpy(&config.info, surf_info, sizeof(config.info));
-	config.is_3d = !!(type == RADEON_SURF_TYPE_3D);
-	config.is_cube = !!(type == RADEON_SURF_TYPE_CUBEMAP);
+	config.is_1d = type == RADEON_SURF_TYPE_1D ||
+		       type == RADEON_SURF_TYPE_1D_ARRAY;
+	config.is_3d = type == RADEON_SURF_TYPE_3D;
+	config.is_cube = type == RADEON_SURF_TYPE_CUBEMAP;
 
 	return ac_compute_surface(ws->addrlib, &ws->info, &config, mode, surf);
 }

Comments

r-b

On Thu, Jul 11, 2019 at 5:22 PM Samuel Pitoiset
<samuel.pitoiset@gmail.com> wrote:
>
> Mirror RadeonSI. This also fixes crashes in addrlib.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
> ---
>  src/amd/vulkan/radv_image.c                        | 4 ++--
>  src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c | 6 ++++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
> index 368bd5d839d..ccbec36849e 100644
> --- a/src/amd/vulkan/radv_image.c
> +++ b/src/amd/vulkan/radv_image.c
> @@ -649,7 +649,7 @@ gfx10_make_texture_descriptor(struct radv_device *device,
>         }
>
>         type = radv_tex_dim(image->type, view_type, image->info.array_size, image->info.samples,
> -                           is_storage_image, device->physical_device->rad_info.chip_class >= GFX9);
> +                           is_storage_image, device->physical_device->rad_info.chip_class == GFX9);
>         if (type == V_008F1C_SQ_RSRC_IMG_1D_ARRAY) {
>                 height = 1;
>                 depth = image->info.array_size;
> @@ -796,7 +796,7 @@ si_make_texture_descriptor(struct radv_device *device,
>                         data_format = V_008F14_IMG_DATA_FORMAT_S8_16;
>         }
>         type = radv_tex_dim(image->type, view_type, image->info.array_size, image->info.samples,
> -                           is_storage_image, device->physical_device->rad_info.chip_class >= GFX9);
> +                           is_storage_image, device->physical_device->rad_info.chip_class == GFX9);
>         if (type == V_008F1C_SQ_RSRC_IMG_1D_ARRAY) {
>                 height = 1;
>                 depth = image->info.array_size;
> diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
> index 3f4cad861c2..598baa2addc 100644
> --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
> +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
> @@ -90,8 +90,10 @@ static int radv_amdgpu_winsys_surface_init(struct radeon_winsys *_ws,
>         struct ac_surf_config config;
>
>         memcpy(&config.info, surf_info, sizeof(config.info));
> -       config.is_3d = !!(type == RADEON_SURF_TYPE_3D);
> -       config.is_cube = !!(type == RADEON_SURF_TYPE_CUBEMAP);
> +       config.is_1d = type == RADEON_SURF_TYPE_1D ||
> +                      type == RADEON_SURF_TYPE_1D_ARRAY;
> +       config.is_3d = type == RADEON_SURF_TYPE_3D;
> +       config.is_cube = type == RADEON_SURF_TYPE_CUBEMAP;
>
>         return ac_compute_surface(ws->addrlib, &ws->info, &config, mode, surf);
>  }
> --
> 2.22.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev