aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_format.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-02-13 04:25:29 +0100
committerMarek Olšák <[email protected]>2018-07-31 18:09:57 -0400
commited8b4ed6c4c0f2d318e21ed964bb18d0e5a3b800 (patch)
treedaacfe4d14b1236fd57004fdefbab51d2ca8cbc1 /src/mesa/state_tracker/st_format.c
parent5fe52044efec0506eb2ce05ccdc9e5ce53941538 (diff)
st/mesa: implement ASTC 2D LDR fallback for all drivers
Tested-by: Mike Lothian <[email protected]> Tested-By: Gert Wollny<[email protected]> Tested-by: Dieter Nützel <[email protected]> Reviewed-By: Gert Wollny <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_format.c')
-rw-r--r--src/mesa/state_tracker/st_format.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 45513e8683e..afe810f4d15 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -487,61 +487,117 @@ st_mesa_format_to_pipe_format(const struct st_context *st,
has_bgra_srgb ? PIPE_FORMAT_B8G8R8A8_SRGB : PIPE_FORMAT_R8G8B8A8_SRGB;
case MESA_FORMAT_RGBA_ASTC_4x4:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_4x4;
case MESA_FORMAT_RGBA_ASTC_5x4:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_5x4;
case MESA_FORMAT_RGBA_ASTC_5x5:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_5x5;
case MESA_FORMAT_RGBA_ASTC_6x5:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_6x5;
case MESA_FORMAT_RGBA_ASTC_6x6:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_6x6;
case MESA_FORMAT_RGBA_ASTC_8x5:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_8x5;
case MESA_FORMAT_RGBA_ASTC_8x6:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_8x6;
case MESA_FORMAT_RGBA_ASTC_8x8:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_8x8;
case MESA_FORMAT_RGBA_ASTC_10x5:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_10x5;
case MESA_FORMAT_RGBA_ASTC_10x6:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_10x6;
case MESA_FORMAT_RGBA_ASTC_10x8:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_10x8;
case MESA_FORMAT_RGBA_ASTC_10x10:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_10x10;
case MESA_FORMAT_RGBA_ASTC_12x10:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_12x10;
case MESA_FORMAT_RGBA_ASTC_12x12:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
return PIPE_FORMAT_ASTC_12x12;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x4:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_4x4_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x4:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_5x4_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_5x5_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x5:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_6x5_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x6:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_6x6_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_8x5:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_8x5_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_8x6:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_8x6_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_8x8:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_8x8_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_10x5:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_10x5_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_10x6:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_10x6_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_10x8:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_10x8_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_10x10:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_10x10_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x10:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_12x10_SRGB;
case MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x12:
+ if (!st->has_astc_2d_ldr)
+ return PIPE_FORMAT_R8G8B8A8_SRGB;
return PIPE_FORMAT_ASTC_12x12_SRGB;
default: