Add stencil8 option to Depth and Stencil of configs based on
support of stencil8 format from GLES.
Add stencil8 to configs
Adjust dEQP-EGL expectations
Unblocks dEQP-EGL.functional.*.*_no_depth_stencil tests
Test: angle_deqp_egl_tests

Bug: angleproject:3231
Change-Id: I57d7085a71a5b0dc45803351c9116a1694668852
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2430191
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This commit is contained in:
Jeff Vigil 2020-09-30 09:50:10 -07:00 коммит произвёл Commit Bot
Родитель 2f3d18f2f1
Коммит 348814f987
6 изменённых файлов: 55 добавлений и 7 удалений

Просмотреть файл

@ -791,6 +791,16 @@ bool DetermineCompressedTextureETCSupport(const TextureCapsMap &textureCaps)
return GetFormatSupport(textureCaps, requiredFormats, true, true, false, false, false); return GetFormatSupport(textureCaps, requiredFormats, true, true, false, false, false);
} }
// Checks for GL_OES_texture_stencil8 support
static bool DetermineStencilIndex8Support(const TextureCapsMap &textureCaps)
{
constexpr GLenum requiredFormats[] = {
GL_STENCIL_INDEX8,
};
return GetFormatSupport(textureCaps, requiredFormats, false, false, true, false, false);
}
void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps) void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps)
{ {
// TODO(ynovikov): rgb8rgba8OES, colorBufferHalfFloat, textureHalfFloat, textureHalfFloatLinear, // TODO(ynovikov): rgb8rgba8OES, colorBufferHalfFloat, textureHalfFloat, textureHalfFloatLinear,
@ -844,6 +854,7 @@ void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps)
textureCompressionBPTC = DetermineBPTCTextureSupport(textureCaps); textureCompressionBPTC = DetermineBPTCTextureSupport(textureCaps);
compressedTexturePVRTC = DeterminePVRTCTextureSupport(textureCaps); compressedTexturePVRTC = DeterminePVRTCTextureSupport(textureCaps);
compressedTexturePVRTCsRGB = DeterminePVRTCsRGBTextureSupport(textureCaps); compressedTexturePVRTCsRGB = DeterminePVRTCsRGBTextureSupport(textureCaps);
stencilIndex8 = DetermineStencilIndex8Support(textureCaps);
} }
const ExtensionInfoMap &GetExtensionInfoMap() const ExtensionInfoMap &GetExtensionInfoMap()

Просмотреть файл

@ -647,6 +647,9 @@ struct Extensions
// GL_EXT_buffer_storage // GL_EXT_buffer_storage
bool bufferStorageEXT = false; bool bufferStorageEXT = false;
// GL_OES_texture_stencil8
bool stencilIndex8 = false;
}; };
// Pointer to a boolean memeber of the Extensions struct // Pointer to a boolean memeber of the Extensions struct
@ -892,6 +895,9 @@ struct Caps
// Support for NPOT surfaces // Support for NPOT surfaces
bool textureNPOT; bool textureNPOT;
// Support for Stencil8 configs
bool stencil8;
}; };
struct DisplayExtensions struct DisplayExtensions

Просмотреть файл

@ -241,6 +241,7 @@ void DisplayVk::generateExtensions(egl::DisplayExtensions *outExtensions) const
void DisplayVk::generateCaps(egl::Caps *outCaps) const void DisplayVk::generateCaps(egl::Caps *outCaps) const
{ {
outCaps->textureNPOT = true; outCaps->textureNPOT = true;
outCaps->stencil8 = getRenderer()->getNativeExtensions().stencilIndex8;
} }
const char *DisplayVk::getWSILayer() const const char *DisplayVk::getWSILayer() const

Просмотреть файл

@ -51,8 +51,18 @@ egl::ConfigSet DisplayVkAndroid::generateConfigs()
{ {
// TODO (Issue 4062): Add conditional support for GL_RGB10_A2 and GL_RGBA16F when the // TODO (Issue 4062): Add conditional support for GL_RGB10_A2 and GL_RGBA16F when the
// Android Vulkan loader adds conditional support for them. // Android Vulkan loader adds conditional support for them.
constexpr GLenum kColorFormats[] = {GL_RGBA8, GL_RGB8, GL_RGB565}; const std::array<GLenum, 3> kColorFormats = {GL_RGBA8, GL_RGB8, GL_RGB565};
return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this);
std::vector<GLenum> depthStencilFormats(
egl_vk::kConfigDepthStencilFormats,
egl_vk::kConfigDepthStencilFormats + ArraySize(egl_vk::kConfigDepthStencilFormats));
if (getCaps().stencil8)
{
depthStencilFormats.push_back(GL_STENCIL_INDEX8);
}
return egl_vk::GenerateConfigs(kColorFormats.data(), kColorFormats.size(),
depthStencilFormats.data(), depthStencilFormats.size(), this);
} }
void DisplayVkAndroid::checkConfigSupport(egl::Config *config) void DisplayVkAndroid::checkConfigSupport(egl::Config *config)

Просмотреть файл

@ -134,9 +134,19 @@ egl::Error DisplayVkWin32::initialize(egl::Display *display)
egl::ConfigSet DisplayVkWin32::generateConfigs() egl::ConfigSet DisplayVkWin32::generateConfigs()
{ {
constexpr GLenum kColorFormats[] = {GL_RGB565, GL_BGRA8_EXT, GL_BGRX8_ANGLEX, GL_RGB10_A2_EXT, const std::array<GLenum, 5> kColorFormats = {GL_RGB565, GL_BGRA8_EXT, GL_BGRX8_ANGLEX,
GL_RGBA16F_EXT}; GL_RGB10_A2_EXT, GL_RGBA16F_EXT};
return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this);
std::vector<GLenum> depthStencilFormats(
egl_vk::kConfigDepthStencilFormats,
egl_vk::kConfigDepthStencilFormats + ArraySize(egl_vk::kConfigDepthStencilFormats));
if (getCaps().stencil8)
{
depthStencilFormats.push_back(GL_STENCIL_INDEX8);
}
return egl_vk::GenerateConfigs(kColorFormats.data(), kColorFormats.size(),
depthStencilFormats.data(), depthStencilFormats.size(), this);
} }
void DisplayVkWin32::checkConfigSupport(egl::Config *config) void DisplayVkWin32::checkConfigSupport(egl::Config *config)

Просмотреть файл

@ -87,8 +87,18 @@ SurfaceImpl *DisplayVkXcb::createWindowSurfaceVk(const egl::SurfaceState &state,
egl::ConfigSet DisplayVkXcb::generateConfigs() egl::ConfigSet DisplayVkXcb::generateConfigs()
{ {
constexpr GLenum kColorFormats[] = {GL_BGRA8_EXT}; const std::array<GLenum, 1> kColorFormats = {GL_BGRA8_EXT};
return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this);
std::vector<GLenum> depthStencilFormats(
egl_vk::kConfigDepthStencilFormats,
egl_vk::kConfigDepthStencilFormats + ArraySize(egl_vk::kConfigDepthStencilFormats));
if (getCaps().stencil8)
{
depthStencilFormats.push_back(GL_STENCIL_INDEX8);
}
return egl_vk::GenerateConfigs(kColorFormats.data(), kColorFormats.size(),
depthStencilFormats.data(), depthStencilFormats.size(), this);
} }
void DisplayVkXcb::checkConfigSupport(egl::Config *config) void DisplayVkXcb::checkConfigSupport(egl::Config *config)