summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/libANGLE/Caps.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/angle/src/libANGLE/Caps.h')
-rw-r--r--src/3rdparty/angle/src/libANGLE/Caps.h291
1 files changed, 254 insertions, 37 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/Caps.h b/src/3rdparty/angle/src/libANGLE/Caps.h
index d0e839a2ba..64bdf97112 100644
--- a/src/3rdparty/angle/src/libANGLE/Caps.h
+++ b/src/3rdparty/angle/src/libANGLE/Caps.h
@@ -8,21 +8,28 @@
#define LIBANGLE_CAPS_H_
#include "angle_gl.h"
+#include "libANGLE/Version.h"
#include "libANGLE/angletypes.h"
+#include "libANGLE/renderer/Format.h"
#include <map>
#include <set>
#include <string>
#include <vector>
+#include <array>
namespace gl
{
+struct Extensions;
+
typedef std::set<GLuint> SupportedSampleSet;
struct TextureCaps
{
TextureCaps();
+ TextureCaps(const TextureCaps &other);
+ ~TextureCaps();
// Supports for basic texturing: glTexImage, glTexSubImage, etc
bool texturable;
@@ -44,26 +51,37 @@ struct TextureCaps
GLuint getNearestSamples(GLuint requestedSamples) const;
};
-class TextureCapsMap
+TextureCaps GenerateMinimumTextureCaps(GLenum internalFormat,
+ const Version &clientVersion,
+ const Extensions &extensions);
+
+class TextureCapsMap final : angle::NonCopyable
{
public:
- typedef std::map<GLenum, TextureCaps>::const_iterator const_iterator;
+ TextureCapsMap();
+ ~TextureCapsMap();
+ // These methods are deprecated. Please use angle::Format for new features.
void insert(GLenum internalFormat, const TextureCaps &caps);
- void remove(GLenum internalFormat);
-
const TextureCaps &get(GLenum internalFormat) const;
- const_iterator begin() const;
- const_iterator end() const;
+ void clear();
- size_t size() const;
+ // Prefer using angle::Format methods.
+ const TextureCaps &get(angle::Format::ID formatID) const;
+ void set(angle::Format::ID formatID, const TextureCaps &caps);
private:
- typedef std::map<GLenum, TextureCaps> InternalFormatToCapsMap;
- InternalFormatToCapsMap mCapsMap;
+ TextureCaps &get(angle::Format::ID formatID);
+
+ // Indexed by angle::Format::ID
+ std::array<TextureCaps, angle::kNumANGLEFormats> mFormatData;
};
+void InitMinimumTextureCapsMap(const Version &clientVersion,
+ const Extensions &extensions,
+ TextureCapsMap *capsMap);
+
struct Extensions
{
Extensions();
@@ -87,6 +105,7 @@ struct Extensions
// GL_EXT_sRGB
// GL_ANGLE_depth_texture, GL_OES_depth32
// GL_EXT_color_buffer_float
+ // GL_EXT_texture_norm16
void setTextureExtensionSupport(const TextureCapsMap &textureCaps);
// ES2 Extension support
@@ -141,12 +160,18 @@ struct Extensions
bool textureRG;
// GL_EXT_texture_compression_dxt1, GL_ANGLE_texture_compression_dxt3 and GL_ANGLE_texture_compression_dxt5
- // Implies that TextureCaps for GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
+ // Implies that TextureCaps exist for GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
// GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE and GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE
bool textureCompressionDXT1;
bool textureCompressionDXT3;
bool textureCompressionDXT5;
+ // GL_EXT_texture_compression_s3tc_srgb
+ // Implies that TextureCaps exist for GL_COMPRESSED_SRGB_S3TC_DXT1_EXT,
+ // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, and
+ // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
+ bool textureCompressionS3TCsRGB;
+
// GL_KHR_texture_compression_astc_hdr
bool textureCompressionASTCHDR;
@@ -188,9 +213,6 @@ struct Extensions
// GL_NV_fence
bool fence;
- // GL_ANGLE_timer_query
- bool timerQuery;
-
// GL_EXT_disjoint_timer_query
bool disjointTimerQuery;
GLuint queryCounterBitsTimeElapsed;
@@ -199,6 +221,9 @@ struct Extensions
// GL_EXT_robustness
bool robustness;
+ // GL_KHR_robust_buffer_access_behavior
+ bool robustBufferAccessBehavior;
+
// GL_EXT_blend_minmax
bool blendMinMax;
@@ -220,18 +245,13 @@ struct Extensions
// GL_EXT_shader_texture_lod
bool shaderTextureLOD;
- // GL_EXT_shader_framebuffer_fetch
- bool shaderFramebufferFetch;
-
- // GL_ARM_shader_framebuffer_fetch
- bool ARMshaderFramebufferFetch;
-
- // GL_NV_shader_framebuffer_fetch
- bool NVshaderFramebufferFetch;
-
// GL_EXT_frag_depth
bool fragDepth;
+ // ANGLE_multiview
+ bool multiview;
+ GLuint maxViews;
+
// GL_ANGLE_texture_usage
bool textureUsage;
@@ -256,6 +276,9 @@ struct Extensions
// GL_OES_EGL_image_external_essl3
bool eglImageExternalEssl3;
+ // NV_EGL_stream_consumer_external
+ bool eglStreamConsumerExternal;
+
// EXT_unpack_subimage
bool unpackSubimage;
@@ -278,12 +301,98 @@ struct Extensions
// GL_ANGLE_lossy_etc_decode
bool lossyETCDecode;
+ // GL_CHROMIUM_bind_uniform_location
+ bool bindUniformLocation;
+
+ // GL_CHROMIUM_sync_query
+ bool syncQuery;
+
+ // GL_CHROMIUM_copy_texture
+ bool copyTexture;
+
+ // GL_CHROMIUM_copy_compressed_texture
+ bool copyCompressedTexture;
+
+ // GL_ANGLE_webgl_compatibility
+ bool webglCompatibility;
+
+ // GL_ANGLE_request_extension
+ bool requestExtension;
+
+ // GL_CHROMIUM_bind_generates_resource
+ bool bindGeneratesResource;
+
+ // GL_ANGLE_robust_client_memory
+ bool robustClientMemory;
+
+ // GL_EXT_texture_sRGB_decode
+ bool textureSRGBDecode;
+
+ // GL_EXT_sRGB_write_control
+ bool sRGBWriteControl;
+
+ // GL_CHROMIUM_color_buffer_float_rgb
+ bool colorBufferFloatRGB;
+
+ // GL_CHROMIUM_color_buffer_float_rgba
+ bool colorBufferFloatRGBA;
+
// ES3 Extension support
// GL_EXT_color_buffer_float
bool colorBufferFloat;
+
+ // GL_EXT_multisample_compatibility.
+ // written against ES 3.1 but can apply to earlier versions.
+ bool multisampleCompatibility;
+
+ // GL_CHROMIUM_framebuffer_mixed_samples
+ bool framebufferMixedSamples;
+
+ // GL_EXT_texture_norm16
+ // written against ES 3.1 but can apply to ES 3.0 as well.
+ bool textureNorm16;
+
+ // GL_CHROMIUM_path_rendering
+ bool pathRendering;
+
+ // GL_OES_surfaceless_context
+ bool surfacelessContext;
+
+ // GL_ANGLE_client_arrays
+ bool clientArrays;
+
+ // GL_ANGLE_robust_resource_initialization
+ bool robustResourceInitialization;
+
+ // GL_ANGLE_program_cache_control
+ bool programCacheControl;
+
+ // GL_ANGLE_texture_rectangle
+ bool textureRectangle;
+
+ // GL_EXT_geometry_shader
+ bool geometryShader;
+ // GL_EXT_geometry_shader (May 31, 2016) Table 20.43gs: Implementation dependent geometry shader
+ // limits
+ // TODO(jiawei.shao@intel.com): add all implementation dependent geometry shader limits.
+ GLuint maxGeometryOutputVertices;
+ GLuint maxGeometryShaderInvocations;
};
+struct ExtensionInfo
+{
+ // If this extension can be enabled with glRequestExtension (GL_ANGLE_request_extension)
+ bool Requestable = false;
+
+ // Pointer to a boolean member of the Extensions struct
+ typedef bool(Extensions::*ExtensionBool);
+ ExtensionBool ExtensionsMember = nullptr;
+};
+
+using ExtensionInfoMap = std::map<std::string, ExtensionInfo>;
+const ExtensionInfoMap &GetExtensionInfoMap();
+
struct Limitations
{
Limitations();
@@ -311,39 +420,57 @@ struct Limitations
struct TypePrecision
{
TypePrecision();
+ TypePrecision(const TypePrecision &other);
void setIEEEFloat();
void setTwosComplementInt(unsigned int bits);
+ void setSimulatedFloat(unsigned int range, unsigned int precision);
void setSimulatedInt(unsigned int range);
void get(GLint *returnRange, GLint *returnPrecision) const;
- GLint range[2];
+ std::array<GLint, 2> range;
GLint precision;
};
struct Caps
{
Caps();
+ Caps(const Caps &other);
+ ~Caps();
- // Table 6.28, implementation dependent values
+ // ES 3.1 (April 29, 2015) 20.39: implementation dependent values
GLuint64 maxElementIndex;
GLuint max3DTextureSize;
GLuint max2DTextureSize;
+ GLuint maxRectangleTextureSize;
GLuint maxArrayTextureLayers;
GLfloat maxLODBias;
GLuint maxCubeMapTextureSize;
GLuint maxRenderbufferSize;
- GLuint maxDrawBuffers;
- GLuint maxColorAttachments;
- GLuint maxViewportWidth;
- GLuint maxViewportHeight;
GLfloat minAliasedPointSize;
GLfloat maxAliasedPointSize;
GLfloat minAliasedLineWidth;
GLfloat maxAliasedLineWidth;
- // Table 6.29, implementation dependent values (cont.)
+ // ES 3.1 (April 29, 2015) 20.40: implementation dependent values (cont.)
+ GLuint maxDrawBuffers;
+ GLuint maxFramebufferWidth;
+ GLuint maxFramebufferHeight;
+ GLuint maxFramebufferSamples;
+ GLuint maxColorAttachments;
+ GLuint maxViewportWidth;
+ GLuint maxViewportHeight;
+ GLuint maxSampleMaskWords;
+ GLuint maxColorTextureSamples;
+ GLuint maxDepthTextureSamples;
+ GLuint maxIntegerSamples;
+ GLuint64 maxServerWaitTimeout;
+
+ // ES 3.1 (April 29, 2015) Table 20.41: Implementation dependent values (cont.)
+ GLint maxVertexAttribRelativeOffset;
+ GLuint maxVertexAttribBindings;
+ GLint maxVertexAttribStride;
GLuint maxElementsIndices;
GLuint maxElementsVertices;
std::vector<GLenum> compressedTextureFormats;
@@ -361,26 +488,49 @@ struct Caps
TypePrecision fragmentHighpInt;
TypePrecision fragmentMediumpInt;
TypePrecision fragmentLowpInt;
- GLuint64 maxServerWaitTimeout;
- // Table 6.31, implementation dependent vertex shader limits
+ // ES 3.1 (April 29, 2015) Table 20.43: Implementation dependent Vertex shader limits
GLuint maxVertexAttributes;
GLuint maxVertexUniformComponents;
GLuint maxVertexUniformVectors;
GLuint maxVertexUniformBlocks;
GLuint maxVertexOutputComponents;
GLuint maxVertexTextureImageUnits;
+ GLuint maxVertexAtomicCounterBuffers;
+ GLuint maxVertexAtomicCounters;
+ GLuint maxVertexImageUniforms;
+ GLuint maxVertexShaderStorageBlocks;
- // Table 6.32, implementation dependent fragment shader limits
+ // ES 3.1 (April 29, 2015) Table 20.44: Implementation dependent Fragment shader limits
GLuint maxFragmentUniformComponents;
GLuint maxFragmentUniformVectors;
GLuint maxFragmentUniformBlocks;
GLuint maxFragmentInputComponents;
GLuint maxTextureImageUnits;
+ GLuint maxFragmentAtomicCounterBuffers;
+ GLuint maxFragmentAtomicCounters;
+ GLuint maxFragmentImageUniforms;
+ GLuint maxFragmentShaderStorageBlocks;
+ GLint minProgramTextureGatherOffset;
+ GLuint maxProgramTextureGatherOffset;
GLint minProgramTexelOffset;
GLint maxProgramTexelOffset;
- // Table 6.33, implementation dependent aggregate shader limits
+ // ES 3.1 (April 29, 2015) Table 20.45: implementation dependent compute shader limits
+ std::array<GLuint, 3> maxComputeWorkGroupCount;
+ std::array<GLuint, 3> maxComputeWorkGroupSize;
+ GLuint maxComputeWorkGroupInvocations;
+ GLuint maxComputeUniformBlocks;
+ GLuint maxComputeTextureImageUnits;
+ GLuint maxComputeSharedMemorySize;
+ GLuint maxComputeUniformComponents;
+ GLuint maxComputeAtomicCounterBuffers;
+ GLuint maxComputeAtomicCounters;
+ GLuint maxComputeImageUniforms;
+ GLuint maxCombinedComputeUniformComponents;
+ GLuint maxComputeShaderStorageBlocks;
+
+ // ES 3.1 (April 29, 2015) Table 20.46: implementation dependent aggregate shader limits
GLuint maxUniformBufferBindings;
GLuint64 maxUniformBlockSize;
GLuint uniformBufferOffsetAlignment;
@@ -390,16 +540,31 @@ struct Caps
GLuint maxVaryingComponents;
GLuint maxVaryingVectors;
GLuint maxCombinedTextureImageUnits;
-
- // Table 6.34, implementation dependent transform feedback limits
+ GLuint maxCombinedShaderOutputResources;
+
+ // ES 3.1 (April 29, 2015) Table 20.47: implementation dependent aggregate shader limits (cont.)
+ GLuint maxUniformLocations;
+ GLuint maxAtomicCounterBufferBindings;
+ GLuint maxAtomicCounterBufferSize;
+ GLuint maxCombinedAtomicCounterBuffers;
+ GLuint maxCombinedAtomicCounters;
+ GLuint maxImageUnits;
+ GLuint maxCombinedImageUniforms;
+ GLuint maxShaderStorageBufferBindings;
+ GLuint64 maxShaderStorageBlockSize;
+ GLuint maxCombinedShaderStorageBlocks;
+ GLuint shaderStorageBufferOffsetAlignment;
+
+ // ES 3.1 (April 29, 2015) Table 20.48: implementation dependent transform feedback limits
GLuint maxTransformFeedbackInterleavedComponents;
GLuint maxTransformFeedbackSeparateAttributes;
GLuint maxTransformFeedbackSeparateComponents;
- // Table 6.35, Framebuffer Dependent Values
+ // ES 3.1 (April 29, 2015) Table 20.49: Framebuffer Dependent Values
GLuint maxSamples;
};
+Caps GenerateMinimumCaps(const Version &clientVersion, const Extensions &extensions);
}
namespace egl
@@ -426,6 +591,9 @@ struct DisplayExtensions
// EGL_ANGLE_d3d_share_handle_client_buffer
bool d3dShareHandleClientBuffer;
+ // EGL_ANGLE_d3d_texture_client_buffer
+ bool d3dTextureClientBuffer;
+
// EGL_ANGLE_surface_d3d_texture_2d_share_handle
bool surfaceD3DTexture2DShareHandle;
@@ -482,6 +650,48 @@ struct DisplayExtensions
// KHR_create_context_no_error
bool createContextNoError;
+
+ // EGL_KHR_stream
+ bool stream;
+
+ // EGL_KHR_stream_consumer_gltexture
+ bool streamConsumerGLTexture;
+
+ // EGL_NV_stream_consumer_gltexture_yuv
+ bool streamConsumerGLTextureYUV;
+
+ // EGL_ANGLE_stream_producer_d3d_texture_nv12
+ bool streamProducerD3DTextureNV12;
+
+ // EGL_ANGLE_create_context_webgl_compatibility
+ bool createContextWebGLCompatibility;
+
+ // EGL_CHROMIUM_create_context_bind_generates_resource
+ bool createContextBindGeneratesResource;
+
+ // EGL_CHROMIUM_get_sync_values
+ bool getSyncValues;
+
+ // EGL_EXT_swap_buffers_with_damage
+ bool swapBuffersWithDamage;
+
+ // EGL_EXT_pixel_format_float
+ bool pixelFormatFloat;
+
+ // EGL_KHR_surfaceless_context
+ bool surfacelessContext;
+
+ // EGL_ANGLE_display_texture_share_group
+ bool displayTextureShareGroup;
+
+ // EGL_ANGLE_create_context_client_arrays
+ bool createContextClientArrays;
+
+ // EGL_ANGLE_program_cache_control
+ bool programCacheControl;
+
+ // EGL_ANGLE_robust_resource_initialization
+ bool robustResourceInitialization;
};
struct DeviceExtensions
@@ -498,6 +708,7 @@ struct DeviceExtensions
struct ClientExtensions
{
ClientExtensions();
+ ClientExtensions(const ClientExtensions &other);
// Generate a vector of supported extension strings
std::vector<std::string> getStrings() const;
@@ -520,6 +731,12 @@ struct ClientExtensions
// EGL_ANGLE_platform_angle_opengl
bool platformANGLEOpenGL;
+ // EGL_ANGLE_platform_angle_null
+ bool platformANGLENULL;
+
+ // EGL_ANGLE_platform_angle_vulkan
+ bool platformANGLEVulkan;
+
// EGL_ANGLE_device_creation
bool deviceCreation;
@@ -536,6 +753,6 @@ struct ClientExtensions
bool clientGetAllProcAddresses;
};
-}
+} // namespace egl
#endif // LIBANGLE_CAPS_H_