Commit 44dcb911 by Geoff Lang Committed by Commit Bot

Decode R11 and RG11 EAC formats into 16-bit textures.

8-bit textures are not precise enough but no tests were failing because dEQP was using 4-bit backbuffers. Preserve the old decode-to-8-bits paths because they are still used by Chrome. BUG=angleproject:2336 Change-Id: Ieb651325e2a05c85bcc97f8e6d868afaf37aff0d Reviewed-on: https://chromium-review.googlesource.com/899701 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent bcb4c68d
...@@ -551,6 +551,46 @@ void LoadEACRG11SToRG8(size_t width, ...@@ -551,6 +551,46 @@ void LoadEACRG11SToRG8(size_t width,
size_t outputRowPitch, size_t outputRowPitch,
size_t outputDepthPitch); size_t outputDepthPitch);
void LoadEACR11ToR16(size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch);
void LoadEACR11SToR16(size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch);
void LoadEACRG11ToRG16(size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch);
void LoadEACRG11SToRG16(size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch);
void LoadETC2RGB8ToRGBA8(size_t width, void LoadETC2RGB8ToRGBA8(size_t width,
size_t height, size_t height,
size_t depth, size_t depth,
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
"GL_BGR5_A1_ANGLEX": "B8G8R8A8_UNORM", "GL_BGR5_A1_ANGLEX": "B8G8R8A8_UNORM",
"GL_BGRA4_ANGLEX": "B8G8R8A8_UNORM", "GL_BGRA4_ANGLEX": "B8G8R8A8_UNORM",
"GL_BGRA8_SRGB_ANGLEX": "B8G8R8A8_UNORM_SRGB", "GL_BGRA8_SRGB_ANGLEX": "B8G8R8A8_UNORM_SRGB",
"GL_COMPRESSED_R11_EAC": "R8_UNORM", "GL_COMPRESSED_R11_EAC": "R16_UNORM",
"GL_COMPRESSED_RG11_EAC": "R8G8_UNORM", "GL_COMPRESSED_RG11_EAC": "R16G16_UNORM",
"GL_COMPRESSED_RGB8_ETC2": "R8G8B8A8_UNORM", "GL_COMPRESSED_RGB8_ETC2": "R8G8B8A8_UNORM",
"GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2": "R8G8B8A8_UNORM", "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2": "R8G8B8A8_UNORM",
"GL_COMPRESSED_RGBA8_ETC2_EAC": "R8G8B8A8_UNORM", "GL_COMPRESSED_RGBA8_ETC2_EAC": "R8G8B8A8_UNORM",
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
"GL_COMPRESSED_RGBA_ASTC_10x10_KHR": "NONE", "GL_COMPRESSED_RGBA_ASTC_10x10_KHR": "NONE",
"GL_COMPRESSED_RGBA_ASTC_12x10_KHR": "NONE", "GL_COMPRESSED_RGBA_ASTC_12x10_KHR": "NONE",
"GL_COMPRESSED_RGBA_ASTC_12x12_KHR": "NONE", "GL_COMPRESSED_RGBA_ASTC_12x12_KHR": "NONE",
"GL_COMPRESSED_SIGNED_R11_EAC": "R8_SNORM", "GL_COMPRESSED_SIGNED_R11_EAC": "R16_SNORM",
"GL_COMPRESSED_SIGNED_RG11_EAC": "R8G8_SNORM", "GL_COMPRESSED_SIGNED_RG11_EAC": "R16G16_SNORM",
"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR": "NONE", "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR": "NONE",
"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR": "NONE", "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR": "NONE",
"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR": "NONE", "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR": "NONE",
......
...@@ -182,28 +182,28 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev ...@@ -182,28 +182,28 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev
case GL_COMPRESSED_R11_EAC: case GL_COMPRESSED_R11_EAC:
{ {
static constexpr Format info(GL_COMPRESSED_R11_EAC, static constexpr Format info(GL_COMPRESSED_R11_EAC,
angle::Format::ID::R8_UNORM, angle::Format::ID::R16_UNORM,
DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R16_UNORM,
DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R16_UNORM,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R16_UNORM,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R16_UNORM,
GL_RGBA8, GL_RGBA16_EXT,
nullptr); nullptr);
return info; return info;
} }
case GL_COMPRESSED_RG11_EAC: case GL_COMPRESSED_RG11_EAC:
{ {
static constexpr Format info(GL_COMPRESSED_RG11_EAC, static constexpr Format info(GL_COMPRESSED_RG11_EAC,
angle::Format::ID::R8G8_UNORM, angle::Format::ID::R16G16_UNORM,
DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R16G16_UNORM,
DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R16G16_UNORM,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R16G16_UNORM,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R16G16_UNORM,
GL_RGBA8, GL_RGBA16_EXT,
nullptr); nullptr);
return info; return info;
} }
...@@ -532,28 +532,28 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev ...@@ -532,28 +532,28 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev
case GL_COMPRESSED_SIGNED_R11_EAC: case GL_COMPRESSED_SIGNED_R11_EAC:
{ {
static constexpr Format info(GL_COMPRESSED_SIGNED_R11_EAC, static constexpr Format info(GL_COMPRESSED_SIGNED_R11_EAC,
angle::Format::ID::R8_SNORM, angle::Format::ID::R16_SNORM,
DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_R16_SNORM,
DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_R16_SNORM,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_R16_SNORM,
GL_RGBA8_SNORM, GL_RGBA16_SNORM_EXT,
nullptr); nullptr);
return info; return info;
} }
case GL_COMPRESSED_SIGNED_RG11_EAC: case GL_COMPRESSED_SIGNED_RG11_EAC:
{ {
static constexpr Format info(GL_COMPRESSED_SIGNED_RG11_EAC, static constexpr Format info(GL_COMPRESSED_SIGNED_RG11_EAC,
angle::Format::ID::R8G8_SNORM, angle::Format::ID::R16G16_SNORM,
DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_R16G16_SNORM,
DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_R16G16_SNORM,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_R16G16_SNORM,
GL_RGBA8_SNORM, GL_RGBA16_SNORM_EXT,
nullptr); nullptr);
return info; return info;
} }
......
...@@ -63,8 +63,8 @@ ...@@ -63,8 +63,8 @@
} }
}, },
"GL_COMPRESSED_R11_EAC": { "GL_COMPRESSED_R11_EAC": {
"R8_UNORM": { "R16_UNORM": {
"GL_UNSIGNED_BYTE": "LoadEACR11ToR8" "GL_UNSIGNED_BYTE": "LoadEACR11ToR16"
} }
}, },
"GL_RGBA32UI": { "GL_RGBA32UI": {
...@@ -181,8 +181,8 @@ ...@@ -181,8 +181,8 @@
} }
}, },
"GL_COMPRESSED_SIGNED_RG11_EAC": { "GL_COMPRESSED_SIGNED_RG11_EAC": {
"R8G8_SNORM": { "R16G16_SNORM": {
"GL_UNSIGNED_BYTE": "LoadEACRG11SToRG8" "GL_UNSIGNED_BYTE": "LoadEACRG11SToRG16"
} }
}, },
"GL_DEPTH_COMPONENT16": { "GL_DEPTH_COMPONENT16": {
...@@ -322,8 +322,8 @@ ...@@ -322,8 +322,8 @@
} }
}, },
"GL_COMPRESSED_RG11_EAC": { "GL_COMPRESSED_RG11_EAC": {
"R8G8_UNORM": { "R16G16_UNORM": {
"GL_UNSIGNED_BYTE": "LoadEACRG11ToRG8" "GL_UNSIGNED_BYTE": "LoadEACRG11ToRG16"
} }
}, },
"GL_SRGB8_ALPHA8": { "GL_SRGB8_ALPHA8": {
...@@ -379,8 +379,8 @@ ...@@ -379,8 +379,8 @@
} }
}, },
"GL_COMPRESSED_SIGNED_R11_EAC": { "GL_COMPRESSED_SIGNED_R11_EAC": {
"R8_SNORM": { "R16_SNORM": {
"GL_UNSIGNED_BYTE": "LoadEACR11SToR8" "GL_UNSIGNED_BYTE": "LoadEACR11SToR16"
} }
}, },
"GL_COMPRESSED_RGB_S3TC_DXT1_EXT": { "GL_COMPRESSED_RGB_S3TC_DXT1_EXT": {
......
// GENERATED FILE - DO NOT EDIT. // GENERATED FILE - DO NOT EDIT.
// Generated by gen_load_functions_table.py using data from load_functions_data.json // Generated by gen_load_functions_table.py using data from load_functions_data.json
// //
// Copyright 2016 The ANGLE Project Authors. All rights reserved. // Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -214,24 +214,24 @@ LoadImageFunctionInfo BGRA_EXT_to_default(GLenum type) ...@@ -214,24 +214,24 @@ LoadImageFunctionInfo BGRA_EXT_to_default(GLenum type)
} }
} }
LoadImageFunctionInfo COMPRESSED_R11_EAC_to_R8_UNORM(GLenum type) LoadImageFunctionInfo COMPRESSED_R11_EAC_to_R16_UNORM(GLenum type)
{ {
switch (type) switch (type)
{ {
case GL_UNSIGNED_BYTE: case GL_UNSIGNED_BYTE:
return LoadImageFunctionInfo(LoadEACR11ToR8, true); return LoadImageFunctionInfo(LoadEACR11ToR16, true);
default: default:
UNREACHABLE(); UNREACHABLE();
return LoadImageFunctionInfo(UnreachableLoadFunction, true); return LoadImageFunctionInfo(UnreachableLoadFunction, true);
} }
} }
LoadImageFunctionInfo COMPRESSED_RG11_EAC_to_R8G8_UNORM(GLenum type) LoadImageFunctionInfo COMPRESSED_RG11_EAC_to_R16G16_UNORM(GLenum type)
{ {
switch (type) switch (type)
{ {
case GL_UNSIGNED_BYTE: case GL_UNSIGNED_BYTE:
return LoadImageFunctionInfo(LoadEACRG11ToRG8, true); return LoadImageFunctionInfo(LoadEACRG11ToRG16, true);
default: default:
UNREACHABLE(); UNREACHABLE();
return LoadImageFunctionInfo(UnreachableLoadFunction, true); return LoadImageFunctionInfo(UnreachableLoadFunction, true);
...@@ -347,24 +347,24 @@ LoadImageFunctionInfo COMPRESSED_RGB_S3TC_DXT1_EXT_to_default(GLenum type) ...@@ -347,24 +347,24 @@ LoadImageFunctionInfo COMPRESSED_RGB_S3TC_DXT1_EXT_to_default(GLenum type)
} }
} }
LoadImageFunctionInfo COMPRESSED_SIGNED_R11_EAC_to_R8_SNORM(GLenum type) LoadImageFunctionInfo COMPRESSED_SIGNED_R11_EAC_to_R16_SNORM(GLenum type)
{ {
switch (type) switch (type)
{ {
case GL_UNSIGNED_BYTE: case GL_UNSIGNED_BYTE:
return LoadImageFunctionInfo(LoadEACR11SToR8, true); return LoadImageFunctionInfo(LoadEACR11SToR16, true);
default: default:
UNREACHABLE(); UNREACHABLE();
return LoadImageFunctionInfo(UnreachableLoadFunction, true); return LoadImageFunctionInfo(UnreachableLoadFunction, true);
} }
} }
LoadImageFunctionInfo COMPRESSED_SIGNED_RG11_EAC_to_R8G8_SNORM(GLenum type) LoadImageFunctionInfo COMPRESSED_SIGNED_RG11_EAC_to_R16G16_SNORM(GLenum type)
{ {
switch (type) switch (type)
{ {
case GL_UNSIGNED_BYTE: case GL_UNSIGNED_BYTE:
return LoadImageFunctionInfo(LoadEACRG11SToRG8, true); return LoadImageFunctionInfo(LoadEACRG11SToRG16, true);
default: default:
UNREACHABLE(); UNREACHABLE();
return LoadImageFunctionInfo(UnreachableLoadFunction, true); return LoadImageFunctionInfo(UnreachableLoadFunction, true);
...@@ -1603,8 +1603,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma ...@@ -1603,8 +1603,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma
{ {
switch (angleFormat) switch (angleFormat)
{ {
case Format::ID::R8_UNORM: case Format::ID::R16_UNORM:
return COMPRESSED_R11_EAC_to_R8_UNORM; return COMPRESSED_R11_EAC_to_R16_UNORM;
default: default:
break; break;
} }
...@@ -1613,8 +1613,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma ...@@ -1613,8 +1613,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma
{ {
switch (angleFormat) switch (angleFormat)
{ {
case Format::ID::R8G8_UNORM: case Format::ID::R16G16_UNORM:
return COMPRESSED_RG11_EAC_to_R8G8_UNORM; return COMPRESSED_RG11_EAC_to_R16G16_UNORM;
default: default:
break; break;
} }
...@@ -1681,8 +1681,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma ...@@ -1681,8 +1681,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma
{ {
switch (angleFormat) switch (angleFormat)
{ {
case Format::ID::R8_SNORM: case Format::ID::R16_SNORM:
return COMPRESSED_SIGNED_R11_EAC_to_R8_SNORM; return COMPRESSED_SIGNED_R11_EAC_to_R16_SNORM;
default: default:
break; break;
} }
...@@ -1691,8 +1691,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma ...@@ -1691,8 +1691,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma
{ {
switch (angleFormat) switch (angleFormat)
{ {
case Format::ID::R8G8_SNORM: case Format::ID::R16G16_SNORM:
return COMPRESSED_SIGNED_RG11_EAC_to_R8G8_SNORM; return COMPRESSED_SIGNED_RG11_EAC_to_R16G16_SNORM;
default: default:
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment