mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 11:20:11 +01:00
mesa/teximage: return the base internal format of the ASTC formats
This is necesary to initialize the gl_texture_image struct. From the KHR_texture_compression_astc_ldr spec: "Added to Section 3.8.6, Compressed Texture Images Add the tokens specified above to Table 3.16, Compressed Internal Formats. In all cases, the base internal format will be RGBA. The encoding allows images to be encoded with fewer channels, but this is always presented as RGBA to the sampler." v2. use _mesa_is_astc_format(). Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
This commit is contained in:
parent
12b519b457
commit
cd49b97a8a
1 changed files with 4 additions and 0 deletions
|
|
@ -565,6 +565,10 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ctx->Extensions.KHR_texture_compression_astc_ldr &&
|
||||||
|
_mesa_is_astc_format(internalFormat))
|
||||||
|
return GL_RGBA;
|
||||||
|
|
||||||
if (_mesa_is_gles3(ctx) || ctx->Extensions.ARB_ES3_compatibility) {
|
if (_mesa_is_gles3(ctx) || ctx->Extensions.ARB_ES3_compatibility) {
|
||||||
switch (internalFormat) {
|
switch (internalFormat) {
|
||||||
case GL_COMPRESSED_RGB8_ETC2:
|
case GL_COMPRESSED_RGB8_ETC2:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue