Commit e3939b98 by Minmin Gong Committed by Corentin Wallez

D3D11: Transcode ETC1 to BC1.

Adds a new extension to allow transcode ETC formats to suitable BC formats. This commit implements ETC1 to BC1. More formats will be supported soon. BUG=angleproject:1285 Change-Id: Iacbfbc2248dfe1aebf24b92696249a9404e331cd Reviewed-on: https://chromium-review.googlesource.com/316511Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent 7718c05b
Name
ANGLE_lossy_etc_decode
Name Strings
GL_ANGLE_lossy_etc_decode
Contributors
Minmin Gong (mgong 'at' microsoft.com)
Contacts
Minmin Gong (mgong 'at' microsoft.com)
Status
Draft
Version
Last Modified Date: Nov 25, 2015
Author Revision: 1
Number
TBD
Dependencies
Requires OpenGL ES 3.0 for ETC2 and EAC formats, or OpenGL ES 2.0 and
OES_compressed_ETC1_RGB8_texture for ETC1 format.
The extension is written against the OpenGL ES 2.0 specification.
Overview
Both the OpenGL ES 3.0 specification and OES_compressed_ETC1_RGB8_texture
specify that Ericsson Texture Compression (ETC) decoding must not be lossy.
The goal of this extension is to allow a lossy decode of
compressed textures in the ETC formats in OpenGL ES, for lower memory
and bandwidth consumption.
This extension uses the same ETC compression format as OpenGL ES 3.0
and OES_compressed_ETC1_RGB8_texture, with the restriction that the texture
dimensions must be a multiple of four (except for mip levels where the
dimensions are either 2 or 1). And the requirement that ETC decoding must
not be lossy is relaxed.
See OES_compressed_ETC1_RGB8_texture for a description of the ETC1 format.
Also see OpenGL ES 3.0 specification appendix C.2 (ETC Compressed Texture
ImageFormats) for a description of ETC2 and EAC formats.
IP Status
See Ericsson's "IP Statement"
New Procedures and Functions
None.
New Types
None.
New Tokens
Accepted by the <internalformat> parameter of CompressedTexImage2D
and the <format> parameter of CompressedTexSubImage2D:
ETC1_RGB8_LOSSY_DECODE_ANGLE 0x9690
COMPRESSED_R11_LOSSY_DECODE_EAC_ANGLE 0x9691
COMPRESSED_SIGNED_R11_LOSSY_DECODE_EAC_ANGLE 0x9692
COMPRESSED_RG11_LOSSY_DECODE_EAC_ANGLE 0x9693
COMPRESSED_SIGNED_RG11_LOSSY_DECODE_EAC_ANGLE 0x9694
COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE 0x9695
COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE 0x9696
COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE 0x9697
COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE 0x9698
COMPRESSED_RGBA8_LOSSY_DECODE_ETC2_EAC_ANGLE 0x9699
COMPRESSED_SRGB8_ALPHA8_LOSSY_DECODE_ETC2_EAC_ANGLE 0x969A
Additions to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization)
Add the following to Section 3.7.3 (Compressed Texture Images)
(at the end of the description of the CompressedTexImage2D command):
Compressed Internal Format Base Internal Format
========================== ====================
ETC1_RGB8_LOSSY_DECODE_ANGLE RGB
COMPRESSED_R11_LOSSY_DECODE_EAC_ANGLE R
COMPRESSED_SIGNED_R11_LOSSY_DECODE_EAC_ANGLE R
COMPRESSED_RG11_LOSSY_DECODE_EAC_ANGLE RG
COMPRESSED_SIGNED_RG11_LOSSY_DECODE_EAC_ANGLE RG
COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE RGB
COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE RGB
COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE RGBA
COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE RGBA
COMPRESSED_RGBA8_LOSSY_DECODE_ETC2_EAC_ANGLE RGBA
COMPRESSED_SRGB8_ALPHA8_LOSSY_DECODE_ETC2_EAC_ANGLE RGBA
Table 3.x: Specific Compressed Internal Formats
If <internalformat> is one of the ETC lossy decode formats listed in
Table 3.x, the compressed texture is stored in an unspecified compressed
texture format, that may introduce losses of precision in the texture data.
The GL and the ETC texture compression algorithm support only 2D images
without borders.
CompressedTexImage2D will produce the INVALID_OPERATION error when
<internalformat> is one of the lossy decode ETC-format values from
Table 3.x under the following conditions:
* <border> is non-zero.
* <width> is not one, two, nor a multiple of four.
* <height> is not one, two, nor a multiple of four.
Add the following to Section 3.7.3 (Compressed Texture Images)
(at the end of the description of the CompressedTexSubImage2D command):
If the internal format of the texture image being modified is an ETC-format
listed in Table 3.x, the compressed texture is stored in an unspecified
compressed texture format. The xoffset and yoffset must also be aligned to
4x4 texel block boundaries, since ETC encoding makes it difficult to modify
non-aligned regions. CompressedTexSubImage2D will result in an
INVALID_OPERATION error only if one of the following conditions occurs:
* <width> is not a multiple of four nor equal to TEXTURE_WIDTH.
* <height> is not a multiple of four nor equal to TEXTURE_HEIGHT.
* <xoffset> or <yoffset> is not a multiple of four.
* <format> does not match the internal format of the texture image
being modified.
Errors
INVALID_OPERATION is generated by CompressedTexImage2D if
lossy decode ETC-format is used and <internalformat> is one of the
compressed internal formats from Table 3.x and any of the following apply:
- <border> is not equal to zero.
- <width> is not one, two, nor a multiple of four.
- <height> is not one, two, nor a multiple of four.
INVALID_OPERATION is generated by CompressedTexSubImage2D if
lossy decode ETC-format is used and <format> is one of the compressed
interal formats from Table 3.x and any of the following apply:
- <width> is not a multiple of four nor equal to TEXTURE_WIDTH;
- <height> is not a multiple of four nor equal to TEXTURE_HEIGHT;
- <xoffset> or <yoffset> is not a multiple of four;
- <format> does not match the internal format of the texture image
being modified.
New State
None.
Revision History
Revision 1, 2015/11/25 - mgong
- Initial revision
...@@ -2920,6 +2920,21 @@ GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); ...@@ -2920,6 +2920,21 @@ GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
#define GL_SHADER_BINARY_VIV 0x8FC4 #define GL_SHADER_BINARY_VIV 0x8FC4
#endif /* GL_VIV_shader_binary */ #endif /* GL_VIV_shader_binary */
#ifndef GL_ANGLE_lossy_etc_decode
#define GL_ANGLE_lossy_etc_decode 1
#define GL_ETC1_RGB8_LOSSY_DECODE_ANGLE 0x9690
#define GL_COMPRESSED_R11_LOSSY_DECODE_EAC_ANGLE 0x9691
#define GL_COMPRESSED_SIGNED_R11_LOSSY_DECODE_EAC_ANGLE 0x9692
#define GL_COMPRESSED_RG11_LOSSY_DECODE_EAC_ANGLE 0x9693
#define GL_COMPRESSED_SIGNED_RG11_LOSSY_DECODE_EAC_ANGLE 0x9694
#define GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE 0x9695
#define GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE 0x9696
#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE 0x9697
#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE 0x9698
#define GL_COMPRESSED_RGBA8_LOSSY_DECODE_ETC2_EAC_ANGLE 0x9699
#define GL_COMPRESSED_SRGB8_ALPHA8_LOSSY_DECODE_ETC2_EAC_ANGLE 0x969A
#endif /* GL_ANGLE_lossy_etc_decode */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -156,6 +156,7 @@ Extensions::Extensions() ...@@ -156,6 +156,7 @@ Extensions::Extensions()
maxDebugGroupStackDepth(0), maxDebugGroupStackDepth(0),
maxLabelLength(0), maxLabelLength(0),
noError(false), noError(false),
lossyETCDecode(false),
colorBufferFloat(false) colorBufferFloat(false)
{ {
} }
...@@ -225,6 +226,8 @@ std::vector<std::string> Extensions::getStrings() const ...@@ -225,6 +226,8 @@ std::vector<std::string> Extensions::getStrings() const
InsertExtensionString("GL_KHR_debug", debug, &extensionStrings); InsertExtensionString("GL_KHR_debug", debug, &extensionStrings);
// TODO(jmadill): Enable this when complete. // TODO(jmadill): Enable this when complete.
//InsertExtensionString("GL_KHR_no_error", noError, &extensionStrings); //InsertExtensionString("GL_KHR_no_error", noError, &extensionStrings);
InsertExtensionString("GL_ANGLE_lossy_etc_decode", lossyETCDecode, &extensionStrings);
// clang-format on // clang-format on
return extensionStrings; return extensionStrings;
......
...@@ -275,6 +275,9 @@ struct Extensions ...@@ -275,6 +275,9 @@ struct Extensions
// KHR_no_error // KHR_no_error
bool noError; bool noError;
// GL_ANGLE_lossy_etc_decode
bool lossyETCDecode;
// ES3 Extension support // ES3 Extension support
// GL_EXT_color_buffer_float // GL_EXT_color_buffer_float
......
...@@ -565,6 +565,10 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() ...@@ -565,6 +565,10 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
// - It affects only validation of internalformat in RenderbufferStorageMultisample. // - It affects only validation of internalformat in RenderbufferStorageMultisample.
// | Internal format | |D |S |X | Format | Type | Component type | Supported | Renderable | Filterable | // | Internal format | |D |S |X | Format | Type | Component type | Supported | Renderable | Filterable |
map.insert(InternalFormatInfoPair(GL_STENCIL_INDEX8, DepthStencilFormat(0, 8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, RequireES<2>, RequireES<2>, NeverSupported))); map.insert(InternalFormatInfoPair(GL_STENCIL_INDEX8, DepthStencilFormat(0, 8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, RequireES<2>, RequireES<2>, NeverSupported)));
// From GL_ANGLE_lossy_etc_decode
map.insert(InternalFormatInfoPair(GL_ETC1_RGB8_LOSSY_DECODE_ANGLE, CompressedFormat(4, 4, 64, 3, GL_ETC1_RGB8_OES, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::lossyETCDecode>, NeverSupported, AlwaysSupported)));
// clang-format on // clang-format on
return map; return map;
......
...@@ -1103,5 +1103,14 @@ ...@@ -1103,5 +1103,14 @@
"requiresConversion": "true" "requiresConversion": "true"
} }
] ]
},
"GL_ETC1_RGB8_LOSSY_DECODE_ANGLE": {
"GL_UNSIGNED_BYTE": [
{
"loadFunction": "LoadETC1RGB8ToBC1",
"dxgiFormat": "DXGI_FORMAT_BC1_UNORM",
"requiresConversion": "true"
}
]
} }
} }
\ No newline at end of file
...@@ -771,6 +771,24 @@ const std::map<GLenum, LoadImageFunction> &GetLoadFunctionsMap(GLenum internalFo ...@@ -771,6 +771,24 @@ const std::map<GLenum, LoadImageFunction> &GetLoadFunctionsMap(GLenum internalFo
} }
} }
} }
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
{
switch (dxgiFormat)
{
case DXGI_FORMAT_BC1_UNORM:
{
static const std::map<GLenum, LoadImageFunction> loadFunctionsMap = []() {
std::map<GLenum, LoadImageFunction> loadMap;
loadMap[GL_UNSIGNED_BYTE] = LoadETC1RGB8ToBC1;
return loadMap;
}();
return loadFunctionsMap;
}
default:
break;
}
}
case GL_ETC1_RGB8_OES: case GL_ETC1_RGB8_OES:
{ {
switch (dxgiFormat) switch (dxgiFormat)
......
...@@ -1218,6 +1218,7 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons ...@@ -1218,6 +1218,7 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
extensions->packSubimage = true; extensions->packSubimage = true;
extensions->vertexArrayObject = true; extensions->vertexArrayObject = true;
extensions->noError = true; extensions->noError = true;
extensions->lossyETCDecode = true;
// D3D11 Feature Level 10_0+ uses SV_IsFrontFace in HLSL to emulate gl_FrontFacing. // D3D11 Feature Level 10_0+ uses SV_IsFrontFace in HLSL to emulate gl_FrontFacing.
// D3D11 Feature Level 9_3 doesn't support SV_IsFrontFace, and has no equivalent, so can't support gl_FrontFacing. // D3D11 Feature Level 9_3 doesn't support SV_IsFrontFace, and has no equivalent, so can't support gl_FrontFacing.
......
...@@ -238,6 +238,12 @@ ...@@ -238,6 +238,12 @@
"srvFormat": "DXGI_FORMAT_R8G8B8A8_UNORM" "srvFormat": "DXGI_FORMAT_R8G8B8A8_UNORM"
} }
], ],
"GL_ETC1_RGB8_LOSSY_DECODE_ANGLE": [
{
"texFormat": "DXGI_FORMAT_BC1_UNORM",
"srvFormat": "DXGI_FORMAT_BC1_UNORM"
}
],
"GL_LUMINANCE": [ "GL_LUMINANCE": [
{ {
"texFormat": "DXGI_FORMAT_R8G8B8A8_UNORM", "texFormat": "DXGI_FORMAT_R8G8B8A8_UNORM",
......
...@@ -732,6 +732,22 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat, ...@@ -732,6 +732,22 @@ const TextureFormat &GetTextureFormatInfo(GLenum internalFormat,
break; break;
} }
} }
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
{
if (AnyDevice(renderer11DeviceCaps))
{
static const TextureFormat textureFormat = GetD3D11FormatInfo(internalFormat,
DXGI_FORMAT_BC1_UNORM,
DXGI_FORMAT_BC1_UNORM,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_UNKNOWN);
return textureFormat;
}
else
{
break;
}
}
case GL_ETC1_RGB8_OES: case GL_ETC1_RGB8_OES:
{ {
if (AnyDevice(renderer11DeviceCaps)) if (AnyDevice(renderer11DeviceCaps))
......
...@@ -26,6 +26,16 @@ void LoadETC1RGB8ToRGBA8(size_t width, ...@@ -26,6 +26,16 @@ void LoadETC1RGB8ToRGBA8(size_t width,
size_t outputRowPitch, size_t outputRowPitch,
size_t outputDepthPitch); size_t outputDepthPitch);
void LoadETC1RGB8ToBC1(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 LoadEACR11ToR8(size_t width, void LoadEACR11ToR8(size_t width,
size_t height, size_t height,
size_t depth, size_t depth,
......
...@@ -334,6 +334,7 @@ bool CompressedTextureFormatRequiresExactSize(GLenum internalFormat) ...@@ -334,6 +334,7 @@ bool CompressedTextureFormatRequiresExactSize(GLenum internalFormat)
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
return true; return true;
default: default:
......
...@@ -195,6 +195,14 @@ bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level, ...@@ -195,6 +195,14 @@ bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level,
return false; return false;
} }
break; break;
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
if (!context->getExtensions().lossyETCDecode)
{
context->recordError(
Error(GL_INVALID_ENUM, "ANGLE_lossy_etc_decode extension is not supported"));
return false;
}
break;
default: default:
context->recordError(Error( context->recordError(Error(
GL_INVALID_ENUM, "internalformat is not a supported compressed internal format")); GL_INVALID_ENUM, "internalformat is not a supported compressed internal format"));
...@@ -398,6 +406,21 @@ bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level, ...@@ -398,6 +406,21 @@ bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level,
return false; return false;
} }
break; break;
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
if (context->getExtensions().lossyETCDecode)
{
context->recordError(
Error(GL_INVALID_OPERATION,
"ETC1_RGB8_LOSSY_DECODE_ANGLE can't work with this type."));
return false;
}
else
{
context->recordError(
Error(GL_INVALID_ENUM, "ANGLE_lossy_etc_decode extension is not supported."));
return false;
}
break;
case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT:
case GL_DEPTH_STENCIL_OES: case GL_DEPTH_STENCIL_OES:
if (!context->getExtensions().depthTextures) if (!context->getExtensions().depthTextures)
...@@ -564,6 +587,7 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -564,6 +587,7 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
case GL_ETC1_RGB8_OES: case GL_ETC1_RGB8_OES:
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
context->recordError(Error(GL_INVALID_OPERATION)); context->recordError(Error(GL_INVALID_OPERATION));
return false; return false;
case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT:
...@@ -716,6 +740,20 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context, ...@@ -716,6 +740,20 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
return false; return false;
} }
break; break;
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
if (context->getExtensions().lossyETCDecode)
{
context->recordError(Error(GL_INVALID_OPERATION,
"ETC1_RGB8_LOSSY_DECODE_ANGLE can't be copied to."));
return false;
}
else
{
context->recordError(
Error(GL_INVALID_ENUM, "ANGLE_lossy_etc_decode extension is not supported."));
return false;
}
break;
case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT16: case GL_DEPTH_COMPONENT16:
case GL_DEPTH_COMPONENT32_OES: case GL_DEPTH_COMPONENT32_OES:
...@@ -840,6 +878,14 @@ bool ValidateES2TexStorageParameters(Context *context, GLenum target, GLsizei le ...@@ -840,6 +878,14 @@ bool ValidateES2TexStorageParameters(Context *context, GLenum target, GLsizei le
return false; return false;
} }
break; break;
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
if (!context->getExtensions().lossyETCDecode)
{
context->recordError(
Error(GL_INVALID_ENUM, "ANGLE_lossy_etc_decode extension is not supported."));
return false;
}
break;
case GL_RGBA32F_EXT: case GL_RGBA32F_EXT:
case GL_RGB32F_EXT: case GL_RGB32F_EXT:
case GL_ALPHA32F_EXT: case GL_ALPHA32F_EXT:
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
'<(angle_path)/src/tests/gl_tests/DiscardFramebufferEXTTest.cpp', '<(angle_path)/src/tests/gl_tests/DiscardFramebufferEXTTest.cpp',
'<(angle_path)/src/tests/gl_tests/DrawBuffersTest.cpp', '<(angle_path)/src/tests/gl_tests/DrawBuffersTest.cpp',
'<(angle_path)/src/tests/gl_tests/DrawElementsTest.cpp', '<(angle_path)/src/tests/gl_tests/DrawElementsTest.cpp',
'<(angle_path)/src/tests/gl_tests/ETCTextureTest.cpp',
'<(angle_path)/src/tests/gl_tests/FenceSyncTests.cpp', '<(angle_path)/src/tests/gl_tests/FenceSyncTests.cpp',
'<(angle_path)/src/tests/gl_tests/FramebufferFormatsTest.cpp', '<(angle_path)/src/tests/gl_tests/FramebufferFormatsTest.cpp',
'<(angle_path)/src/tests/gl_tests/FramebufferRenderMipmapTest.cpp', '<(angle_path)/src/tests/gl_tests/FramebufferRenderMipmapTest.cpp',
......
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// ETCTextureTest:
// Tests for ETC lossy decode formats.
//
#include "test_utils/ANGLETest.h"
using namespace angle;
namespace
{
class ETCTextureTest : public ANGLETest
{
protected:
ETCTextureTest() : mTexture(0u)
{
setWindowWidth(128);
setWindowHeight(128);
setConfigRedBits(8);
setConfigGreenBits(8);
setConfigBlueBits(8);
setConfigAlphaBits(8);
}
void SetUp() override
{
ANGLETest::SetUp();
glGenTextures(1, &mTexture);
ASSERT_GL_NO_ERROR();
}
void TearDown() override
{
glDeleteTextures(1, &mTexture);
ANGLETest::TearDown();
}
GLuint mTexture;
};
// Tests a texture with ETC1 lossy decode format
TEST_P(ETCTextureTest, ETC1Validation)
{
bool supported = extensionEnabled("GL_ANGLE_lossy_etc_decode");
glBindTexture(GL_TEXTURE_2D, mTexture);
GLubyte pixel[8] = {0};
glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_ETC1_RGB8_LOSSY_DECODE_ANGLE, 4, 4, 0,
sizeof(pixel), pixel);
if (supported)
{
EXPECT_GL_NO_ERROR();
glCompressedTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 4, 4, GL_ETC1_RGB8_LOSSY_DECODE_ANGLE,
sizeof(pixel), pixel);
EXPECT_GL_NO_ERROR();
}
else
{
EXPECT_GL_ERROR(GL_INVALID_ENUM);
}
}
ANGLE_INSTANTIATE_TEST(ETCTextureTest,
ES2_D3D9(),
ES2_D3D11(),
ES2_D3D11_FL9_3(),
ES3_D3D11(),
ES2_OPENGL(),
ES3_OPENGL());
} // anonymous namespace
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