Commit 10b7f46a by Geoff Lang

Determine packed depth stencil extension support automatically.

BUG=angleproject:884 Change-Id: If2b8fd94b0354449ba7e629606d7b1b2c2430fd1 Reviewed-on: https://chromium-review.googlesource.com/272421Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 125dfa4f
...@@ -215,6 +215,15 @@ static bool GetFormatSupport(const TextureCapsMap &textureCaps, const std::vecto ...@@ -215,6 +215,15 @@ static bool GetFormatSupport(const TextureCapsMap &textureCaps, const std::vecto
return true; return true;
} }
// Check for GL_OES_packed_depth_stencil
static bool DeterminePackedDepthStencilSupport(const TextureCapsMap &textureCaps)
{
std::vector<GLenum> requiredFormats;
requiredFormats.push_back(GL_DEPTH24_STENCIL8);
return GetFormatSupport(textureCaps, requiredFormats, false, false, true);
}
// Checks for GL_OES_rgb8_rgba8 support // Checks for GL_OES_rgb8_rgba8 support
static bool DetermineRGB8AndRGBA8TextureSupport(const TextureCapsMap &textureCaps) static bool DetermineRGB8AndRGBA8TextureSupport(const TextureCapsMap &textureCaps)
{ {
...@@ -364,6 +373,7 @@ static bool DetermineColorBufferFloatSupport(const TextureCapsMap &textureCaps) ...@@ -364,6 +373,7 @@ static bool DetermineColorBufferFloatSupport(const TextureCapsMap &textureCaps)
void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps) void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps)
{ {
packedDepthStencil = DeterminePackedDepthStencilSupport(textureCaps);
rgb8rgba8 = DetermineRGB8AndRGBA8TextureSupport(textureCaps); rgb8rgba8 = DetermineRGB8AndRGBA8TextureSupport(textureCaps);
textureFormatBGRA8888 = DetermineBGRA8TextureSupport(textureCaps); textureFormatBGRA8888 = DetermineBGRA8TextureSupport(textureCaps);
textureHalfFloat = DetermineHalfFloatTextureSupport(textureCaps); textureHalfFloat = DetermineHalfFloatTextureSupport(textureCaps);
......
...@@ -73,6 +73,7 @@ struct Extensions ...@@ -73,6 +73,7 @@ struct Extensions
// Set all texture related extension support based on the supported textures. // Set all texture related extension support based on the supported textures.
// Determines support for: // Determines support for:
// GL_OES_packed_depth_stencil
// GL_OES_rgb8_rgba8 // GL_OES_rgb8_rgba8
// GL_EXT_texture_format_BGRA8888 // GL_EXT_texture_format_BGRA8888
// GL_OES_texture_half_float, GL_OES_texture_half_float_linear // GL_OES_texture_half_float, GL_OES_texture_half_float_linear
......
...@@ -1078,7 +1078,6 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons ...@@ -1078,7 +1078,6 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
// GL extension support // GL extension support
extensions->setTextureExtensionSupport(*textureCapsMap); extensions->setTextureExtensionSupport(*textureCapsMap);
extensions->elementIndexUint = true; extensions->elementIndexUint = true;
extensions->packedDepthStencil = true;
extensions->getProgramBinary = true; extensions->getProgramBinary = true;
extensions->rgb8rgba8 = true; extensions->rgb8rgba8 = true;
extensions->readFormatBGRA = true; extensions->readFormatBGRA = true;
......
...@@ -478,7 +478,6 @@ void GenerateCaps(IDirect3D9 *d3d9, IDirect3DDevice9 *device, D3DDEVTYPE deviceT ...@@ -478,7 +478,6 @@ void GenerateCaps(IDirect3D9 *d3d9, IDirect3DDevice9 *device, D3DDEVTYPE deviceT
// GL extension support // GL extension support
extensions->setTextureExtensionSupport(*textureCapsMap); extensions->setTextureExtensionSupport(*textureCapsMap);
extensions->elementIndexUint = deviceCaps.MaxVertexIndex >= (1 << 16); extensions->elementIndexUint = deviceCaps.MaxVertexIndex >= (1 << 16);
extensions->packedDepthStencil = true;
extensions->getProgramBinary = true; extensions->getProgramBinary = true;
extensions->rgb8rgba8 = true; extensions->rgb8rgba8 = true;
extensions->readFormatBGRA = true; extensions->readFormatBGRA = true;
......
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