summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-02-13 17:37:56 +0100
committerMarek Olšák <[email protected]>2018-07-31 18:09:57 -0400
commit5fe52044efec0506eb2ce05ccdc9e5ce53941538 (patch)
tree971651cc28f129e257d0c95512c5a8b29cd788ee /src/mesa/state_tracker
parentebe03d36992dc4df86ae01b410b9c4f4da52610d (diff)
st/mesa: add ETC2 & ASTC fast path for GetTex(Sub)Image
Not sure if GL/GLES can hit this path, but it's just decompression. 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')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index ecd1f4ef339..80eb171dfd8 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1967,6 +1967,23 @@ st_GetTexSubImage(struct gl_context * ctx,
case PIPE_FORMAT_RGTC1_UNORM:
case PIPE_FORMAT_RGTC2_UNORM:
case PIPE_FORMAT_ETC1_RGB8:
+ case PIPE_FORMAT_ETC2_RGB8:
+ case PIPE_FORMAT_ETC2_RGB8A1:
+ case PIPE_FORMAT_ETC2_RGBA8:
+ case PIPE_FORMAT_ASTC_4x4:
+ case PIPE_FORMAT_ASTC_5x4:
+ case PIPE_FORMAT_ASTC_5x5:
+ case PIPE_FORMAT_ASTC_6x5:
+ case PIPE_FORMAT_ASTC_6x6:
+ case PIPE_FORMAT_ASTC_8x5:
+ case PIPE_FORMAT_ASTC_8x6:
+ case PIPE_FORMAT_ASTC_8x8:
+ case PIPE_FORMAT_ASTC_10x5:
+ case PIPE_FORMAT_ASTC_10x6:
+ case PIPE_FORMAT_ASTC_10x8:
+ case PIPE_FORMAT_ASTC_10x10:
+ case PIPE_FORMAT_ASTC_12x10:
+ case PIPE_FORMAT_ASTC_12x12:
case PIPE_FORMAT_BPTC_RGBA_UNORM:
dst_glformat = GL_RGBA8;
break;
@@ -1982,6 +1999,30 @@ st_GetTexSubImage(struct gl_context * ctx,
goto fallback;
dst_glformat = GL_RGBA32F;
break;
+ case PIPE_FORMAT_ETC2_R11_UNORM:
+ if (!screen->is_format_supported(screen, PIPE_FORMAT_R16_UNORM,
+ pipe_target, 0, bind))
+ goto fallback;
+ dst_glformat = GL_R16;
+ break;
+ case PIPE_FORMAT_ETC2_R11_SNORM:
+ if (!screen->is_format_supported(screen, PIPE_FORMAT_R16_SNORM,
+ pipe_target, 0, bind))
+ goto fallback;
+ dst_glformat = GL_R16_SNORM;
+ break;
+ case PIPE_FORMAT_ETC2_RG11_UNORM:
+ if (!screen->is_format_supported(screen, PIPE_FORMAT_R16G16_UNORM,
+ pipe_target, 0, bind))
+ goto fallback;
+ dst_glformat = GL_RG16;
+ break;
+ case PIPE_FORMAT_ETC2_RG11_SNORM:
+ if (!screen->is_format_supported(screen, PIPE_FORMAT_R16G16_SNORM,
+ pipe_target, 0, bind))
+ goto fallback;
+ dst_glformat = GL_RG16_SNORM;
+ break;
default:
assert(0);
goto fallback;