v3dv: handle new texture state transfer functions in v71
authorIago Toral Quiroga <itoral@igalia.com>
Sun, 24 Oct 2021 23:38:31 +0000 (01:38 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 13 Oct 2023 22:37:43 +0000 (22:37 +0000)
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>

src/broadcom/vulkan/v3dvx_image.c

index 848290c..437d458 100644 (file)
@@ -108,15 +108,16 @@ pack_texture_shader_state_helper(struct v3dv_device *device,
 
          tex.array_stride_64_byte_aligned = image->planes[iplane].cube_map_stride / 64;
 
+         bool is_srgb = vk_format_is_srgb(image_view->vk.format);
 #if V3D_VERSION == 42
          tex.reverse_standard_border_color = image_view->planes[plane].channel_reverse;
 #endif
 
 #if V3D_VERSION == 42
-         tex.srgb = vk_format_is_srgb(image_view->vk.view_format);
+         tex.srgb = is_srgb;
 #endif
 #if V3D_VERSION >= 71
-      unreachable("Hardware generation 71 not supported yet.");
+         tex.transfer_func = is_srgb ? TRANSFER_FUNC_SRGB : TRANSFER_FUNC_NONE;
 #endif
 
          /* At this point we don't have the job. That's the reason the first
@@ -181,11 +182,13 @@ v3dX(pack_texture_shader_state_from_buffer_view)(struct v3dv_device *device,
 
       assert(buffer_view->format->plane_count == 1);
       tex.texture_type = buffer_view->format->planes[0].tex_type;
+
+      bool is_srgb = vk_format_is_srgb(buffer_view->vk_format);
 #if V3D_VERSION == 42
-      tex.srgb = vk_format_is_srgb(buffer_view->vk_format);
+      tex.srgb = is_srgb;
 #endif
 #if V3D_VERSION >= 71
-      unreachable("Hardware generation 71 not supported yet.");
+      tex.transfer_func = is_srgb ? TRANSFER_FUNC_SRGB : TRANSFER_FUNC_NONE;
 #endif
 
       /* At this point we don't have the job. That's the reason the first