зеркало из https://github.com/AvaloniaUI/angle.git
EGL: Add stencil8 to configs
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:
Родитель
2f3d18f2f1
Коммит
348814f987
|
@ -791,6 +791,16 @@ bool DetermineCompressedTextureETCSupport(const TextureCapsMap &textureCaps)
|
|||
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)
|
||||
{
|
||||
// TODO(ynovikov): rgb8rgba8OES, colorBufferHalfFloat, textureHalfFloat, textureHalfFloatLinear,
|
||||
|
@ -844,6 +854,7 @@ void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps)
|
|||
textureCompressionBPTC = DetermineBPTCTextureSupport(textureCaps);
|
||||
compressedTexturePVRTC = DeterminePVRTCTextureSupport(textureCaps);
|
||||
compressedTexturePVRTCsRGB = DeterminePVRTCsRGBTextureSupport(textureCaps);
|
||||
stencilIndex8 = DetermineStencilIndex8Support(textureCaps);
|
||||
}
|
||||
|
||||
const ExtensionInfoMap &GetExtensionInfoMap()
|
||||
|
|
|
@ -647,6 +647,9 @@ struct Extensions
|
|||
|
||||
// GL_EXT_buffer_storage
|
||||
bool bufferStorageEXT = false;
|
||||
|
||||
// GL_OES_texture_stencil8
|
||||
bool stencilIndex8 = false;
|
||||
};
|
||||
|
||||
// Pointer to a boolean memeber of the Extensions struct
|
||||
|
@ -892,6 +895,9 @@ struct Caps
|
|||
|
||||
// Support for NPOT surfaces
|
||||
bool textureNPOT;
|
||||
|
||||
// Support for Stencil8 configs
|
||||
bool stencil8;
|
||||
};
|
||||
|
||||
struct DisplayExtensions
|
||||
|
|
|
@ -241,6 +241,7 @@ void DisplayVk::generateExtensions(egl::DisplayExtensions *outExtensions) const
|
|||
void DisplayVk::generateCaps(egl::Caps *outCaps) const
|
||||
{
|
||||
outCaps->textureNPOT = true;
|
||||
outCaps->stencil8 = getRenderer()->getNativeExtensions().stencilIndex8;
|
||||
}
|
||||
|
||||
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
|
||||
// Android Vulkan loader adds conditional support for them.
|
||||
constexpr GLenum kColorFormats[] = {GL_RGBA8, GL_RGB8, GL_RGB565};
|
||||
return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this);
|
||||
const std::array<GLenum, 3> kColorFormats = {GL_RGBA8, GL_RGB8, GL_RGB565};
|
||||
|
||||
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)
|
||||
|
|
|
@ -134,9 +134,19 @@ egl::Error DisplayVkWin32::initialize(egl::Display *display)
|
|||
|
||||
egl::ConfigSet DisplayVkWin32::generateConfigs()
|
||||
{
|
||||
constexpr GLenum kColorFormats[] = {GL_RGB565, GL_BGRA8_EXT, GL_BGRX8_ANGLEX, GL_RGB10_A2_EXT,
|
||||
GL_RGBA16F_EXT};
|
||||
return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this);
|
||||
const std::array<GLenum, 5> kColorFormats = {GL_RGB565, GL_BGRA8_EXT, GL_BGRX8_ANGLEX,
|
||||
GL_RGB10_A2_EXT, GL_RGBA16F_EXT};
|
||||
|
||||
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)
|
||||
|
|
|
@ -87,8 +87,18 @@ SurfaceImpl *DisplayVkXcb::createWindowSurfaceVk(const egl::SurfaceState &state,
|
|||
|
||||
egl::ConfigSet DisplayVkXcb::generateConfigs()
|
||||
{
|
||||
constexpr GLenum kColorFormats[] = {GL_BGRA8_EXT};
|
||||
return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this);
|
||||
const std::array<GLenum, 1> kColorFormats = {GL_BGRA8_EXT};
|
||||
|
||||
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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче