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,
......
...@@ -53,15 +53,15 @@ static const int kNumPixelsInBlock = 16; ...@@ -53,15 +53,15 @@ static const int kNumPixelsInBlock = 16;
struct ETC2Block struct ETC2Block
{ {
// Decodes unsigned single or dual channel block to bytes // Decodes unsigned single or dual channel ETC2 block to 8-bit color
void decodeAsSingleChannel(uint8_t *dest, void decodeAsSingleETC2Channel(uint8_t *dest,
size_t x, size_t x,
size_t y, size_t y,
size_t w, size_t w,
size_t h, size_t h,
size_t destPixelStride, size_t destPixelStride,
size_t destRowPitch, size_t destRowPitch,
bool isSigned) const bool isSigned) const
{ {
for (size_t j = 0; j < 4 && (y + j) < h; j++) for (size_t j = 0; j < 4 && (y + j) < h; j++)
{ {
...@@ -71,11 +71,40 @@ struct ETC2Block ...@@ -71,11 +71,40 @@ struct ETC2Block
uint8_t *pixel = row + (i * destPixelStride); uint8_t *pixel = row + (i * destPixelStride);
if (isSigned) if (isSigned)
{ {
*pixel = clampSByte(getSingleChannel(i, j, isSigned)); *pixel = clampSByte(getSingleETC2Channel(i, j, isSigned));
}
else
{
*pixel = clampByte(getSingleETC2Channel(i, j, isSigned));
}
}
}
}
// Decodes unsigned single or dual channel EAC block to 16-bit color
void decodeAsSingleEACChannel(uint16_t *dest,
size_t x,
size_t y,
size_t w,
size_t h,
size_t destPixelStride,
size_t destRowPitch,
bool isSigned) const
{
for (size_t j = 0; j < 4 && (y + j) < h; j++)
{
uint16_t *row = reinterpret_cast<uint16_t *>(reinterpret_cast<uint8_t *>(dest) +
(j * destRowPitch));
for (size_t i = 0; i < 4 && (x + i) < w; i++)
{
uint16_t *pixel = row + (i * destPixelStride);
if (isSigned)
{
*pixel = renormalizeSignedEAC(getSingleEACChannel(i, j, isSigned));
} }
else else
{ {
*pixel = clampByte(getSingleChannel(i, j, isSigned)); *pixel = renormalizeUnsignedEAC(getSingleEACChannel(i, j, isSigned));
} }
} }
} }
...@@ -328,6 +357,19 @@ struct ETC2Block ...@@ -328,6 +357,19 @@ struct ETC2Block
return static_cast<signed char>(gl::clamp(value, -128, 127)); return static_cast<signed char>(gl::clamp(value, -128, 127));
} }
static uint16_t renormalizeUnsignedEAC(int value)
{
// Data is in the range 0 to 2047, clamp it and then scale it to 16-bit
return static_cast<uint16_t>(gl::clamp(value, 0, 2047)) << 5;
}
static int16_t renormalizeSignedEAC(int value)
{
// Data is in the range -1023 to 1023, clamp it and then scale it to 16-bit
// The spec states that -1024 invalid and should be clamped to -1023
return static_cast<int16_t>(gl::clamp(value, -1023, 1023)) * 32;
}
static R8G8B8A8 createRGBA(int red, int green, int blue, int alpha) static R8G8B8A8 createRGBA(int red, int green, int blue, int alpha)
{ {
R8G8B8A8 rgba; R8G8B8A8 rgba;
...@@ -1258,7 +1300,14 @@ struct ETC2Block ...@@ -1258,7 +1300,14 @@ struct ETC2Block
} }
// Single channel utility functions // Single channel utility functions
int getSingleChannel(size_t x, size_t y, bool isSigned) const int getSingleEACChannel(size_t x, size_t y, bool isSigned) const
{
int codeword = isSigned ? u.scblk.base_codeword.s : u.scblk.base_codeword.us;
int multiplier = (u.scblk.multiplier == 0) ? 1 : u.scblk.multiplier * 8;
return codeword * 8 + 4 + getSingleChannelModifier(x, y) * multiplier;
}
int getSingleETC2Channel(size_t x, size_t y, bool isSigned) const
{ {
int codeword = isSigned ? u.scblk.base_codeword.s : u.scblk.base_codeword.us; int codeword = isSigned ? u.scblk.base_codeword.s : u.scblk.base_codeword.us;
return codeword + getSingleChannelModifier(x, y) * u.scblk.multiplier; return codeword + getSingleChannelModifier(x, y) * u.scblk.multiplier;
...@@ -1328,8 +1377,8 @@ static const uint8_t DefaultETCAlphaValues[4][4] = ...@@ -1328,8 +1377,8 @@ static const uint8_t DefaultETCAlphaValues[4][4] =
{ 255, 255, 255, 255 }, { 255, 255, 255, 255 },
{ 255, 255, 255, 255 }, { 255, 255, 255, 255 },
}; };
// clang-format on
// clang-format on
void LoadR11EACToR8(size_t width, void LoadR11EACToR8(size_t width,
size_t height, size_t height,
size_t depth, size_t depth,
...@@ -1355,8 +1404,8 @@ void LoadR11EACToR8(size_t width, ...@@ -1355,8 +1404,8 @@ void LoadR11EACToR8(size_t width,
const ETC2Block *sourceBlock = sourceRow + (x / 4); const ETC2Block *sourceBlock = sourceRow + (x / 4);
uint8_t *destPixels = destRow + x; uint8_t *destPixels = destRow + x;
sourceBlock->decodeAsSingleChannel(destPixels, x, y, width, height, 1, sourceBlock->decodeAsSingleETC2Channel(destPixels, x, y, width, height, 1,
outputRowPitch, isSigned); outputRowPitch, isSigned);
} }
} }
} }
...@@ -1386,13 +1435,81 @@ void LoadRG11EACToRG8(size_t width, ...@@ -1386,13 +1435,81 @@ void LoadRG11EACToRG8(size_t width,
{ {
uint8_t *destPixelsRed = destRow + (x * 2); uint8_t *destPixelsRed = destRow + (x * 2);
const ETC2Block *sourceBlockRed = sourceRow + (x / 2); const ETC2Block *sourceBlockRed = sourceRow + (x / 2);
sourceBlockRed->decodeAsSingleChannel(destPixelsRed, x, y, width, height, 2, sourceBlockRed->decodeAsSingleETC2Channel(destPixelsRed, x, y, width, height, 2,
outputRowPitch, isSigned); outputRowPitch, isSigned);
uint8_t *destPixelsGreen = destPixelsRed + 1; uint8_t *destPixelsGreen = destPixelsRed + 1;
const ETC2Block *sourceBlockGreen = sourceBlockRed + 1; const ETC2Block *sourceBlockGreen = sourceBlockRed + 1;
sourceBlockGreen->decodeAsSingleChannel(destPixelsGreen, x, y, width, height, 2, sourceBlockGreen->decodeAsSingleETC2Channel(destPixelsGreen, x, y, width, height, 2,
outputRowPitch, isSigned); outputRowPitch, isSigned);
}
}
}
}
void LoadR11EACToR16(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,
bool isSigned)
{
for (size_t z = 0; z < depth; z++)
{
for (size_t y = 0; y < height; y += 4)
{
const ETC2Block *sourceRow =
priv::OffsetDataPointer<ETC2Block>(input, y / 4, z, inputRowPitch, inputDepthPitch);
uint16_t *destRow =
priv::OffsetDataPointer<uint16_t>(output, y, z, outputRowPitch, outputDepthPitch);
for (size_t x = 0; x < width; x += 4)
{
const ETC2Block *sourceBlock = sourceRow + (x / 4);
uint16_t *destPixels = destRow + x;
sourceBlock->decodeAsSingleEACChannel(destPixels, x, y, width, height, 1,
outputRowPitch, isSigned);
}
}
}
}
void LoadRG11EACToRG16(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,
bool isSigned)
{
for (size_t z = 0; z < depth; z++)
{
for (size_t y = 0; y < height; y += 4)
{
const ETC2Block *sourceRow =
priv::OffsetDataPointer<ETC2Block>(input, y / 4, z, inputRowPitch, inputDepthPitch);
uint16_t *destRow =
priv::OffsetDataPointer<uint16_t>(output, y, z, outputRowPitch, outputDepthPitch);
for (size_t x = 0; x < width; x += 4)
{
uint16_t *destPixelsRed = destRow + (x * 2);
const ETC2Block *sourceBlockRed = sourceRow + (x / 2);
sourceBlockRed->decodeAsSingleEACChannel(destPixelsRed, x, y, width, height, 2,
outputRowPitch, isSigned);
uint16_t *destPixelsGreen = destPixelsRed + 1;
const ETC2Block *sourceBlockGreen = sourceBlockRed + 1;
sourceBlockGreen->decodeAsSingleEACChannel(destPixelsGreen, x, y, width, height, 2,
outputRowPitch, isSigned);
} }
} }
} }
...@@ -1487,7 +1604,7 @@ void LoadETC2RGBA8ToRGBA8(size_t width, ...@@ -1487,7 +1604,7 @@ void LoadETC2RGBA8ToRGBA8(size_t width,
for (size_t x = 0; x < width; x += 4) for (size_t x = 0; x < width; x += 4)
{ {
const ETC2Block *sourceBlockAlpha = sourceRow + (x / 2); const ETC2Block *sourceBlockAlpha = sourceRow + (x / 2);
sourceBlockAlpha->decodeAsSingleChannel( sourceBlockAlpha->decodeAsSingleETC2Channel(
reinterpret_cast<uint8_t *>(decodedAlphaValues), x, y, width, height, 1, 4, reinterpret_cast<uint8_t *>(decodedAlphaValues), x, y, width, height, 1, 4,
false); false);
...@@ -1586,6 +1703,62 @@ void LoadEACRG11SToRG8(size_t width, ...@@ -1586,6 +1703,62 @@ void LoadEACRG11SToRG8(size_t width,
outputRowPitch, outputDepthPitch, true); outputRowPitch, outputDepthPitch, true);
} }
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)
{
LoadR11EACToR16(width, height, depth, input, inputRowPitch, inputDepthPitch, output,
outputRowPitch, outputDepthPitch, false);
}
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)
{
LoadR11EACToR16(width, height, depth, input, inputRowPitch, inputDepthPitch, output,
outputRowPitch, outputDepthPitch, true);
}
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)
{
LoadRG11EACToRG16(width, height, depth, input, inputRowPitch, inputDepthPitch, output,
outputRowPitch, outputDepthPitch, false);
}
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)
{
LoadRG11EACToRG16(width, height, depth, input, inputRowPitch, inputDepthPitch, output,
outputRowPitch, outputDepthPitch, true);
}
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