st/mesa: Map MESA_FORMAT_RGB_UNORM8 <-> PIPE_FORMAT_R8G8B8_UNORM
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 10 Jul 2019 18:10:25 +0000 (19:10 +0100)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 22 Oct 2019 22:13:14 +0000 (22:13 +0000)
This is useful for PBO texture upload with GL_RGB and GL_UNSIGNED_BYTE.

v2: Vasily Khoruzhick provided an update for the Lima CI expectations.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
.gitlab-ci/deqp-lima-fails.txt
src/mesa/state_tracker/st_format.c

index a2082c0d2c38b59fcfb8870a857eaced7db635dd..f66150359ca441d04bf92e9f008334c22f5f54fc 100644 (file)
@@ -605,31 +605,15 @@ dEQP-GLES2.functional.negative_api.texture.teximage2d_invalid_format BadTerminat
 dEQP-GLES2.functional.negative_api.texture.teximage2d_invalid_type BadTerminate
 dEQP-GLES2.functional.negative_api.texture.teximage2d_inequal_width_height_cube BadTerminate
 dEQP-GLES2.functional.negative_api.texture.teximage2d_neg_level_tex2d BadTerminate
-dEQP-GLES2.functional.negative_api.texture.teximage2d_neg_level_cube BadTerminatePass
-dEQP-GLES2.functional.negative_api.texture.teximage2d_level_max_tex2d BadTerminatePass
-dEQP-GLES2.functional.negative_api.texture.teximage2d_level_max_cube BadTerminatePass
-dEQP-GLES2.functional.negative_api.texture.teximage2d_invalid_internalformat BadTerminatePass
-dEQP-GLES2.functional.negative_api.texture.teximage2d_neg_width_height_tex2d BadTerminatePass
-dEQP-GLES2.functional.negative_api.texture.teximage2d_neg_width_height_cube_pos_x BadTerminatePass
-dEQP-GLES2.functional.negative_api.texture.teximage2d_neg_width_height_cube_pos_y BadTerminatePass
-dEQP-GLES2.functional.negative_api.texture.teximage2d_neg_width_height_cube_pos_z BadTerminatePass
-dEQP-GLES2.functional.negative_api.texture.teximage2d_neg_width_height_cube_neg_x BadTerminatePass
-dEQP-GLES2.functional.negative_api.texture.teximage2d_neg_width_height_cube_neg_y BadTerminatePass
-dEQP-GLES2.functional.negative_api.texture.teximage2d_neg_width_height_cube_neg_z BadTerminatePass
-dEQP-GLES2.functional.negative_api.texture.teximage2d_width_height_max_tex2d BadTerminatePass
-dEQP-GLES2.functional.negative_api.texture.teximage2d_width_height_max_cube_pos_x BadTerminate
-dEQP-GLES2.functional.negative_api.texture.teximage2d_width_height_max_cube_pos_y BadTerminate
-dEQP-GLES2.functional.negative_api.texture.teximage2d_width_height_max_cube_pos_z BadTerminate
-dEQP-GLES2.functional.negative_api.texture.teximage2d_width_height_max_cube_neg_x BadTerminate
-dEQP-GLES2.functional.negative_api.texture.teximage2d_width_height_max_cube_neg_y BadTerminate
-dEQP-GLES2.functional.negative_api.texture.teximage2d_width_height_max_cube_neg_z BadTerminate
-dEQP-GLES2.functional.negative_api.texture.teximage2d_invalid_border BadTerminate
-dEQP-GLES2.functional.negative_api.texture.teximage2d_format_mismatch BadTerminate
-dEQP-GLES2.functional.negative_api.texture.teximage2d_type_format_mismatch BadTerminate
-dEQP-GLES2.functional.negative_api.texture.texsubimage2d_invalid_target BadTerminate
-dEQP-GLES2.functional.negative_api.texture.texsubimage2d_invalid_format BadTerminate
-dEQP-GLES2.functional.negative_api.texture.texsubimage2d_invalid_type BadTerminate
-dEQP-GLES2.functional.negative_api.texture.texsubimage2d_neg_level_tex2d BadTerminate
+dEQP-GLES2.functional.negative_api.texture.teximage2d_width_height_max_cube_neg_y BadTerminatePass
+dEQP-GLES2.functional.negative_api.texture.teximage2d_width_height_max_cube_neg_z BadTerminatePass
+dEQP-GLES2.functional.negative_api.texture.teximage2d_invalid_border BadTerminatePass
+dEQP-GLES2.functional.negative_api.texture.teximage2d_format_mismatch BadTerminatePass
+dEQP-GLES2.functional.negative_api.texture.teximage2d_type_format_mismatch BadTerminatePass
+dEQP-GLES2.functional.negative_api.texture.texsubimage2d_invalid_target BadTerminatePass
+dEQP-GLES2.functional.negative_api.texture.texsubimage2d_invalid_format BadTerminatePass
+dEQP-GLES2.functional.negative_api.texture.texsubimage2d_invalid_type BadTerminatePass
+dEQP-GLES2.functional.negative_api.texture.texsubimage2d_neg_level_tex2d BadTerminatePass
 dEQP-GLES2.functional.negative_api.texture.texsubimage2d_neg_level_cube BadTerminate
 dEQP-GLES2.functional.negative_api.texture.texsubimage2d_level_max_tex2d BadTerminate
 dEQP-GLES2.functional.negative_api.texture.texsubimage2d_level_max_cube BadTerminate
index 35d2e3bc915aec451135ac2ed9516d80809581ae..a84905942ed9a314aebad5597d8e588a7db78d6b 100644 (file)
@@ -71,6 +71,8 @@ st_mesa_format_to_pipe_format(const struct st_context *st,
    switch (mesaFormat) {
    case MESA_FORMAT_A8B8G8R8_UNORM:
       return PIPE_FORMAT_ABGR8888_UNORM;
+   case MESA_FORMAT_RGB_UNORM8:
+      return PIPE_FORMAT_R8G8B8_UNORM;
    case MESA_FORMAT_R8G8B8A8_UNORM:
       return PIPE_FORMAT_RGBA8888_UNORM;
    case MESA_FORMAT_B8G8R8A8_UNORM:
@@ -635,6 +637,8 @@ st_mesa_format_to_pipe_format(const struct st_context *st,
       return PIPE_FORMAT_ATC_RGBA_INTERPOLATED;
 
    default:
+      debug_printf("%s(mesa_format=%s) -> NONE\n",
+                   __func__, _mesa_get_format_name(mesaFormat));
       return PIPE_FORMAT_NONE;
    }
 }
@@ -651,6 +655,8 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
       return MESA_FORMAT_A8B8G8R8_UNORM;
    case PIPE_FORMAT_RGBA8888_UNORM:
       return MESA_FORMAT_R8G8B8A8_UNORM;
+   case PIPE_FORMAT_R8G8B8_UNORM:
+      return MESA_FORMAT_RGB_UNORM8;
    case PIPE_FORMAT_BGRA8888_UNORM:
       return MESA_FORMAT_B8G8R8A8_UNORM;
    case PIPE_FORMAT_ARGB8888_UNORM: