• Home
  • Raw
  • Download

Lines Matching full:functions

7 // renderergl_utils.cpp: Conversion functions and other utility routines
46 const char *GetString(const FunctionsGL *functions, GLenum name) in GetString() argument
48 const char *cStr = reinterpret_cast<const char *>(functions->getString(name)); in GetString()
56 bool IsMesa(const FunctionsGL *functions, std::array<int, 3> *version) in IsMesa() argument
60 std::string nativeVersionString(GetString(functions, GL_VERSION)); in IsMesa()
74 int getAdrenoNumber(const FunctionsGL *functions) in getAdrenoNumber() argument
79 const char *nativeGLRenderer = GetString(functions, GL_RENDERER); in getAdrenoNumber()
89 int GetQualcommVersion(const FunctionsGL *functions) in GetQualcommVersion() argument
94 const std::string nativeVersionString(GetString(functions, GL_VERSION)); in GetQualcommVersion()
105 int getMaliTNumber(const FunctionsGL *functions) in getMaliTNumber() argument
110 const char *nativeGLRenderer = GetString(functions, GL_RENDERER); in getMaliTNumber()
119 int getMaliGNumber(const FunctionsGL *functions) in getMaliGNumber() argument
124 const char *nativeGLRenderer = GetString(functions, GL_RENDERER); in getMaliGNumber()
133 bool IsAdreno42xOr3xx(const FunctionsGL *functions) in IsAdreno42xOr3xx() argument
135 int number = getAdrenoNumber(functions); in IsAdreno42xOr3xx()
136 return number != 0 && getAdrenoNumber(functions) < 430; in IsAdreno42xOr3xx()
139 bool IsAdreno4xx(const FunctionsGL *functions) in IsAdreno4xx() argument
141 int number = getAdrenoNumber(functions); in IsAdreno4xx()
145 bool IsAdreno5xxOrOlder(const FunctionsGL *functions) in IsAdreno5xxOrOlder() argument
147 int number = getAdrenoNumber(functions); in IsAdreno5xxOrOlder()
151 bool IsAdreno5xx(const FunctionsGL *functions) in IsAdreno5xx() argument
153 int number = getAdrenoNumber(functions); in IsAdreno5xx()
157 bool IsMaliT8xxOrOlder(const FunctionsGL *functions) in IsMaliT8xxOrOlder() argument
159 int number = getMaliTNumber(functions); in IsMaliT8xxOrOlder()
163 bool IsMaliG31OrOlder(const FunctionsGL *functions) in IsMaliG31OrOlder() argument
165 int number = getMaliGNumber(functions); in IsMaliG31OrOlder()
169 bool IsMaliG72OrG76OrG51(const FunctionsGL *functions) in IsMaliG72OrG76OrG51() argument
171 int number = getMaliGNumber(functions); in IsMaliG72OrG76OrG51()
175 bool IsMaliValhall(const FunctionsGL *functions) in IsMaliValhall() argument
177 int number = getMaliGNumber(functions); in IsMaliValhall()
182 bool IsPixel7OrPixel8(const FunctionsGL *functions) in IsPixel7OrPixel8() argument
184 int number = getMaliGNumber(functions); in IsPixel7OrPixel8()
188 [[maybe_unused]] bool IsAndroidEmulator(const FunctionsGL *functions) in IsAndroidEmulator() argument
191 const char *nativeGLRenderer = GetString(functions, GL_RENDERER); in IsAndroidEmulator()
195 bool IsPowerVrRogue(const FunctionsGL *functions) in IsPowerVrRogue() argument
198 const char *nativeGLRenderer = GetString(functions, GL_RENDERER); in IsPowerVrRogue()
202 void ClearErrors(const FunctionsGL *functions, in ClearErrors() argument
207 GLenum error = functions->getError(); in ClearErrors()
212 error = functions->getError(); in ClearErrors()
216 #define ANGLE_GL_CLEAR_ERRORS() ClearErrors(functions, __FILE__, __FUNCTION__, __LINE__)
224 VendorID GetVendorID(const FunctionsGL *functions) in GetVendorID() argument
226 std::string nativeVendorString(GetString(functions, GL_VENDOR)); in GetVendorID()
230 nativeVendorString += GetString(functions, GL_RENDERER); in GetVendorID()
268 uint32_t GetDeviceID(const FunctionsGL *functions) in GetDeviceID() argument
270 std::string nativeRendererString(GetString(functions, GL_RENDERER)); in GetDeviceID()
288 ShShaderOutput GetShaderOutputType(const FunctionsGL *functions) in GetShaderOutputType() argument
290 ASSERT(functions); in GetShaderOutputType()
292 if (functions->standard == STANDARD_GL_DESKTOP) in GetShaderOutputType()
295 if (functions->isAtLeastGL(gl::Version(4, 5))) in GetShaderOutputType()
299 else if (functions->isAtLeastGL(gl::Version(4, 4))) in GetShaderOutputType()
303 else if (functions->isAtLeastGL(gl::Version(4, 3))) in GetShaderOutputType()
307 else if (functions->isAtLeastGL(gl::Version(4, 2))) in GetShaderOutputType()
311 else if (functions->isAtLeastGL(gl::Version(4, 1))) in GetShaderOutputType()
315 else if (functions->isAtLeastGL(gl::Version(4, 0))) in GetShaderOutputType()
319 else if (functions->isAtLeastGL(gl::Version(3, 3))) in GetShaderOutputType()
323 else if (functions->isAtLeastGL(gl::Version(3, 2))) in GetShaderOutputType()
327 else if (functions->isAtLeastGL(gl::Version(3, 1))) in GetShaderOutputType()
331 else if (functions->isAtLeastGL(gl::Version(3, 0))) in GetShaderOutputType()
340 else if (functions->standard == STANDARD_GL_ES) in GetShaderOutputType()
355 static bool MeetsRequirements(const FunctionsGL *functions, in MeetsRequirements() argument
364 if (!functions->hasExtension(extension)) in MeetsRequirements()
381 if (functions->version >= requirements.version) in MeetsRequirements()
389 if (!functions->hasExtension(extension)) in MeetsRequirements()
402 static bool CheckSizedInternalFormatTextureRenderability(const FunctionsGL *functions, in CheckSizedInternalFormatTextureRenderability() argument
411 functions->getIntegerv(GL_TEXTURE_BINDING_2D, &oldTextureBinding); in CheckSizedInternalFormatTextureRenderability()
415 functions->genTextures(1, &texture); in CheckSizedInternalFormatTextureRenderability()
416 functions->bindTexture(GL_TEXTURE_2D, texture); in CheckSizedInternalFormatTextureRenderability()
419 functions->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in CheckSizedInternalFormatTextureRenderability()
422 functions, features, formatInfo.internalFormat, formatInfo.format, formatInfo.type); in CheckSizedInternalFormatTextureRenderability()
424 functions->texImage2D(GL_TEXTURE_2D, 0, texImageFormat.internalFormat, kTextureSize, in CheckSizedInternalFormatTextureRenderability()
429 functions->getIntegerv(GL_FRAMEBUFFER_BINDING, &oldFramebufferBinding); in CheckSizedInternalFormatTextureRenderability()
433 functions->genFramebuffers(1, &fbo); in CheckSizedInternalFormatTextureRenderability()
434 functions->bindFramebuffer(GL_FRAMEBUFFER, fbo); in CheckSizedInternalFormatTextureRenderability()
435 functions->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, in CheckSizedInternalFormatTextureRenderability()
438 bool supported = functions->checkFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE; in CheckSizedInternalFormatTextureRenderability()
441 functions->deleteFramebuffers(1, &fbo); in CheckSizedInternalFormatTextureRenderability()
442 functions->bindFramebuffer(GL_FRAMEBUFFER, static_cast<GLuint>(oldFramebufferBinding)); in CheckSizedInternalFormatTextureRenderability()
445 functions->deleteTextures(1, &texture); in CheckSizedInternalFormatTextureRenderability()
446 functions->bindTexture(GL_TEXTURE_2D, static_cast<GLuint>(oldTextureBinding)); in CheckSizedInternalFormatTextureRenderability()
453 ASSERT(functions->getError() == GL_NO_ERROR); in CheckSizedInternalFormatTextureRenderability()
457 static bool CheckInternalFormatRenderbufferRenderability(const FunctionsGL *functions, in CheckInternalFormatRenderbufferRenderability() argument
466 functions->getIntegerv(GL_RENDERBUFFER_BINDING, &oldRenderbufferBinding); in CheckInternalFormatRenderbufferRenderability()
470 functions->genRenderbuffers(1, &renderbuffer); in CheckInternalFormatRenderbufferRenderability()
471 functions->bindRenderbuffer(GL_RENDERBUFFER, renderbuffer); in CheckInternalFormatRenderbufferRenderability()
474 nativegl::GetRenderbufferFormat(functions, features, formatInfo.internalFormat); in CheckInternalFormatRenderbufferRenderability()
476 functions->renderbufferStorage(GL_RENDERBUFFER, renderbufferFormat.internalFormat, in CheckInternalFormatRenderbufferRenderability()
481 functions->getIntegerv(GL_FRAMEBUFFER_BINDING, &oldFramebufferBinding); in CheckInternalFormatRenderbufferRenderability()
485 functions->genFramebuffers(1, &fbo); in CheckInternalFormatRenderbufferRenderability()
486 functions->bindFramebuffer(GL_FRAMEBUFFER, fbo); in CheckInternalFormatRenderbufferRenderability()
487 functions->framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, in CheckInternalFormatRenderbufferRenderability()
490 bool supported = functions->checkFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE; in CheckInternalFormatRenderbufferRenderability()
493 functions->deleteFramebuffers(1, &fbo); in CheckInternalFormatRenderbufferRenderability()
494 functions->bindFramebuffer(GL_FRAMEBUFFER, static_cast<GLuint>(oldFramebufferBinding)); in CheckInternalFormatRenderbufferRenderability()
497 functions->deleteRenderbuffers(1, &renderbuffer); in CheckInternalFormatRenderbufferRenderability()
498 functions->bindRenderbuffer(GL_RENDERBUFFER, static_cast<GLuint>(oldRenderbufferBinding)); in CheckInternalFormatRenderbufferRenderability()
505 ASSERT(functions->getError() == GL_NO_ERROR); in CheckInternalFormatRenderbufferRenderability()
517 static gl::TextureCaps GenerateTextureFormatCaps(const FunctionsGL *functions, in GenerateTextureFormatCaps() argument
522 ASSERT(functions->getError() == GL_NO_ERROR); in GenerateTextureFormatCaps()
527 nativegl::GetInternalFormatInfo(internalFormat, functions->standard); in GenerateTextureFormatCaps()
528 textureCaps.texturable = MeetsRequirements(functions, formatInfo.texture); in GenerateTextureFormatCaps()
530 textureCaps.texturable && MeetsRequirements(functions, formatInfo.filter); in GenerateTextureFormatCaps()
531 textureCaps.textureAttachment = MeetsRequirements(functions, formatInfo.textureAttachment); in GenerateTextureFormatCaps()
532 textureCaps.renderbuffer = MeetsRequirements(functions, formatInfo.renderbuffer); in GenerateTextureFormatCaps()
540 if (functions->isAtLeastGLES(gl::Version(3, 0)) && in GenerateTextureFormatCaps()
541 functions->hasGLESExtension("GL_EXT_color_buffer_half_float")) in GenerateTextureFormatCaps()
552 (functions->standard == STANDARD_GL_DESKTOP && in GenerateTextureFormatCaps()
560 CheckSizedInternalFormatTextureRenderability(functions, features, internalFormat); in GenerateTextureFormatCaps()
565 CheckInternalFormatRenderbufferRenderability(functions, features, internalFormat); in GenerateTextureFormatCaps()
571 if (textureCaps.renderbuffer && functions->getInternalformativ) in GenerateTextureFormatCaps()
586 functions->getInternalformativ(GL_RENDERBUFFER, queryInternalFormat, GL_NUM_SAMPLE_COUNTS, in GenerateTextureFormatCaps()
588 GLenum error = functions->getError(); in GenerateTextureFormatCaps()
599 functions->getInternalformativ(GL_RENDERBUFFER, queryInternalFormat, GL_SAMPLES, in GenerateTextureFormatCaps()
614 if (functions->getInternalformatSampleivNV) in GenerateTextureFormatCaps()
616 ASSERT(functions->getError() == GL_NO_ERROR); in GenerateTextureFormatCaps()
617 functions->getInternalformatSampleivNV(GL_RENDERBUFFER, queryInternalFormat, in GenerateTextureFormatCaps()
623 if (functions->getError() != GL_NO_ERROR) in GenerateTextureFormatCaps()
647 ASSERT(functions->getError() == GL_NO_ERROR); in GenerateTextureFormatCaps()
651 static GLint QuerySingleGLInt(const FunctionsGL *functions, GLenum name) in QuerySingleGLInt() argument
654 functions->getIntegerv(name, &result); in QuerySingleGLInt()
658 static GLint QuerySingleIndexGLInt(const FunctionsGL *functions, GLenum name, GLuint index) in QuerySingleIndexGLInt() argument
661 functions->getIntegeri_v(name, index, &result); in QuerySingleIndexGLInt()
665 static GLint QueryGLIntRange(const FunctionsGL *functions, GLenum name, size_t index) in QueryGLIntRange() argument
668 functions->getIntegerv(name, result); in QueryGLIntRange()
672 static GLint64 QuerySingleGLInt64(const FunctionsGL *functions, GLenum name) in QuerySingleGLInt64() argument
677 if (!functions->getInteger64v) in QuerySingleGLInt64()
680 functions->getIntegerv(name, &result); in QuerySingleGLInt64()
686 functions->getInteger64v(name, &result); in QuerySingleGLInt64()
691 static GLfloat QuerySingleGLFloat(const FunctionsGL *functions, GLenum name) in QuerySingleGLFloat() argument
694 functions->getFloatv(name, &result); in QuerySingleGLFloat()
698 static GLfloat QueryGLFloatRange(const FunctionsGL *functions, GLenum name, size_t index) in QueryGLFloatRange() argument
701 functions->getFloatv(name, result); in QueryGLFloatRange()
705 static gl::TypePrecision QueryTypePrecision(const FunctionsGL *functions, in QueryTypePrecision() argument
710 functions->getShaderPrecisionFormat(shaderType, precisionType, precision.range.data(), in QueryTypePrecision()
715 static GLint QueryQueryValue(const FunctionsGL *functions, GLenum target, GLenum name) in QueryQueryValue() argument
718 functions->getQueryiv(target, name, &result); in QueryQueryValue()
733 void GenerateCaps(const FunctionsGL *functions, in GenerateCaps() argument
751 GenerateTextureFormatCaps(functions, features, internalFormat, maxSupportedESVersion); in GenerateCaps()
756 if (functions->isAtLeastGL(gl::Version(4, 3)) || in GenerateCaps()
757 functions->hasGLExtension("GL_ARB_ES3_compatibility") || in GenerateCaps()
758 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
760 caps->maxElementIndex = QuerySingleGLInt64(functions, GL_MAX_ELEMENT_INDEX); in GenerateCaps()
789 if (functions->isAtLeastGL(gl::Version(1, 2)) || functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
790 functions->hasGLESExtension("GL_OES_texture_3D")) in GenerateCaps()
793 {QuerySingleGLInt(functions, GL_MAX_3D_TEXTURE_SIZE), max3dArrayTextureSizeLimit}); in GenerateCaps()
801 caps->max2DTextureSize = QuerySingleGLInt(functions, GL_MAX_TEXTURE_SIZE); // GL 1.0 / ES 2.0 in GenerateCaps()
803 QuerySingleGLInt(functions, GL_MAX_CUBE_MAP_TEXTURE_SIZE); // GL 1.3 / ES 2.0 in GenerateCaps()
805 if (functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
806 functions->hasGLExtension("GL_EXT_texture_array") || in GenerateCaps()
807 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
810 {QuerySingleGLInt(functions, GL_MAX_ARRAY_TEXTURE_LAYERS), max3dArrayTextureSizeLimit}); in GenerateCaps()
818 if (functions->isAtLeastGL(gl::Version(1, 5)) || in GenerateCaps()
819 functions->hasGLExtension("GL_EXT_texture_lod_bias") || in GenerateCaps()
820 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
822 caps->maxLODBias = QuerySingleGLFloat(functions, GL_MAX_TEXTURE_LOD_BIAS); in GenerateCaps()
829 if (functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
830 functions->hasGLExtension("GL_EXT_framebuffer_object") || in GenerateCaps()
831 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
833 caps->maxRenderbufferSize = QuerySingleGLInt(functions, GL_MAX_RENDERBUFFER_SIZE); in GenerateCaps()
834 caps->maxColorAttachments = QuerySingleGLInt(functions, GL_MAX_COLOR_ATTACHMENTS); in GenerateCaps()
836 else if (functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
838 caps->maxRenderbufferSize = QuerySingleGLInt(functions, GL_MAX_RENDERBUFFER_SIZE); in GenerateCaps()
847 if (functions->isAtLeastGL(gl::Version(2, 0)) || in GenerateCaps()
848 functions->hasGLExtension("ARB_draw_buffers") || in GenerateCaps()
849 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
850 functions->hasGLESExtension("GL_EXT_draw_buffers")) in GenerateCaps()
852 caps->maxDrawBuffers = QuerySingleGLInt(functions, GL_MAX_DRAW_BUFFERS); in GenerateCaps()
863 QueryGLIntRange(functions, GL_MAX_VIEWPORT_DIMS, 0); // GL 1.0 / ES 2.0 in GenerateCaps()
865 QueryGLIntRange(functions, GL_MAX_VIEWPORT_DIMS, 1); // GL 1.0 / ES 2.0 in GenerateCaps()
867 if (functions->standard == STANDARD_GL_DESKTOP && in GenerateCaps()
868 (functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0) in GenerateCaps()
873 std::max(1.0f, QueryGLFloatRange(functions, GL_POINT_SIZE_RANGE, 0)); in GenerateCaps()
874 caps->maxAliasedPointSize = QueryGLFloatRange(functions, GL_POINT_SIZE_RANGE, 1); in GenerateCaps()
879 std::max(1.0f, QueryGLFloatRange(functions, GL_ALIASED_POINT_SIZE_RANGE, 0)); in GenerateCaps()
880 caps->maxAliasedPointSize = QueryGLFloatRange(functions, GL_ALIASED_POINT_SIZE_RANGE, 1); in GenerateCaps()
884 QueryGLFloatRange(functions, GL_ALIASED_LINE_WIDTH_RANGE, 0); // GL 1.2 / ES 2.0 in GenerateCaps()
886 QueryGLFloatRange(functions, GL_ALIASED_LINE_WIDTH_RANGE, 1); // GL 1.2 / ES 2.0 in GenerateCaps()
889 if (functions->isAtLeastGL(gl::Version(1, 2)) || functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
891 caps->maxElementsIndices = QuerySingleGLInt(functions, GL_MAX_ELEMENTS_INDICES); in GenerateCaps()
892 caps->maxElementsVertices = QuerySingleGLInt(functions, GL_MAX_ELEMENTS_VERTICES); in GenerateCaps()
899 if (functions->isAtLeastGL(gl::Version(4, 1)) || in GenerateCaps()
900 functions->hasGLExtension("GL_ARB_get_program_binary") || in GenerateCaps()
901 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
902 functions->hasGLESExtension("GL_OES_get_program_binary")) in GenerateCaps()
906 GLint numBinaryFormats = QuerySingleGLInt(functions, GL_NUM_PROGRAM_BINARY_FORMATS_OES); in GenerateCaps()
919 if (functions->isAtLeastGL(gl::Version(4, 1)) || in GenerateCaps()
920 functions->hasGLExtension("GL_ARB_ES2_compatibility") || in GenerateCaps()
921 functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
923 caps->vertexHighpFloat = QueryTypePrecision(functions, GL_VERTEX_SHADER, GL_HIGH_FLOAT); in GenerateCaps()
924 caps->vertexMediumpFloat = QueryTypePrecision(functions, GL_VERTEX_SHADER, GL_MEDIUM_FLOAT); in GenerateCaps()
925 caps->vertexLowpFloat = QueryTypePrecision(functions, GL_VERTEX_SHADER, GL_LOW_FLOAT); in GenerateCaps()
926 caps->fragmentHighpFloat = QueryTypePrecision(functions, GL_FRAGMENT_SHADER, GL_HIGH_FLOAT); in GenerateCaps()
928 QueryTypePrecision(functions, GL_FRAGMENT_SHADER, GL_MEDIUM_FLOAT); in GenerateCaps()
929 caps->fragmentLowpFloat = QueryTypePrecision(functions, GL_FRAGMENT_SHADER, GL_LOW_FLOAT); in GenerateCaps()
930 caps->vertexHighpInt = QueryTypePrecision(functions, GL_VERTEX_SHADER, GL_HIGH_INT); in GenerateCaps()
931 caps->vertexMediumpInt = QueryTypePrecision(functions, GL_VERTEX_SHADER, GL_MEDIUM_INT); in GenerateCaps()
932 caps->vertexLowpInt = QueryTypePrecision(functions, GL_VERTEX_SHADER, GL_LOW_INT); in GenerateCaps()
933 caps->fragmentHighpInt = QueryTypePrecision(functions, GL_FRAGMENT_SHADER, GL_HIGH_INT); in GenerateCaps()
934 caps->fragmentMediumpInt = QueryTypePrecision(functions, GL_FRAGMENT_SHADER, GL_MEDIUM_INT); in GenerateCaps()
935 caps->fragmentLowpInt = QueryTypePrecision(functions, GL_FRAGMENT_SHADER, GL_LOW_INT); in GenerateCaps()
954 if (functions->isAtLeastGL(gl::Version(3, 2)) || functions->hasGLExtension("GL_ARB_sync") || in GenerateCaps()
955 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
959 std::max<GLint64>(QuerySingleGLInt64(functions, GL_MAX_SERVER_WAIT_TIMEOUT), 0); in GenerateCaps()
967 if (functions->isAtLeastGL(gl::Version(2, 0)) || functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
969 caps->maxVertexAttributes = QuerySingleGLInt(functions, GL_MAX_VERTEX_ATTRIBS); in GenerateCaps()
971 QuerySingleGLInt(functions, GL_MAX_VERTEX_UNIFORM_COMPONENTS); in GenerateCaps()
973 QuerySingleGLInt(functions, GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS); in GenerateCaps()
981 if (functions->isAtLeastGL(gl::Version(4, 1)) || in GenerateCaps()
982 functions->hasGLExtension("GL_ARB_ES2_compatibility") || in GenerateCaps()
983 functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
985 caps->maxVertexUniformVectors = QuerySingleGLInt(functions, GL_MAX_VERTEX_UNIFORM_VECTORS); in GenerateCaps()
987 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_UNIFORM_VECTORS); in GenerateCaps()
999 if (functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1002 QuerySingleGLInt(functions, GL_MAX_VERTEX_OUTPUT_COMPONENTS); in GenerateCaps()
1012 if (functions->isAtLeastGL(gl::Version(2, 0)) || functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
1015 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_UNIFORM_COMPONENTS); in GenerateCaps()
1017 QuerySingleGLInt(functions, GL_MAX_TEXTURE_IMAGE_UNITS); in GenerateCaps()
1025 if (functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1028 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_INPUT_COMPONENTS); in GenerateCaps()
1037 if (functions->isAtLeastGL(gl::Version(3, 0)) || functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1039 caps->minProgramTexelOffset = QuerySingleGLInt(functions, GL_MIN_PROGRAM_TEXEL_OFFSET); in GenerateCaps()
1040 caps->maxProgramTexelOffset = QuerySingleGLInt(functions, GL_MAX_PROGRAM_TEXEL_OFFSET); in GenerateCaps()
1049 if (functions->isAtLeastGL(gl::Version(3, 1)) || in GenerateCaps()
1050 functions->hasGLExtension("GL_ARB_uniform_buffer_object") || in GenerateCaps()
1051 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1054 QuerySingleGLInt(functions, GL_MAX_VERTEX_UNIFORM_BLOCKS); in GenerateCaps()
1056 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_UNIFORM_BLOCKS); in GenerateCaps()
1058 QuerySingleGLInt(functions, GL_MAX_UNIFORM_BUFFER_BINDINGS); in GenerateCaps()
1059 caps->maxUniformBlockSize = QuerySingleGLInt64(functions, GL_MAX_UNIFORM_BLOCK_SIZE); in GenerateCaps()
1061 QuerySingleGLInt(functions, GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT); in GenerateCaps()
1063 QuerySingleGLInt(functions, GL_MAX_COMBINED_UNIFORM_BLOCKS); in GenerateCaps()
1065 QuerySingleGLInt64(functions, GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS); in GenerateCaps()
1067 QuerySingleGLInt64(functions, GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS); in GenerateCaps()
1075 if (functions->isAtLeastGL(gl::Version(3, 2)) && in GenerateCaps()
1076 (functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0) in GenerateCaps()
1078 caps->maxVaryingComponents = QuerySingleGLInt(functions, GL_MAX_VERTEX_OUTPUT_COMPONENTS); in GenerateCaps()
1080 else if (functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1081 functions->hasGLExtension("GL_ARB_ES2_compatibility") || in GenerateCaps()
1082 functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
1084 caps->maxVaryingComponents = QuerySingleGLInt(functions, GL_MAX_VARYING_COMPONENTS); in GenerateCaps()
1086 else if (functions->isAtLeastGL(gl::Version(2, 0))) in GenerateCaps()
1088 caps->maxVaryingComponents = QuerySingleGLInt(functions, GL_MAX_VARYING_FLOATS); in GenerateCaps()
1096 if (functions->isAtLeastGL(gl::Version(4, 1)) || in GenerateCaps()
1097 functions->hasGLExtension("GL_ARB_ES2_compatibility") || in GenerateCaps()
1098 functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
1100 caps->maxVaryingVectors = QuerySingleGLInt(functions, GL_MAX_VARYING_VECTORS); in GenerateCaps()
1112 QuerySingleGLInt(functions, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS); in GenerateCaps()
1115 if (functions->isAtLeastGL(gl::Version(4, 0)) || in GenerateCaps()
1116 functions->hasGLExtension("GL_ARB_transform_feedback2") || in GenerateCaps()
1117 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1120 QuerySingleGLInt(functions, GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS); in GenerateCaps()
1122 QuerySingleGLInt(functions, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS); in GenerateCaps()
1124 QuerySingleGLInt(functions, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS); in GenerateCaps()
1139 if (functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1140 functions->hasGLExtension("GL_EXT_framebuffer_multisample") || in GenerateCaps()
1141 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1142 functions->hasGLESExtension("GL_EXT_multisampled_render_to_texture")) in GenerateCaps()
1144 caps->maxSamples = std::min(QuerySingleGLInt(functions, GL_MAX_SAMPLES), sampleCountLimit); in GenerateCaps()
1158 if (!functions->isAtLeastGL(gl::Version(3, 3)) && in GenerateCaps()
1159 !functions->hasGLExtension("GL_ARB_sampler_objects") && in GenerateCaps()
1160 !functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1167 if (!functions->isAtLeastGL(gl::Version(3, 3)) && in GenerateCaps()
1168 !functions->hasGLExtension("GL_ARB_texture_swizzle") && in GenerateCaps()
1169 !functions->hasGLExtension("GL_EXT_texture_swizzle") && in GenerateCaps()
1170 !functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1176 if (functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) in GenerateCaps()
1184 if (!functions->isAtLeastGL(gl::Version(4, 2)) && in GenerateCaps()
1185 !(functions->isAtLeastGL(gl::Version(3, 2)) && in GenerateCaps()
1186 functions->hasGLExtension("GL_ARB_shader_bit_encoding")) && in GenerateCaps()
1187 !functions->hasGLExtension("GL_ARB_shading_language_packing") && in GenerateCaps()
1188 !functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1195 if (!functions->isAtLeastGL(gl::Version(3, 3)) && in GenerateCaps()
1196 !functions->hasGLExtension("GL_ARB_explicit_attrib_location") && in GenerateCaps()
1197 !functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1202 if (!functions->isAtLeastGL(gl::Version(4, 3)) && in GenerateCaps()
1203 !functions->hasGLExtension("GL_ARB_stencil_texturing") && in GenerateCaps()
1204 !functions->isAtLeastGLES(gl::Version(3, 1))) in GenerateCaps()
1209 if (functions->isAtLeastGL(gl::Version(4, 3)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1210 functions->hasGLExtension("GL_ARB_framebuffer_no_attachments")) in GenerateCaps()
1212 caps->maxFramebufferWidth = QuerySingleGLInt(functions, GL_MAX_FRAMEBUFFER_WIDTH); in GenerateCaps()
1213 caps->maxFramebufferHeight = QuerySingleGLInt(functions, GL_MAX_FRAMEBUFFER_HEIGHT); in GenerateCaps()
1215 std::min(QuerySingleGLInt(functions, GL_MAX_FRAMEBUFFER_SAMPLES), sampleCountLimit); in GenerateCaps()
1222 if (functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1223 functions->hasGLExtension("GL_ARB_texture_multisample")) in GenerateCaps()
1225 caps->maxSampleMaskWords = QuerySingleGLInt(functions, GL_MAX_SAMPLE_MASK_WORDS); in GenerateCaps()
1227 std::min(QuerySingleGLInt(functions, GL_MAX_COLOR_TEXTURE_SAMPLES), sampleCountLimit); in GenerateCaps()
1229 std::min(QuerySingleGLInt(functions, GL_MAX_DEPTH_TEXTURE_SAMPLES), sampleCountLimit); in GenerateCaps()
1231 std::min(QuerySingleGLInt(functions, GL_MAX_INTEGER_SAMPLES), sampleCountLimit); in GenerateCaps()
1238 if (functions->isAtLeastGL(gl::Version(4, 3)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1239 functions->hasGLExtension("GL_ARB_vertex_attrib_binding")) in GenerateCaps()
1242 QuerySingleGLInt(functions, GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET); in GenerateCaps()
1243 caps->maxVertexAttribBindings = QuerySingleGLInt(functions, GL_MAX_VERTEX_ATTRIB_BINDINGS); in GenerateCaps()
1248 (functions->standard == STANDARD_GL_DESKTOP && functions->version == gl::Version(4, 3))) in GenerateCaps()
1254 caps->maxVertexAttribStride = QuerySingleGLInt(functions, GL_MAX_VERTEX_ATTRIB_STRIDE); in GenerateCaps()
1262 if (functions->isAtLeastGL(gl::Version(4, 3)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1263 functions->hasGLExtension("GL_ARB_shader_storage_buffer_object")) in GenerateCaps()
1266 QuerySingleGLInt(functions, GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES); in GenerateCaps()
1268 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS); in GenerateCaps()
1270 QuerySingleGLInt(functions, GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS); in GenerateCaps()
1272 QuerySingleGLInt(functions, GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS); in GenerateCaps()
1274 QuerySingleGLInt64(functions, GL_MAX_SHADER_STORAGE_BLOCK_SIZE); in GenerateCaps()
1276 QuerySingleGLInt(functions, GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS); in GenerateCaps()
1278 QuerySingleGLInt(functions, GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT); in GenerateCaps()
1285 if (nativegl::SupportsCompute(functions)) in GenerateCaps()
1290 QuerySingleIndexGLInt(functions, GL_MAX_COMPUTE_WORK_GROUP_COUNT, index); in GenerateCaps()
1293 QuerySingleIndexGLInt(functions, GL_MAX_COMPUTE_WORK_GROUP_SIZE, index); in GenerateCaps()
1296 QuerySingleGLInt(functions, GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS); in GenerateCaps()
1298 QuerySingleGLInt(functions, GL_MAX_COMPUTE_UNIFORM_BLOCKS); in GenerateCaps()
1300 QuerySingleGLInt(functions, GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS); in GenerateCaps()
1302 QuerySingleGLInt(functions, GL_MAX_COMPUTE_SHARED_MEMORY_SIZE); in GenerateCaps()
1304 QuerySingleGLInt(functions, GL_MAX_COMPUTE_UNIFORM_COMPONENTS); in GenerateCaps()
1306 QuerySingleGLInt(functions, GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS); in GenerateCaps()
1308 QuerySingleGLInt(functions, GL_MAX_COMPUTE_ATOMIC_COUNTERS); in GenerateCaps()
1310 QuerySingleGLInt(functions, GL_MAX_COMPUTE_IMAGE_UNIFORMS); in GenerateCaps()
1312 QuerySingleGLInt(functions, GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS); in GenerateCaps()
1314 QuerySingleGLInt(functions, GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS); in GenerateCaps()
1321 if (functions->isAtLeastGL(gl::Version(4, 3)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1322 functions->hasGLExtension("GL_ARB_explicit_uniform_location")) in GenerateCaps()
1324 caps->maxUniformLocations = QuerySingleGLInt(functions, GL_MAX_UNIFORM_LOCATIONS); in GenerateCaps()
1331 if (functions->isAtLeastGL(gl::Version(4, 0)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1332 functions->hasGLExtension("GL_ARB_texture_gather")) in GenerateCaps()
1335 QuerySingleGLInt(functions, GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET); in GenerateCaps()
1337 QuerySingleGLInt(functions, GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET); in GenerateCaps()
1344 if (functions->isAtLeastGL(gl::Version(4, 2)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1345 functions->hasGLExtension("GL_ARB_shader_image_load_store")) in GenerateCaps()
1348 QuerySingleGLInt(functions, GL_MAX_VERTEX_IMAGE_UNIFORMS); in GenerateCaps()
1350 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_IMAGE_UNIFORMS); in GenerateCaps()
1351 caps->maxImageUnits = QuerySingleGLInt(functions, GL_MAX_IMAGE_UNITS); in GenerateCaps()
1353 QuerySingleGLInt(functions, GL_MAX_COMBINED_IMAGE_UNIFORMS); in GenerateCaps()
1360 if (functions->isAtLeastGL(gl::Version(4, 2)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1361 functions->hasGLExtension("GL_ARB_shader_atomic_counters")) in GenerateCaps()
1364 QuerySingleGLInt(functions, GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS); in GenerateCaps()
1366 QuerySingleGLInt(functions, GL_MAX_VERTEX_ATOMIC_COUNTERS); in GenerateCaps()
1368 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS); in GenerateCaps()
1370 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_ATOMIC_COUNTERS); in GenerateCaps()
1372 QuerySingleGLInt(functions, GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS); in GenerateCaps()
1374 QuerySingleGLInt(functions, GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE); in GenerateCaps()
1376 QuerySingleGLInt(functions, GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS); in GenerateCaps()
1378 QuerySingleGLInt(functions, GL_MAX_COMBINED_ATOMIC_COUNTERS); in GenerateCaps()
1400 if (!CanMapBufferForRead(functions)) in GenerateCaps()
1406 if (functions->isAtLeastGL(gl::Version(4, 0)) || in GenerateCaps()
1407 functions->hasGLESExtension("GL_OES_texture_cube_map_array") || in GenerateCaps()
1408 functions->hasGLESExtension("GL_EXT_texture_cube_map_array") || in GenerateCaps()
1409 functions->hasGLExtension("GL_ARB_texture_cube_map_array") || in GenerateCaps()
1410 functions->isAtLeastGLES(gl::Version(3, 2))) in GenerateCaps()
1421 if (!nativegl::SupportsVertexArrayObjects(functions) || in GenerateCaps()
1435 (features.allowAstcFormats.enabled || functions->standard == STANDARD_GL_ES); in GenerateCaps()
1438 functions->hasExtension("GL_KHR_texture_compression_astc_hdr"); in GenerateCaps()
1441 functions->hasExtension("GL_KHR_texture_compression_astc_sliced_3d")) || in GenerateCaps()
1443 extensions->elementIndexUintOES = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1444 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1445 functions->hasGLESExtension("GL_OES_element_index_uint"); in GenerateCaps()
1447 extensions->readFormatBgraEXT = functions->isAtLeastGL(gl::Version(1, 2)) || in GenerateCaps()
1448 functions->hasGLExtension("GL_EXT_bgra") || in GenerateCaps()
1449 functions->hasGLESExtension("GL_EXT_read_format_bgra"); in GenerateCaps()
1450 extensions->pixelBufferObjectNV = functions->isAtLeastGL(gl::Version(2, 1)) || in GenerateCaps()
1451 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1452 functions->hasGLExtension("GL_ARB_pixel_buffer_object") || in GenerateCaps()
1453 functions->hasGLExtension("GL_EXT_pixel_buffer_object") || in GenerateCaps()
1454 functions->hasGLESExtension("GL_NV_pixel_buffer_object"); in GenerateCaps()
1455 extensions->syncARB = nativegl::SupportsFenceSync(functions); in GenerateCaps()
1456 extensions->mapbufferOES = functions->isAtLeastGL(gl::Version(1, 5)) || in GenerateCaps()
1457 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1458 functions->hasGLESExtension("GL_OES_mapbuffer"); in GenerateCaps()
1459 extensions->mapBufferRangeEXT = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1460 functions->hasGLExtension("GL_ARB_map_buffer_range") || in GenerateCaps()
1461 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1462 functions->hasGLESExtension("GL_EXT_map_buffer_range"); in GenerateCaps()
1463 extensions->textureNpotOES = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1464 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1465 functions->hasGLESExtension("GL_OES_texture_npot"); in GenerateCaps()
1467 extensions->drawBuffersEXT = functions->isAtLeastGL(gl::Version(2, 0)) || in GenerateCaps()
1468 functions->hasGLExtension("ARB_draw_buffers") || in GenerateCaps()
1469 functions->hasGLESExtension("GL_EXT_draw_buffers"); in GenerateCaps()
1472 (functions->isAtLeastGL(gl::Version(4, 0)) || in GenerateCaps()
1473 (functions->hasGLExtension("GL_EXT_draw_buffers2") && in GenerateCaps()
1474 functions->hasGLExtension("GL_ARB_draw_buffers_blend")) || in GenerateCaps()
1475 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1476 functions->hasGLESExtension("GL_OES_draw_buffers_indexed") || in GenerateCaps()
1477 functions->hasGLESExtension("GL_EXT_draw_buffers_indexed")); in GenerateCaps()
1479 extensions->textureStorageEXT = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1480 functions->hasGLESExtension("GL_EXT_texture_storage"); in GenerateCaps()
1482 functions->hasGLExtension("GL_EXT_texture_filter_anisotropic") || in GenerateCaps()
1483 functions->hasGLESExtension("GL_EXT_texture_filter_anisotropic"); in GenerateCaps()
1484 extensions->occlusionQueryBooleanEXT = nativegl::SupportsOcclusionQueries(functions); in GenerateCaps()
1487 ? QuerySingleGLFloat(functions, GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT) in GenerateCaps()
1489 extensions->fenceNV = FenceNVGL::Supported(functions) || FenceNVSyncGL::Supported(functions); in GenerateCaps()
1490 extensions->blendMinmaxEXT = functions->isAtLeastGL(gl::Version(1, 5)) || in GenerateCaps()
1491 functions->hasGLExtension("GL_EXT_blend_minmax") || in GenerateCaps()
1492 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1493 functions->hasGLESExtension("GL_EXT_blend_minmax"); in GenerateCaps()
1494 extensions->framebufferBlitNV = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1495 functions->hasGLExtension("GL_EXT_framebuffer_blit") || in GenerateCaps()
1496 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1497 functions->hasGLESExtension("GL_NV_framebuffer_blit"); in GenerateCaps()
1499 extensions->framebufferBlitNV || functions->hasGLESExtension("GL_ANGLE_framebuffer_blit"); in GenerateCaps()
1504 (functions->hasGLESExtension("GL_EXT_multisampled_render_to_texture") || in GenerateCaps()
1505 functions->hasGLESExtension("GL_IMG_multisampled_render_to_texture")); in GenerateCaps()
1509 functions->hasGLESExtension("GL_EXT_multisampled_render_to_texture2"); in GenerateCaps()
1510 extensions->standardDerivativesOES = functions->isAtLeastGL(gl::Version(2, 0)) || in GenerateCaps()
1511 functions->hasGLExtension("GL_ARB_fragment_shader") || in GenerateCaps()
1512 functions->hasGLESExtension("GL_OES_standard_derivatives"); in GenerateCaps()
1513 extensions->shaderTextureLodEXT = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1514 functions->hasGLExtension("GL_ARB_shader_texture_lod") || in GenerateCaps()
1515 functions->hasGLESExtension("GL_EXT_shader_texture_lod"); in GenerateCaps()
1516 extensions->fragDepthEXT = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1517 functions->hasGLESExtension("GL_EXT_frag_depth"); in GenerateCaps()
1518 extensions->conservativeDepthEXT = functions->isAtLeastGL(gl::Version(4, 2)) || in GenerateCaps()
1519 functions->hasGLExtension("GL_ARB_conservative_depth") || in GenerateCaps()
1520 functions->hasGLESExtension("GL_EXT_conservative_depth"); in GenerateCaps()
1521 extensions->depthClampEXT = functions->isAtLeastGL(gl::Version(3, 2)) || in GenerateCaps()
1522 functions->hasGLExtension("GL_ARB_depth_clamp") || in GenerateCaps()
1523 functions->hasGLESExtension("GL_EXT_depth_clamp"); in GenerateCaps()
1524 extensions->polygonOffsetClampEXT = functions->hasExtension("GL_EXT_polygon_offset_clamp"); in GenerateCaps()
1526 if (functions->standard == STANDARD_GL_DESKTOP) in GenerateCaps()
1530 else if (functions->hasGLESExtension("GL_NV_polygon_mode")) in GenerateCaps()
1534 functions->isEnabled(GL_POLYGON_OFFSET_LINE_NV); in GenerateCaps()
1535 if (functions->getError() != GL_NO_ERROR) in GenerateCaps()
1551 extensions->sampleVariablesOES = functions->isAtLeastGL(gl::Version(4, 2)) || in GenerateCaps()
1552 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1553 functions->hasGLESExtension("GL_OES_sample_variables"); in GenerateCaps()
1556 functions->isAtLeastGL(gl::Version(4, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1557 (functions->isAtLeastGLES(gl::Version(3, 1)) && in GenerateCaps()
1558 functions->hasGLESExtension("GL_OES_shader_multisample_interpolation")); in GenerateCaps()
1562 QuerySingleGLFloat(functions, GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES); in GenerateCaps()
1564 QuerySingleGLFloat(functions, GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES); in GenerateCaps()
1566 QuerySingleGLInt(functions, GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES); in GenerateCaps()
1573 if (functions->hasGLExtension("GL_ARB_shader_viewport_layer_array") || in GenerateCaps()
1574 functions->hasGLExtension("GL_NV_viewport_array2")) in GenerateCaps()
1579 const int maxLayers = QuerySingleGLInt(functions, GL_MAX_ARRAY_TEXTURE_LAYERS); in GenerateCaps()
1581 const int maxViewports = QuerySingleGLInt(functions, GL_MAX_VIEWPORTS); in GenerateCaps()
1586 extensions->fboRenderMipmapOES = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1587 functions->hasGLExtension("GL_EXT_framebuffer_object") || in GenerateCaps()
1588 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1589 functions->hasGLESExtension("GL_OES_fbo_render_mipmap"); in GenerateCaps()
1593 (functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1594 functions->hasGLESExtension("GL_EXT_texture_border_clamp") || in GenerateCaps()
1595 functions->hasGLESExtension("GL_OES_texture_border_clamp") || in GenerateCaps()
1596 functions->hasGLESExtension("GL_NV_texture_border_clamp")); in GenerateCaps()
1603 (IsMac() || functions->isAtLeastGL(gl::Version(4, 4)) || in GenerateCaps()
1604 functions->hasGLExtension("GL_ARB_texture_mirror_clamp_to_edge") || in GenerateCaps()
1605 functions->hasGLExtension("GL_EXT_texture_mirror_clamp") || in GenerateCaps()
1606 functions->hasGLExtension("GL_ATI_texture_mirror_once") || in GenerateCaps()
1607 functions->hasGLESExtension("GL_EXT_texture_mirror_clamp_to_edge")); in GenerateCaps()
1610 extensions->instancedArraysANGLE = functions->isAtLeastGL(gl::Version(3, 1)) || in GenerateCaps()
1611 (functions->hasGLExtension("GL_ARB_instanced_arrays") && in GenerateCaps()
1612 (functions->hasGLExtension("GL_ARB_draw_instanced") || in GenerateCaps()
1613 functions->hasGLExtension("GL_EXT_draw_instanced"))) || in GenerateCaps()
1614 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1615 functions->hasGLESExtension("GL_EXT_instanced_arrays"); in GenerateCaps()
1617 extensions->unpackSubimageEXT = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1618 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1619 functions->hasGLESExtension("GL_EXT_unpack_subimage"); in GenerateCaps()
1622 functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1623 (functions->isAtLeastGLES(gl::Version(3, 1)) && in GenerateCaps()
1624 functions->hasGLESExtension("GL_NV_shader_noperspective_interpolation")); in GenerateCaps()
1625 extensions->packSubimageNV = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1626 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1627 functions->hasGLESExtension("GL_NV_pack_subimage"); in GenerateCaps()
1628 extensions->vertexArrayObjectOES = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1629 functions->hasGLExtension("GL_ARB_vertex_array_object") || in GenerateCaps()
1630 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1631 functions->hasGLESExtension("GL_OES_vertex_array_object"); in GenerateCaps()
1632 extensions->debugMarkerEXT = functions->isAtLeastGL(gl::Version(4, 3)) || in GenerateCaps()
1633 functions->hasGLExtension("GL_KHR_debug") || in GenerateCaps()
1634 functions->hasGLExtension("GL_EXT_debug_marker") || in GenerateCaps()
1635 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1636 functions->hasGLESExtension("GL_KHR_debug") || in GenerateCaps()
1637 functions->hasGLESExtension("GL_EXT_debug_marker"); in GenerateCaps()
1638 extensions->EGLImageOES = functions->hasGLESExtension("GL_OES_EGL_image"); in GenerateCaps()
1639 extensions->EGLImageExternalOES = functions->hasGLESExtension("GL_OES_EGL_image_external"); in GenerateCaps()
1641 functions->hasExtension("GL_EXT_EGL_image_external_wrap_modes"); in GenerateCaps()
1643 functions->hasGLESExtension("GL_OES_EGL_image_external_essl3"); in GenerateCaps()
1644 extensions->EGLImageArrayEXT = functions->hasGLESExtension("GL_EXT_EGL_image_array"); in GenerateCaps()
1646 extensions->EGLSyncOES = functions->hasGLESExtension("GL_OES_EGL_sync"); in GenerateCaps()
1649 (functions->isAtLeastGL(gl::Version(3, 3)) || in GenerateCaps()
1650 functions->hasGLExtension("GL_ARB_timer_query") || in GenerateCaps()
1651 functions->hasGLESExtension("GL_EXT_disjoint_timer_query"))) in GenerateCaps()
1659 QueryQueryValue(functions, GL_TIME_ELAPSED, GL_QUERY_COUNTER_BITS); in GenerateCaps()
1661 QueryQueryValue(functions, GL_TIMESTAMP, GL_QUERY_COUNTER_BITS); in GenerateCaps()
1669 functions->isAtLeastGL(gl::Version(1, 3)) || in GenerateCaps()
1670 functions->hasGLESExtension("GL_EXT_multisample_compatibility"); in GenerateCaps()
1673 functions->hasGLExtension("GL_NV_framebuffer_mixed_samples") || in GenerateCaps()
1674 functions->hasGLESExtension("GL_NV_framebuffer_mixed_samples"); in GenerateCaps()
1676 extensions->robustnessEXT = functions->isAtLeastGL(gl::Version(4, 5)) || in GenerateCaps()
1677 functions->hasGLExtension("GL_KHR_robustness") || in GenerateCaps()
1678 functions->hasGLExtension("GL_ARB_robustness") || in GenerateCaps()
1679 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1680 functions->hasGLESExtension("GL_KHR_robustness") || in GenerateCaps()
1681 functions->hasGLESExtension("GL_EXT_robustness"); in GenerateCaps()
1682 extensions->robustnessKHR = functions->isAtLeastGL(gl::Version(4, 5)) || in GenerateCaps()
1683 functions->hasGLExtension("GL_KHR_robustness") || in GenerateCaps()
1684 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1685 functions->hasGLESExtension("GL_KHR_robustness"); in GenerateCaps()
1689 (functions->hasGLExtension("GL_ARB_robust_buffer_access_behavior") || in GenerateCaps()
1690 functions->hasGLESExtension("GL_KHR_robust_buffer_access_behavior")); in GenerateCaps()
1692 extensions->stencilTexturingANGLE = functions->isAtLeastGL(gl::Version(4, 3)) || in GenerateCaps()
1693 functions->hasGLExtension("GL_ARB_stencil_texturing") || in GenerateCaps()
1694 functions->isAtLeastGLES(gl::Version(3, 1)); in GenerateCaps()
1698 functions->isAtLeastGLES(gl::Version(3, 1))) in GenerateCaps()
1707 QuerySingleGLInt(functions, GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT); in GenerateCaps()
1727 if (functions->isAtLeastGL(gl::Version(4, 2)) || in GenerateCaps()
1728 functions->hasGLExtension("GL_ARB_shader_image_load_store")) in GenerateCaps()
1736 else if (functions->isAtLeastGLES(gl::Version(3, 1))) in GenerateCaps()
1775 functions->standard != StandardGL::STANDARD_GL_ES; in GenerateCaps()
1788 functions->standard != StandardGL::STANDARD_GL_ES; in GenerateCaps()
1807 extensions->syncQueryCHROMIUM = SyncQueryGL::IsSupported(functions); in GenerateCaps()
1812 functions->isAtLeastGL(gl::Version(4, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)); in GenerateCaps()
1817 extensions->textureMultisampleANGLE = functions->isAtLeastGL(gl::Version(3, 2)) || in GenerateCaps()
1818 functions->hasGLExtension("GL_ARB_texture_multisample"); in GenerateCaps()
1820 extensions->textureSRGBDecodeEXT = functions->hasGLExtension("GL_EXT_texture_sRGB_decode") || in GenerateCaps()
1821 functions->hasGLESExtension("GL_EXT_texture_sRGB_decode"); in GenerateCaps()
1826 extensions->compressedETC2RGB8TextureOES || functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1827 functions->hasGLESExtension("GL_EXT_compressed_ETC1_RGB8_sub_texture"); in GenerateCaps()
1830 VendorID vendor = GetVendorID(functions); in GenerateCaps()
1840 extensions->sRGBWriteControlEXT = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1841 functions->hasGLExtension("GL_EXT_framebuffer_sRGB") || in GenerateCaps()
1842 functions->hasGLExtension("GL_ARB_framebuffer_sRGB") || in GenerateCaps()
1843 functions->hasGLESExtension("GL_EXT_sRGB_write_control"); in GenerateCaps()
1858 extensions->discardFramebufferEXT = functions->isAtLeastGL(gl::Version(4, 3)) || in GenerateCaps()
1859 functions->hasGLExtension("GL_ARB_invalidate_subdata") || in GenerateCaps()
1860 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1861 functions->hasGLESExtension("GL_EXT_discard_framebuffer") || in GenerateCaps()
1862 functions->hasGLESExtension("GL_ARB_invalidate_subdata"); in GenerateCaps()
1866 if (functions->isAtLeastGL(gl::Version(3, 1)) || in GenerateCaps()
1867 functions->hasGLExtension("GL_ARB_texture_rectangle")) in GenerateCaps()
1871 QuerySingleGLInt(functions, GL_MAX_RECTANGLE_TEXTURE_SIZE_ANGLE); in GenerateCaps()
1877 functions->isAtLeastGL(gl::Version(4, 3)) || functions->isAtLeastGLES(gl::Version(3, 2)); in GenerateCaps()
1882 bool hasInstancedGSSupport = functions->isAtLeastGL(gl::Version(4, 0)) && in GenerateCaps()
1883 functions->hasGLExtension("GL_ARB_shader_atomic_counters") && in GenerateCaps()
1884 functions->hasGLExtension("GL_ARB_shader_storage_buffer_object") && in GenerateCaps()
1885 functions->hasGLExtension("GL_ARB_shader_image_load_store"); in GenerateCaps()
1886 if (hasCoreGSSupport || functions->hasGLESExtension("GL_OES_geometry_shader") || in GenerateCaps()
1887 functions->hasGLESExtension("GL_EXT_geometry_shader") || hasInstancedGSSupport) in GenerateCaps()
1889 extensions->geometryShaderEXT = functions->hasGLESExtension("GL_EXT_geometry_shader") || in GenerateCaps()
1891 extensions->geometryShaderOES = functions->hasGLESExtension("GL_OES_geometry_shader") || in GenerateCaps()
1894 caps->maxFramebufferLayers = QuerySingleGLInt(functions, GL_MAX_FRAMEBUFFER_LAYERS_EXT); in GenerateCaps()
1905 caps->layerProvokingVertex = QuerySingleGLInt(functions, GL_LAYER_PROVOKING_VERTEX_EXT); in GenerateCaps()
1916 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT); in GenerateCaps()
1918 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT); in GenerateCaps()
1920 QuerySingleGLInt(functions, GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT); in GenerateCaps()
1922 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT); in GenerateCaps()
1924 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT); in GenerateCaps()
1926 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT); in GenerateCaps()
1928 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT); in GenerateCaps()
1930 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT); in GenerateCaps()
1932 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT); in GenerateCaps()
1934 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT); in GenerateCaps()
1936 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT); in GenerateCaps()
1938 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT); in GenerateCaps()
1940 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT); in GenerateCaps()
1958 (functions->isAtLeastGL(gl::Version(3, 3)) || in GenerateCaps()
1959 functions->hasGLESExtension("GL_EXT_blend_func_extended")); in GenerateCaps()
1970 extensions->floatBlendEXT = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1971 functions->hasGLESExtension("GL_EXT_float_blend") || in GenerateCaps()
1972 functions->isAtLeastGLES(gl::Version(3, 2)); in GenerateCaps()
1977 (functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1978 functions->hasGLESExtension("GL_OES_draw_elements_base_vertex") || in GenerateCaps()
1979 functions->hasGLESExtension("GL_EXT_draw_elements_base_vertex")); in GenerateCaps()
1984 (functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1985 functions->hasGLESExtension("GL_OES_draw_elements_base_vertex") || in GenerateCaps()
1986 functions->hasGLESExtension("GL_EXT_draw_elements_base_vertex") || in GenerateCaps()
1987 functions->hasGLESExtension("GL_EXT_base_instance")); in GenerateCaps()
1994 functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1995 functions->hasGLESExtension("GL_OES_draw_elements_base_vertex"); in GenerateCaps()
1999 functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
2000 functions->hasGLESExtension("GL_EXT_draw_elements_base_vertex"); in GenerateCaps()
2006 (features.allowETCFormats.enabled || functions->standard == STANDARD_GL_ES) && in GenerateCaps()
2012 !features.allowETCFormats.enabled && functions->standard == STANDARD_GL_DESKTOP; in GenerateCaps()
2017 !functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
2022 extensions->provokingVertexANGLE = functions->hasGLExtension("GL_ARB_provoking_vertex") || in GenerateCaps()
2023 functions->hasGLExtension("GL_EXT_provoking_vertex") || in GenerateCaps()
2024 functions->isAtLeastGL(gl::Version(3, 2)); in GenerateCaps()
2027 extensions->texture3DOES = functions->isAtLeastGL(gl::Version(1, 2)) || in GenerateCaps()
2028 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
2029 functions->hasGLESExtension("GL_OES_texture_3D"); in GenerateCaps()
2031 extensions->memoryObjectEXT = functions->hasGLExtension("GL_EXT_memory_object") || in GenerateCaps()
2032 functions->hasGLESExtension("GL_EXT_memory_object"); in GenerateCaps()
2033 extensions->semaphoreEXT = functions->hasGLExtension("GL_EXT_semaphore") || in GenerateCaps()
2034 functions->hasGLESExtension("GL_EXT_semaphore"); in GenerateCaps()
2035 extensions->memoryObjectFdEXT = functions->hasGLExtension("GL_EXT_memory_object_fd") || in GenerateCaps()
2036 functions->hasGLESExtension("GL_EXT_memory_object_fd"); in GenerateCaps()
2038 (functions->hasGLExtension("GL_EXT_semaphore_fd") || in GenerateCaps()
2039 functions->hasGLESExtension("GL_EXT_semaphore_fd")); in GenerateCaps()
2040 extensions->gpuShader5EXT = functions->isAtLeastGL(gl::Version(4, 0)) || in GenerateCaps()
2041 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
2042 functions->hasGLExtension("GL_ARB_gpu_shader5") || in GenerateCaps()
2043 functions->hasGLESExtension("GL_EXT_gpu_shader5") || in GenerateCaps()
2044 functions->hasGLESExtension("GL_OES_gpu_shader5"); in GenerateCaps()
2046 extensions->shaderIoBlocksOES = functions->isAtLeastGL(gl::Version(3, 2)) || in GenerateCaps()
2047 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
2048 functions->hasGLESExtension("GL_OES_shader_io_blocks") || in GenerateCaps()
2049 functions->hasGLESExtension("GL_EXT_shader_io_blocks"); in GenerateCaps()
2052 extensions->shadowSamplersEXT = functions->isAtLeastGL(gl::Version(2, 0)) || in GenerateCaps()
2053 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
2054 functions->hasGLESExtension("GL_EXT_shadow_samplers"); in GenerateCaps()
2058 extensions->clipControlEXT = functions->isAtLeastGL(gl::Version(4, 5)) || in GenerateCaps()
2059 functions->hasGLExtension("GL_ARB_clip_control") || in GenerateCaps()
2060 functions->hasGLESExtension("GL_EXT_clip_control"); in GenerateCaps()
2074 extensions->clipDistanceAPPLE = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
2075 functions->hasGLESExtension("GL_APPLE_clip_distance"); in GenerateCaps()
2078 caps->maxClipDistances = QuerySingleGLInt(functions, GL_MAX_CLIP_DISTANCES_APPLE); in GenerateCaps()
2091 functions->isAtLeastGL(gl::Version(4, 5)) || in GenerateCaps()
2092 (functions->isAtLeastGL(gl::Version(3, 0)) && in GenerateCaps()
2093 functions->hasGLExtension("GL_ARB_cull_distance")) || in GenerateCaps()
2094 (extensions->shaderIoBlocksEXT && functions->hasGLESExtension("GL_EXT_clip_cull_distance")); in GenerateCaps()
2097 caps->maxClipDistances = QuerySingleGLInt(functions, GL_MAX_CLIP_DISTANCES_EXT); in GenerateCaps()
2098 caps->maxCullDistances = QuerySingleGLInt(functions, GL_MAX_CULL_DISTANCES_EXT); in GenerateCaps()
2100 QuerySingleGLInt(functions, GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT); in GenerateCaps()
2116 (functions->isAtLeastGL(gl::Version(3, 0)) || extensions->clipCullDistanceEXT) && in GenerateCaps()
2126 if (functions->isAtLeastGL(gl::Version(4, 5)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
2127 functions->hasGLESExtension("GL_OES_shader_image_atomic")) in GenerateCaps()
2133 if (functions->isAtLeastGL(gl::Version(4, 3)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
2134 functions->hasGLESExtension("GL_OES_texture_buffer") || in GenerateCaps()
2135 functions->hasGLESExtension("GL_EXT_texture_buffer") || in GenerateCaps()
2136 functions->hasGLExtension("GL_ARB_texture_buffer_object")) in GenerateCaps()
2138 caps->maxTextureBufferSize = QuerySingleGLInt(functions, GL_MAX_TEXTURE_BUFFER_SIZE); in GenerateCaps()
2140 QuerySingleGLInt(functions, GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT); in GenerateCaps()
2150 extensions->YUVTargetEXT = functions->hasGLESExtension("GL_EXT_YUV_target"); in GenerateCaps()
2153 extensions->framebufferFlipYMESA = functions->hasGLESExtension("GL_MESA_framebuffer_flip_y") || in GenerateCaps()
2154 functions->hasGLExtension("GL_MESA_framebuffer_flip_y"); in GenerateCaps()
2158 (functions->maxShaderCompilerThreadsKHR != nullptr || in GenerateCaps()
2159 functions->maxShaderCompilerThreadsARB != nullptr); in GenerateCaps()
2162 extensions->logicOpANGLE = functions->isAtLeastGL(gl::Version(2, 0)); in GenerateCaps()
2171 if (IsQualcomm(GetVendorID(functions))) in GenerateCaps()
2175 functions->getFloatv(GL_BLEND_COLOR, oldColor); in GenerateCaps()
2179 functions->blendColor(2.0, 0.0, 0.0, 0.0); in GenerateCaps()
2180 functions->getFloatv(GL_BLEND_COLOR, color); in GenerateCaps()
2184 functions->blendColor(oldColor[0], oldColor[1], oldColor[2], oldColor[3]); in GenerateCaps()
2188 bool GetSystemInfoVendorIDAndDeviceID(const FunctionsGL *functions, in GetSystemInfoVendorIDAndDeviceID() argument
2194 *outVendor = GetVendorID(functions); in GetSystemInfoVendorIDAndDeviceID()
2228 *outDevice = GetDeviceID(functions); in GetSystemInfoVendorIDAndDeviceID()
2247 void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *features) in InitializeFeatures() argument
2254 GetSystemInfoVendorIDAndDeviceID(functions, &systemInfo, &vendor, &device); in InitializeFeatures()
2266 bool isMesa = IsMesa(functions, &mesaVersion); in InitializeFeatures()
2271 qualcommVersion = GetQualcommVersion(functions); in InitializeFeatures()
2276 functions->standard == STANDARD_GL_DESKTOP && isAMD); in InitializeFeatures()
2279 functions->standard == STANDARD_GL_DESKTOP && isIntel); in InitializeFeatures()
2312 IsLinux() && functions->standard == STANDARD_GL_DESKTOP && isAMD); in InitializeFeatures()
2315 (IsApple() && functions->standard == STANDARD_GL_DESKTOP) || (IsLinux() && isAMD)); in InitializeFeatures()
2319 IsApple() && functions->standard == STANDARD_GL_DESKTOP && in InitializeFeatures()
2333 functions->standard == STANDARD_GL_DESKTOP && isNvidia); in InitializeFeatures()
2349 functions->isAtMostGL(gl::Version(4, 1)) || in InitializeFeatures()
2350 (functions->standard == STANDARD_GL_DESKTOP && isAMD)); in InitializeFeatures()
2407 IsAndroid() || isAMD || !functions->hasExtension("GL_KHR_robust_buffer_access_behavior")); in InitializeFeatures()
2417 (IsApple() && functions->standard == STANDARD_GL_ES)); in InitializeFeatures()
2427 functions->standard == STANDARD_GL_DESKTOP && in InitializeFeatures()
2428 functions->isAtLeastGL(gl::Version(3, 1)) && in InitializeFeatures()
2429 !functions->isAtLeastGL(gl::Version(4, 3))); in InitializeFeatures()
2445 !isIntel && functions->standard == STANDARD_GL_ES && in InitializeFeatures()
2446 functions->isAtLeastGLES(gl::Version(3, 1)) && in InitializeFeatures()
2447 functions->hasGLESExtension("GL_EXT_texture_norm16")); in InitializeFeatures()
2455 // IsApple() && functions->standard == STANDARD_GL_DESKTOP); in InitializeFeatures()
2468 (IsAndroid() && GetAndroidSDKVersion() < 27 && IsAdreno5xxOrOlder(functions)) || in InitializeFeatures()
2469 (!isMesa && IsMaliT8xxOrOlder(functions)) || (!isMesa && IsMaliG31OrOlder(functions))); in InitializeFeatures()
2479 IsApple() && functions->standard == STANDARD_GL_ES && !(isAMD && IsWindows())); in InitializeFeatures()
2492 if (IsApple() && functions->standard == STANDARD_GL_DESKTOP) in InitializeFeatures()
2531 ANGLE_FEATURE_CONDITION(features, keepBufferShadowCopy, !CanMapBufferForRead(functions)); in InitializeFeatures()
2540 ANGLE_FEATURE_CONDITION(features, initFragmentOutputVariables, IsAdreno42xOr3xx(functions)); in InitializeFeatures()
2548 !nativegl::SupportsVertexArrayObjects(functions)); in InitializeFeatures()
2569 IsAndroid() && IsAdreno4xx(functions) && GetAndroidSDKVersion() < 22; in InitializeFeatures()
2573 IsAndroid() && IsAdreno4xx(functions) && GetAndroidSDKVersion() == 24; in InitializeFeatures()
2575 IsAndroid() && IsAdreno5xx(functions) && GetAndroidSDKVersion() < 24; in InitializeFeatures()
2579 IsAndroid() && IsAdreno5xx(functions) && GetAndroidSDKVersion() == 25; in InitializeFeatures()
2600 ANGLE_FEATURE_CONDITION(features, emulateRGB10, functions->standard == STANDARD_GL_DESKTOP); in InitializeFeatures()
2618 functions->hasGLESExtension("GL_EXT_clip_control")); in InitializeFeatures()
2627 functions->isAtLeastGL(gl::Version(4, 3)) && in InitializeFeatures()
2628 functions->hasGLExtension("GL_NV_fragment_shader_interlock")); in InitializeFeatures()
2630 functions->isAtLeastGL(gl::Version(4, 4)) && in InitializeFeatures()
2631 functions->hasGLExtension("GL_INTEL_fragment_shader_ordering")); in InitializeFeatures()
2633 functions->isAtLeastGL(gl::Version(4, 5)) && in InitializeFeatures()
2634 functions->hasGLExtension("GL_ARB_fragment_shader_interlock")); in InitializeFeatures()
2638 functions->hasGLESExtension("GL_EXT_shader_framebuffer_fetch")); in InitializeFeatures()
2643 functions->hasGLESExtension("GL_EXT_shader_framebuffer_fetch_non_coherent")); in InitializeFeatures()
2647 functions->hasGLESExtension("GL_EXT_shader_pixel_local_storage")); in InitializeFeatures()
2653 ANGLE_FEATURE_CONDITION(features, disableClipControl, IsMaliG72OrG76OrG51(functions)); in InitializeFeatures()
2662 functions->standard == STANDARD_GL_ES))); in InitializeFeatures()
2666 functions->standard == STANDARD_GL_ES && isMesa && in InitializeFeatures()
2670 ANGLE_FEATURE_CONDITION(features, disableBaseInstanceVertex, IsMaliValhall(functions)); in InitializeFeatures()
2683 IsPixel7OrPixel8(functions)); in InitializeFeatures()
2686 void InitializeFrontendFeatures(const FunctionsGL *functions, angle::FrontendFeatures *features) in InitializeFrontendFeatures() argument
2688 VendorID vendor = GetVendorID(functions); in InitializeFrontendFeatures()
2692 bool isMesa = IsMesa(functions, &mesaVersion); in InitializeFrontendFeatures()
2698 ANGLE_FEATURE_CONDITION(features, disableProgramBinary, IsPowerVrRogue(functions)); in InitializeFrontendFeatures()
2711 void ReInitializeFeaturesAtGPUSwitch(const FunctionsGL *functions, angle::FeaturesGL *features) in ReInitializeFeaturesAtGPUSwitch() argument
2717 GetSystemInfoVendorIDAndDeviceID(functions, &systemInfo, &vendor, &device); in ReInitializeFeaturesAtGPUSwitch()
2732 bool SupportsVertexArrayObjects(const FunctionsGL *functions) in SupportsVertexArrayObjects() argument
2734 return functions->isAtLeastGLES(gl::Version(3, 0)) || in SupportsVertexArrayObjects()
2735 functions->hasGLESExtension("GL_OES_vertex_array_object") || in SupportsVertexArrayObjects()
2736 functions->isAtLeastGL(gl::Version(3, 0)) || in SupportsVertexArrayObjects()
2737 functions->hasGLExtension("GL_ARB_vertex_array_object"); in SupportsVertexArrayObjects()
2740 bool CanUseDefaultVertexArrayObject(const FunctionsGL *functions) in CanUseDefaultVertexArrayObject() argument
2742 return (functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) == 0; in CanUseDefaultVertexArrayObject()
2745 bool SupportsCompute(const FunctionsGL *functions) in SupportsCompute() argument
2750 return (functions->isAtLeastGL(gl::Version(4, 3)) || in SupportsCompute()
2751 functions->isAtLeastGLES(gl::Version(3, 1)) || in SupportsCompute()
2752 (functions->isAtLeastGL(gl::Version(4, 2)) && in SupportsCompute()
2753 functions->hasGLExtension("GL_ARB_compute_shader") && in SupportsCompute()
2754 functions->hasGLExtension("GL_ARB_shader_storage_buffer_object"))); in SupportsCompute()
2757 bool SupportsFenceSync(const FunctionsGL *functions) in SupportsFenceSync() argument
2759 return functions->isAtLeastGL(gl::Version(3, 2)) || functions->hasGLExtension("GL_ARB_sync") || in SupportsFenceSync()
2760 functions->isAtLeastGLES(gl::Version(3, 0)); in SupportsFenceSync()
2763 bool SupportsOcclusionQueries(const FunctionsGL *functions) in SupportsOcclusionQueries() argument
2765 return functions->isAtLeastGL(gl::Version(1, 5)) || in SupportsOcclusionQueries()
2766 functions->hasGLExtension("GL_ARB_occlusion_query2") || in SupportsOcclusionQueries()
2767 functions->isAtLeastGLES(gl::Version(3, 0)) || in SupportsOcclusionQueries()
2768 functions->hasGLESExtension("GL_EXT_occlusion_query_boolean"); in SupportsOcclusionQueries()
2771 bool SupportsNativeRendering(const FunctionsGL *functions, in SupportsNativeRendering() argument
2777 bool hasInternalFormatQuery = functions->isAtLeastGL(gl::Version(4, 3)) || in SupportsNativeRendering()
2778 functions->hasGLExtension("GL_ARB_internalformat_query2"); in SupportsNativeRendering()
2788 functions->getInternalformativ(ToGLenum(type), internalFormat, GL_FRAMEBUFFER_RENDERABLE, 1, in SupportsNativeRendering()
2795 nativegl::GetInternalFormatInfo(internalFormat, functions->standard); in SupportsNativeRendering()
2796 return nativegl_gl::MeetsRequirements(functions, nativeInfo.textureAttachment); in SupportsNativeRendering()
2984 const FunctionsGL *functions = GetFunctionsGL(context); in ClearErrors() local
2985 ClearErrors(functions, file, function, line); in ClearErrors()
3004 const FunctionsGL *functions = GetFunctionsGL(context); in HandleError() local
3015 GLenum nextError = functions->getError(); in HandleError()
3019 nextError = functions->getError(); in HandleError()
3028 bool CanMapBufferForRead(const FunctionsGL *functions) in CanMapBufferForRead() argument
3030 return (functions->mapBufferRange != nullptr) || in CanMapBufferForRead()
3031 (functions->mapBuffer != nullptr && functions->standard == STANDARD_GL_DESKTOP); in CanMapBufferForRead()
3034 uint8_t *MapBufferRangeWithFallback(const FunctionsGL *functions, in MapBufferRangeWithFallback() argument
3040 if (functions->mapBufferRange != nullptr) in MapBufferRangeWithFallback()
3042 return static_cast<uint8_t *>(functions->mapBufferRange(target, offset, length, access)); in MapBufferRangeWithFallback()
3044 else if (functions->mapBuffer != nullptr && in MapBufferRangeWithFallback()
3045 (functions->standard == STANDARD_GL_DESKTOP || access == GL_MAP_WRITE_BIT)) in MapBufferRangeWithFallback()
3069 return static_cast<uint8_t *>(functions->mapBuffer(target, accessEnum)) + offset; in MapBufferRangeWithFallback()
3176 std::string GetRendererString(const FunctionsGL *functions) in GetRendererString() argument
3178 return GetString(functions, GL_RENDERER); in GetRendererString()
3181 std::string GetVendorString(const FunctionsGL *functions) in GetVendorString() argument
3183 return GetString(functions, GL_VENDOR); in GetVendorString()
3186 std::string GetVersionString(const FunctionsGL *functions) in GetVersionString() argument
3188 return GetString(functions, GL_VERSION); in GetVersionString()