Commit 5ee3826e by Sunny Sachanandani Committed by Commit Bot

Support GL_EXT_texture_type_2_10_10_10_REV on D3D backend

Bug: angleproject:5817 Change-Id: Ie572a252946f87d125f9074f2144928bb43d78b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2802861Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
parent 08b7c55c
......@@ -4,7 +4,7 @@
"src/libANGLE/renderer/gen_load_functions_table.py":
"bbc2f2cbce34313d7c06a3511eff5a1f",
"src/libANGLE/renderer/load_functions_data.json":
"09e92e0cb6a1f3034df1c43769d533b9",
"912670e6835fbe5074533bbeba44ef02",
"src/libANGLE/renderer/load_functions_table_autogen.cpp":
"0f35afffa4c8a4a78ae49bd0e4956565"
"bd36b4eca9fcbfe16c0911b58dc1f449"
}
\ No newline at end of file
......@@ -4,9 +4,9 @@
"src/libANGLE/renderer/d3d/d3d11/gen_texture_format_table.py":
"8ad208de51aafef78452ae7f6cf8b340",
"src/libANGLE/renderer/d3d/d3d11/texture_format_data.json":
"9bef26093805f5499eceb5a615648aea",
"b491f92f2adadad269248eb17dee8821",
"src/libANGLE/renderer/d3d/d3d11/texture_format_map.json":
"d45aee3519b8c9a15411617bbb00c77f",
"src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp":
"5039d1441acfcdad5271a626151b4d99"
"184a0dde69048877ccf9893daa786572"
}
\ No newline at end of file
......@@ -401,6 +401,18 @@ static bool DetermineRGTextureSupport(const TextureCapsMap &textureCaps,
return GetFormatSupport(textureCaps, requiredFormats, true, true, true, true, false);
}
static bool DetermineTextureFormat2101010Support(const TextureCapsMap &textureCaps)
{
// GL_EXT_texture_type_2_10_10_10_REV specifies both RGBA and RGB support whereas desktop GL
// only specifies RGBA support, so check both RGBA and RGB before marking as supported.
constexpr GLenum requiredFormats[] = {
GL_RGB10_A2,
GL_RGB10_UNORM_ANGLEX,
};
return GetFormatSupport(textureCaps, requiredFormats, true, true, false, false, false);
}
// Check for GL_EXT_texture_compression_dxt1 support
static bool DetermineDXT1TextureSupport(const TextureCapsMap &textureCaps)
{
......@@ -824,10 +836,11 @@ void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps)
textureFloatOES = DetermineFloatTextureSupport(textureCaps);
textureFloatLinearOES = DetermineFloatTextureFilteringSupport(textureCaps, textureFloatOES);
textureRG = DetermineRGTextureSupport(textureCaps, textureHalfFloat, textureFloatOES);
colorBufferHalfFloat = textureHalfFloat && DetermineColorBufferHalfFloatSupport(textureCaps);
textureCompressionDXT1 = DetermineDXT1TextureSupport(textureCaps);
textureCompressionDXT3 = DetermineDXT3TextureSupport(textureCaps);
textureCompressionDXT5 = DetermineDXT5TextureSupport(textureCaps);
colorBufferHalfFloat = textureHalfFloat && DetermineColorBufferHalfFloatSupport(textureCaps);
textureFormat2101010REV = DetermineTextureFormat2101010Support(textureCaps);
textureCompressionDXT1 = DetermineDXT1TextureSupport(textureCaps);
textureCompressionDXT3 = DetermineDXT3TextureSupport(textureCaps);
textureCompressionDXT5 = DetermineDXT5TextureSupport(textureCaps);
textureCompressionS3TCsRGB = DetermineS3TCsRGBTextureSupport(textureCaps);
textureCompressionASTCLDRKHR = DetermineASTCLDRTextureSupport(textureCaps);
textureCompressionASTCOES = DetermineASTCOESTExtureSupport(textureCaps);
......
......@@ -111,6 +111,7 @@ struct Extensions
// GL_OES_texture_half_float, GL_OES_texture_half_float_linear
// GL_OES_texture_float, GL_OES_texture_float_linear
// GL_EXT_texture_rg
// GL_EXT_texture_type_2_10_10_10_REV
// GL_EXT_texture_compression_dxt1, GL_ANGLE_texture_compression_dxt3,
// GL_ANGLE_texture_compression_dxt5
// GL_KHR_texture_compression_astc_ldr, GL_OES_texture_compression_astc.
......@@ -180,9 +181,6 @@ struct Extensions
bool textureHalfFloat = false;
bool textureHalfFloatLinear = false;
// GL_EXT_texture_type_2_10_10_10_REV
bool textureFormat2101010REV = false;
// GL_OES_texture_float and GL_OES_texture_float_linear
// Implies that TextureCaps for GL_RGB32F, GL_RGBA32F, GL_ALPHA16F_EXT, GL_LUMINANCE16F_EXT and
// GL_LUMINANCE_ALPHA16F_EXT exist
......@@ -194,6 +192,9 @@ struct Extensions
// floating point extensions are also present) exist
bool textureRG = false;
// GL_EXT_texture_type_2_10_10_10_REV
bool textureFormat2101010REV = false;
// GL_EXT_texture_compression_dxt1, GL_ANGLE_texture_compression_dxt3 and
// GL_ANGLE_texture_compression_dxt5 Implies that TextureCaps exist for
// GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
......
......@@ -488,6 +488,15 @@
"bits": { "red": 10, "green": 10, "blue": 10, "alpha": 2 },
"glInternalFormat": "GL_RGB10_A2UI"
},
"R10G10B10X2_UNORM": {
"texFormat": "DXGI_FORMAT_R10G10B10A2_UNORM",
"srvFormat": "DXGI_FORMAT_R10G10B10A2_UNORM",
"rtvFormat": "DXGI_FORMAT_R10G10B10A2_UNORM",
"channels": "rgba",
"componentType": "unorm",
"bits": { "red": 10, "green": 10, "blue": 10, "alpha": 2 },
"glInternalFormat": "GL_RGB10_UNORM_ANGLEX"
},
"R16G16B16A16_SINT": {
"texFormat": "DXGI_FORMAT_R16G16B16A16_SINT",
"srvFormat": "DXGI_FORMAT_R16G16B16A16_SINT",
......
......@@ -2098,6 +2098,20 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev
nullptr);
return info;
}
case GL_RGB10_UNORM_ANGLEX:
{
static constexpr Format info(GL_RGB10_UNORM_ANGLEX,
angle::FormatID::R10G10B10X2_UNORM,
DXGI_FORMAT_R10G10B10A2_UNORM,
DXGI_FORMAT_R10G10B10A2_UNORM,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_R10G10B10A2_UNORM,
DXGI_FORMAT_UNKNOWN,
DXGI_FORMAT_R10G10B10A2_UNORM,
GL_RGBA16_EXT,
nullptr);
return info;
}
case GL_RGB16F:
{
static constexpr Format info(GL_RGB16F,
......
......@@ -231,6 +231,9 @@
"GL_RGB10_UNORM_ANGLEX": {
"R10G10B10A2_UNORM": {
"GL_UNSIGNED_INT_2_10_10_10_REV": "LoadRGB10A2ToRGB10X2"
},
"R10G10B10X2_UNORM": {
"GL_UNSIGNED_INT_2_10_10_10_REV": "LoadRGB10A2ToRGB10X2"
}
},
"GL_COMPRESSED_SIGNED_RG11_EAC": {
......
......@@ -2380,6 +2380,18 @@ LoadImageFunctionInfo RGB10_UNORM_ANGLEX_to_R10G10B10A2_UNORM(GLenum type)
}
}
LoadImageFunctionInfo RGB10_UNORM_ANGLEX_to_R10G10B10X2_UNORM(GLenum type)
{
switch (type)
{
case GL_UNSIGNED_INT_2_10_10_10_REV:
return LoadImageFunctionInfo(LoadRGB10A2ToRGB10X2, true);
default:
UNREACHABLE();
return LoadImageFunctionInfo(UnreachableLoadFunction, true);
}
}
LoadImageFunctionInfo RGB16F_to_R16G16B16A16_FLOAT(GLenum type)
{
switch (type)
......@@ -4143,6 +4155,8 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, FormatID angleFormat)
{
case FormatID::R10G10B10A2_UNORM:
return RGB10_UNORM_ANGLEX_to_R10G10B10A2_UNORM;
case FormatID::R10G10B10X2_UNORM:
return RGB10_UNORM_ANGLEX_to_R10G10B10X2_UNORM;
default:
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