summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/libGLESv2/Caps.cpp
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2014-09-25 13:22:55 +0300
committerAndrew Knight <andrew.knight@digia.com>2014-09-29 16:09:29 +0200
commit311157c3c6849e8efccd88f7594bb34c570a6780 (patch)
treea50c252b638488326529c0e69aa05e42abce7462 /src/3rdparty/angle/src/libGLESv2/Caps.cpp
parent04d3a89e20d49a3b5015b071bfdedc81973b090c (diff)
ANGLE: Upgrade to 2.1~abce76206141
Upgrade to address issues discovered since the last upgrade. Patch notes: 0000-General-fixes-for-ANGLE-2.1.patch added removal of the unused third-party tracing functions 0003-Fix-compilation-with-MinGW-gcc-64-bit.patch removed as it is no longer needed 0011-ANGLE-Fix-compilation-error-on-MinGW-caused-by-trace.patch removed as it is no longer needed 0016-ANGLE-Fix-compilation-with-MinGW-D3D11.patch now supports MinGW 64-bit [ChangeLog][Third-party libraries] ANGLE updated to 2.1~f8602ad91e4f Task-number: QTBUG-40649 Task-number: QTBUG-40658 Task-number: QTBUG-41031 Task-number: QTBUG-41081 Task-number: QTBUG-41308 Task-number: QTBUG-41563 Change-Id: I9f776c8d5cb94ddb12d608a8d5630bfc54437bea Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/3rdparty/angle/src/libGLESv2/Caps.cpp')
-rw-r--r--src/3rdparty/angle/src/libGLESv2/Caps.cpp94
1 files changed, 78 insertions, 16 deletions
diff --git a/src/3rdparty/angle/src/libGLESv2/Caps.cpp b/src/3rdparty/angle/src/libGLESv2/Caps.cpp
index c1c4dc9ee7..983800c0e6 100644
--- a/src/3rdparty/angle/src/libGLESv2/Caps.cpp
+++ b/src/3rdparty/angle/src/libGLESv2/Caps.cpp
@@ -24,6 +24,30 @@ TextureCaps::TextureCaps()
{
}
+GLuint TextureCaps::getMaxSamples() const
+{
+ return !sampleCounts.empty() ? *sampleCounts.rbegin() : 0;
+}
+
+GLuint TextureCaps::getNearestSamples(GLuint requestedSamples) const
+{
+ if (requestedSamples == 0)
+ {
+ return 0;
+ }
+
+ for (SupportedSampleSet::const_iterator i = sampleCounts.begin(); i != sampleCounts.end(); i++)
+ {
+ GLuint samples = *i;
+ if (samples >= requestedSamples)
+ {
+ return samples;
+ }
+ }
+
+ return 0;
+}
+
void TextureCapsMap::insert(GLenum internalFormat, const TextureCaps &caps)
{
mCapsMap.insert(std::make_pair(internalFormat, caps));
@@ -158,12 +182,17 @@ std::vector<std::string> Extensions::getStrings() const
}
static bool GetFormatSupport(const TextureCapsMap &textureCaps, const std::vector<GLenum> &requiredFormats,
- bool requiresFiltering, bool requiresRendering)
+ bool requiresTexturing, bool requiresFiltering, bool requiresRendering)
{
for (size_t i = 0; i < requiredFormats.size(); i++)
{
const TextureCaps &cap = textureCaps.get(requiredFormats[i]);
+ if (requiresTexturing && !cap.texturable)
+ {
+ return false;
+ }
+
if (requiresFiltering && !cap.filterable)
{
return false;
@@ -185,7 +214,7 @@ static bool DetermineRGB8AndRGBA8TextureSupport(const TextureCapsMap &textureCap
requiredFormats.push_back(GL_RGB8);
requiredFormats.push_back(GL_RGBA8);
- return GetFormatSupport(textureCaps, requiredFormats, true, true);
+ return GetFormatSupport(textureCaps, requiredFormats, true, true, true);
}
// Checks for GL_EXT_texture_format_BGRA8888 support
@@ -194,7 +223,7 @@ static bool DetermineBGRA8TextureSupport(const TextureCapsMap &textureCaps)
std::vector<GLenum> requiredFormats;
requiredFormats.push_back(GL_BGRA8_EXT);
- return GetFormatSupport(textureCaps, requiredFormats, true, true);
+ return GetFormatSupport(textureCaps, requiredFormats, true, true, true);
}
// Checks for GL_OES_texture_half_float support
@@ -204,7 +233,7 @@ static bool DetermineHalfFloatTextureSupport(const TextureCapsMap &textureCaps)
requiredFormats.push_back(GL_RGB16F);
requiredFormats.push_back(GL_RGBA16F);
- return GetFormatSupport(textureCaps, requiredFormats, false, true);
+ return GetFormatSupport(textureCaps, requiredFormats, true, false, true);
}
// Checks for GL_OES_texture_half_float_linear support
@@ -214,7 +243,7 @@ static bool DetermineHalfFloatTextureFilteringSupport(const TextureCapsMap &text
requiredFormats.push_back(GL_RGB16F);
requiredFormats.push_back(GL_RGBA16F);
- return GetFormatSupport(textureCaps, requiredFormats, true, false);
+ return GetFormatSupport(textureCaps, requiredFormats, true, true, false);
}
// Checks for GL_OES_texture_float support
@@ -224,7 +253,7 @@ static bool DetermineFloatTextureSupport(const TextureCapsMap &textureCaps)
requiredFormats.push_back(GL_RGB32F);
requiredFormats.push_back(GL_RGBA32F);
- return GetFormatSupport(textureCaps, requiredFormats, false, true);
+ return GetFormatSupport(textureCaps, requiredFormats, true, false, true);
}
// Checks for GL_OES_texture_float_linear support
@@ -234,7 +263,7 @@ static bool DetermineFloatTextureFilteringSupport(const TextureCapsMap &textureC
requiredFormats.push_back(GL_RGB32F);
requiredFormats.push_back(GL_RGBA32F);
- return GetFormatSupport(textureCaps, requiredFormats, true, false);
+ return GetFormatSupport(textureCaps, requiredFormats, true, true, false);
}
// Checks for GL_EXT_texture_rg support
@@ -254,7 +283,7 @@ static bool DetermineRGTextureSupport(const TextureCapsMap &textureCaps, bool ch
requiredFormats.push_back(GL_RG32F);
}
- return GetFormatSupport(textureCaps, requiredFormats, true, false);
+ return GetFormatSupport(textureCaps, requiredFormats, true, true, false);
}
// Check for GL_EXT_texture_compression_dxt1
@@ -264,7 +293,7 @@ static bool DetermineDXT1TextureSupport(const TextureCapsMap &textureCaps)
requiredFormats.push_back(GL_COMPRESSED_RGB_S3TC_DXT1_EXT);
requiredFormats.push_back(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT);
- return GetFormatSupport(textureCaps, requiredFormats, true, false);
+ return GetFormatSupport(textureCaps, requiredFormats, true, true, false);
}
// Check for GL_ANGLE_texture_compression_dxt3
@@ -273,7 +302,7 @@ static bool DetermineDXT3TextureSupport(const TextureCapsMap &textureCaps)
std::vector<GLenum> requiredFormats;
requiredFormats.push_back(GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE);
- return GetFormatSupport(textureCaps, requiredFormats, true, false);
+ return GetFormatSupport(textureCaps, requiredFormats, true, true, false);
}
// Check for GL_ANGLE_texture_compression_dxt5
@@ -282,7 +311,7 @@ static bool DetermineDXT5TextureSupport(const TextureCapsMap &textureCaps)
std::vector<GLenum> requiredFormats;
requiredFormats.push_back(GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE);
- return GetFormatSupport(textureCaps, requiredFormats, true, false);
+ return GetFormatSupport(textureCaps, requiredFormats, true, true, false);
}
// Check for GL_ANGLE_texture_compression_dxt5
@@ -295,8 +324,8 @@ static bool DetermineSRGBTextureSupport(const TextureCapsMap &textureCaps)
std::vector<GLenum> requiredRenderFormats;
requiredRenderFormats.push_back(GL_SRGB8_ALPHA8);
- return GetFormatSupport(textureCaps, requiredFilterFormats, true, false) &&
- GetFormatSupport(textureCaps, requiredRenderFormats, false, true);
+ return GetFormatSupport(textureCaps, requiredFilterFormats, true, true, false) &&
+ GetFormatSupport(textureCaps, requiredRenderFormats, true, false, true);
}
// Check for GL_ANGLE_depth_texture
@@ -307,7 +336,7 @@ static bool DetermineDepthTextureSupport(const TextureCapsMap &textureCaps)
requiredFormats.push_back(GL_DEPTH_COMPONENT32_OES);
requiredFormats.push_back(GL_DEPTH24_STENCIL8_OES);
- return GetFormatSupport(textureCaps, requiredFormats, true, true);
+ return GetFormatSupport(textureCaps, requiredFormats, true, true, true);
}
// Check for GL_EXT_color_buffer_float
@@ -322,7 +351,7 @@ static bool DetermineColorBufferFloatSupport(const TextureCapsMap &textureCaps)
requiredFormats.push_back(GL_RGBA32F);
requiredFormats.push_back(GL_R11F_G11F_B10F);
- return GetFormatSupport(textureCaps, requiredFormats, false, true);
+ return GetFormatSupport(textureCaps, requiredFormats, true, false, true);
}
void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps)
@@ -356,7 +385,40 @@ Caps::Caps()
maxViewportHeight(0),
minAliasedPointSize(0),
maxAliasedPointSize(0),
- minAliasedLineWidth(0)
+ minAliasedLineWidth(0),
+ // Table 6.29
+ maxElementsIndices(0),
+ maxElementsVertices(0),
+ maxServerWaitTimeout(0),
+ // Table 6.31
+ maxVertexAttributes(0),
+ maxVertexUniformComponents(0),
+ maxVertexUniformVectors(0),
+ maxVertexUniformBlocks(0),
+ maxVertexOutputComponents(0),
+ maxVertexTextureImageUnits(0),
+ // Table 6.32
+ maxFragmentUniformComponents(0),
+ maxFragmentUniformVectors(0),
+ maxFragmentUniformBlocks(0),
+ maxFragmentInputComponents(0),
+ maxTextureImageUnits(0),
+ minProgramTexelOffset(0),
+ maxProgramTexelOffset(0),
+
+ maxUniformBufferBindings(0),
+ maxUniformBlockSize(0),
+ uniformBufferOffsetAlignment(0),
+ maxCombinedUniformBlocks(0),
+ maxCombinedVertexUniformComponents(0),
+ maxCombinedFragmentUniformComponents(0),
+ maxVaryingComponents(0),
+ maxVaryingVectors(0),
+ maxCombinedTextureImageUnits(0),
+
+ maxTransformFeedbackInterleavedComponents(0),
+ maxTransformFeedbackSeparateAttributes(0),
+ maxTransformFeedbackSeparateComponents(0)
{
}