Lines Matching full:functions
7 // renderergl_utils.cpp: Conversion functions and other utility routines
44 const char *GetString(const FunctionsGL *functions, GLenum name) in GetString() argument
46 return reinterpret_cast<const char *>(functions->getString(name)); in GetString()
49 bool IsMesa(const FunctionsGL *functions, std::array<int, 3> *version) in IsMesa() argument
53 if (functions->standard != STANDARD_GL_DESKTOP) in IsMesa()
58 std::string nativeVersionString(GetString(functions, GL_VERSION)); in IsMesa()
72 int getAdrenoNumber(const FunctionsGL *functions) in getAdrenoNumber() argument
77 const char *nativeGLRenderer = GetString(functions, GL_RENDERER); in getAdrenoNumber()
87 int getMaliTNumber(const FunctionsGL *functions) in getMaliTNumber() argument
92 const char *nativeGLRenderer = GetString(functions, GL_RENDERER); in getMaliTNumber()
101 int getMaliGNumber(const FunctionsGL *functions) in getMaliGNumber() argument
106 const char *nativeGLRenderer = GetString(functions, GL_RENDERER); in getMaliGNumber()
115 bool IsAdreno42xOr3xx(const FunctionsGL *functions) in IsAdreno42xOr3xx() argument
117 int number = getAdrenoNumber(functions); in IsAdreno42xOr3xx()
118 return number != 0 && getAdrenoNumber(functions) < 430; in IsAdreno42xOr3xx()
121 bool IsAdreno4xx(const FunctionsGL *functions) in IsAdreno4xx() argument
123 int number = getAdrenoNumber(functions); in IsAdreno4xx()
127 bool IsAdreno5xxOrOlder(const FunctionsGL *functions) in IsAdreno5xxOrOlder() argument
129 int number = getAdrenoNumber(functions); in IsAdreno5xxOrOlder()
133 bool IsAdreno5xx(const FunctionsGL *functions) in IsAdreno5xx() argument
135 int number = getAdrenoNumber(functions); in IsAdreno5xx()
139 bool IsMaliT8xxOrOlder(const FunctionsGL *functions) in IsMaliT8xxOrOlder() argument
141 int number = getMaliTNumber(functions); in IsMaliT8xxOrOlder()
145 bool IsMaliG31OrOlder(const FunctionsGL *functions) in IsMaliG31OrOlder() argument
147 int number = getMaliGNumber(functions); in IsMaliG31OrOlder()
151 bool IsMaliG72OrG76OrG51(const FunctionsGL *functions) in IsMaliG72OrG76OrG51() argument
153 int number = getMaliGNumber(functions); in IsMaliG72OrG76OrG51()
157 bool IsMaliValhall(const FunctionsGL *functions) in IsMaliValhall() argument
159 int number = getMaliGNumber(functions); in IsMaliValhall()
179 bool IsAndroidEmulator(const FunctionsGL *functions) in IsAndroidEmulator() argument
182 const char *nativeGLRenderer = GetString(functions, GL_RENDERER); in IsAndroidEmulator()
186 bool IsPowerVrRogue(const FunctionsGL *functions) in IsPowerVrRogue() argument
189 const char *nativeGLRenderer = GetString(functions, GL_RENDERER); in IsPowerVrRogue()
193 void ClearErrors(const FunctionsGL *functions, in ClearErrors() argument
198 GLenum error = functions->getError(); in ClearErrors()
203 error = functions->getError(); in ClearErrors()
207 #define ANGLE_GL_CLEAR_ERRORS() ClearErrors(functions, __FILE__, __FUNCTION__, __LINE__)
215 VendorID GetVendorID(const FunctionsGL *functions) in GetVendorID() argument
217 std::string nativeVendorString(GetString(functions, GL_VENDOR)); in GetVendorID()
221 nativeVendorString += GetString(functions, GL_RENDERER); in GetVendorID()
259 uint32_t GetDeviceID(const FunctionsGL *functions) in GetDeviceID() argument
261 std::string nativeRendererString(GetString(functions, GL_RENDERER)); in GetDeviceID()
279 ShShaderOutput GetShaderOutputType(const FunctionsGL *functions) in GetShaderOutputType() argument
281 ASSERT(functions); in GetShaderOutputType()
283 if (functions->standard == STANDARD_GL_DESKTOP) in GetShaderOutputType()
286 if (functions->isAtLeastGL(gl::Version(4, 5))) in GetShaderOutputType()
290 else if (functions->isAtLeastGL(gl::Version(4, 4))) in GetShaderOutputType()
294 else if (functions->isAtLeastGL(gl::Version(4, 3))) in GetShaderOutputType()
298 else if (functions->isAtLeastGL(gl::Version(4, 2))) in GetShaderOutputType()
302 else if (functions->isAtLeastGL(gl::Version(4, 1))) in GetShaderOutputType()
306 else if (functions->isAtLeastGL(gl::Version(4, 0))) in GetShaderOutputType()
310 else if (functions->isAtLeastGL(gl::Version(3, 3))) in GetShaderOutputType()
314 else if (functions->isAtLeastGL(gl::Version(3, 2))) in GetShaderOutputType()
318 else if (functions->isAtLeastGL(gl::Version(3, 1))) in GetShaderOutputType()
322 else if (functions->isAtLeastGL(gl::Version(3, 0))) in GetShaderOutputType()
331 else if (functions->standard == STANDARD_GL_ES) in GetShaderOutputType()
346 static bool MeetsRequirements(const FunctionsGL *functions, in MeetsRequirements() argument
355 if (!functions->hasExtension(extension)) in MeetsRequirements()
372 if (functions->version >= requirements.version) in MeetsRequirements()
380 if (!functions->hasExtension(extension)) in MeetsRequirements()
393 static bool CheckSizedInternalFormatTextureRenderability(const FunctionsGL *functions, in CheckSizedInternalFormatTextureRenderability() argument
402 functions->getIntegerv(GL_TEXTURE_BINDING_2D, &oldTextureBinding); in CheckSizedInternalFormatTextureRenderability()
406 functions->genTextures(1, &texture); in CheckSizedInternalFormatTextureRenderability()
407 functions->bindTexture(GL_TEXTURE_2D, texture); in CheckSizedInternalFormatTextureRenderability()
410 functions->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in CheckSizedInternalFormatTextureRenderability()
413 functions, features, formatInfo.internalFormat, formatInfo.format, formatInfo.type); in CheckSizedInternalFormatTextureRenderability()
415 functions->texImage2D(GL_TEXTURE_2D, 0, texImageFormat.internalFormat, kTextureSize, in CheckSizedInternalFormatTextureRenderability()
420 functions->getIntegerv(GL_FRAMEBUFFER_BINDING, &oldFramebufferBinding); in CheckSizedInternalFormatTextureRenderability()
424 functions->genFramebuffers(1, &fbo); in CheckSizedInternalFormatTextureRenderability()
425 functions->bindFramebuffer(GL_FRAMEBUFFER, fbo); in CheckSizedInternalFormatTextureRenderability()
426 functions->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, in CheckSizedInternalFormatTextureRenderability()
429 bool supported = functions->checkFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE; in CheckSizedInternalFormatTextureRenderability()
432 functions->deleteFramebuffers(1, &fbo); in CheckSizedInternalFormatTextureRenderability()
433 functions->bindFramebuffer(GL_FRAMEBUFFER, static_cast<GLuint>(oldFramebufferBinding)); in CheckSizedInternalFormatTextureRenderability()
436 functions->deleteTextures(1, &texture); in CheckSizedInternalFormatTextureRenderability()
437 functions->bindTexture(GL_TEXTURE_2D, static_cast<GLuint>(oldTextureBinding)); in CheckSizedInternalFormatTextureRenderability()
444 ASSERT(functions->getError() == GL_NO_ERROR); in CheckSizedInternalFormatTextureRenderability()
448 static bool CheckInternalFormatRenderbufferRenderability(const FunctionsGL *functions, in CheckInternalFormatRenderbufferRenderability() argument
457 functions->getIntegerv(GL_RENDERBUFFER_BINDING, &oldRenderbufferBinding); in CheckInternalFormatRenderbufferRenderability()
461 functions->genRenderbuffers(1, &renderbuffer); in CheckInternalFormatRenderbufferRenderability()
462 functions->bindRenderbuffer(GL_RENDERBUFFER, renderbuffer); in CheckInternalFormatRenderbufferRenderability()
465 nativegl::GetRenderbufferFormat(functions, features, formatInfo.internalFormat); in CheckInternalFormatRenderbufferRenderability()
467 functions->renderbufferStorage(GL_RENDERBUFFER, renderbufferFormat.internalFormat, in CheckInternalFormatRenderbufferRenderability()
472 functions->getIntegerv(GL_FRAMEBUFFER_BINDING, &oldFramebufferBinding); in CheckInternalFormatRenderbufferRenderability()
476 functions->genFramebuffers(1, &fbo); in CheckInternalFormatRenderbufferRenderability()
477 functions->bindFramebuffer(GL_FRAMEBUFFER, fbo); in CheckInternalFormatRenderbufferRenderability()
478 functions->framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, in CheckInternalFormatRenderbufferRenderability()
481 bool supported = functions->checkFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE; in CheckInternalFormatRenderbufferRenderability()
484 functions->deleteFramebuffers(1, &fbo); in CheckInternalFormatRenderbufferRenderability()
485 functions->bindFramebuffer(GL_FRAMEBUFFER, static_cast<GLuint>(oldFramebufferBinding)); in CheckInternalFormatRenderbufferRenderability()
488 functions->deleteRenderbuffers(1, &renderbuffer); in CheckInternalFormatRenderbufferRenderability()
489 functions->bindRenderbuffer(GL_RENDERBUFFER, static_cast<GLuint>(oldRenderbufferBinding)); in CheckInternalFormatRenderbufferRenderability()
496 ASSERT(functions->getError() == GL_NO_ERROR); in CheckInternalFormatRenderbufferRenderability()
508 static gl::TextureCaps GenerateTextureFormatCaps(const FunctionsGL *functions, in GenerateTextureFormatCaps() argument
513 ASSERT(functions->getError() == GL_NO_ERROR); in GenerateTextureFormatCaps()
518 nativegl::GetInternalFormatInfo(internalFormat, functions->standard); in GenerateTextureFormatCaps()
519 textureCaps.texturable = MeetsRequirements(functions, formatInfo.texture); in GenerateTextureFormatCaps()
521 textureCaps.texturable && MeetsRequirements(functions, formatInfo.filter); in GenerateTextureFormatCaps()
522 textureCaps.textureAttachment = MeetsRequirements(functions, formatInfo.textureAttachment); in GenerateTextureFormatCaps()
523 textureCaps.renderbuffer = MeetsRequirements(functions, formatInfo.renderbuffer); in GenerateTextureFormatCaps()
531 if (functions->isAtLeastGLES(gl::Version(3, 0)) && in GenerateTextureFormatCaps()
532 functions->hasGLESExtension("GL_EXT_color_buffer_half_float")) in GenerateTextureFormatCaps()
543 (functions->standard == STANDARD_GL_DESKTOP && in GenerateTextureFormatCaps()
551 CheckSizedInternalFormatTextureRenderability(functions, features, internalFormat); in GenerateTextureFormatCaps()
556 CheckInternalFormatRenderbufferRenderability(functions, features, internalFormat); in GenerateTextureFormatCaps()
562 if (textureCaps.renderbuffer && functions->getInternalformativ) in GenerateTextureFormatCaps()
577 functions->getInternalformativ(GL_RENDERBUFFER, queryInternalFormat, GL_NUM_SAMPLE_COUNTS, in GenerateTextureFormatCaps()
579 GLenum error = functions->getError(); in GenerateTextureFormatCaps()
590 functions->getInternalformativ(GL_RENDERBUFFER, queryInternalFormat, GL_SAMPLES, in GenerateTextureFormatCaps()
605 if (functions->getInternalformatSampleivNV) in GenerateTextureFormatCaps()
607 ASSERT(functions->getError() == GL_NO_ERROR); in GenerateTextureFormatCaps()
608 functions->getInternalformatSampleivNV(GL_RENDERBUFFER, queryInternalFormat, in GenerateTextureFormatCaps()
614 if (functions->getError() != GL_NO_ERROR) in GenerateTextureFormatCaps()
638 ASSERT(functions->getError() == GL_NO_ERROR); in GenerateTextureFormatCaps()
642 static GLint QuerySingleGLInt(const FunctionsGL *functions, GLenum name) in QuerySingleGLInt() argument
645 functions->getIntegerv(name, &result); in QuerySingleGLInt()
649 static GLint QuerySingleIndexGLInt(const FunctionsGL *functions, GLenum name, GLuint index) in QuerySingleIndexGLInt() argument
652 functions->getIntegeri_v(name, index, &result); in QuerySingleIndexGLInt()
656 static GLint QueryGLIntRange(const FunctionsGL *functions, GLenum name, size_t index) in QueryGLIntRange() argument
659 functions->getIntegerv(name, result); in QueryGLIntRange()
663 static GLint64 QuerySingleGLInt64(const FunctionsGL *functions, GLenum name) in QuerySingleGLInt64() argument
668 if (!functions->getInteger64v) in QuerySingleGLInt64()
671 functions->getIntegerv(name, &result); in QuerySingleGLInt64()
677 functions->getInteger64v(name, &result); in QuerySingleGLInt64()
682 static GLfloat QuerySingleGLFloat(const FunctionsGL *functions, GLenum name) in QuerySingleGLFloat() argument
685 functions->getFloatv(name, &result); in QuerySingleGLFloat()
689 static GLfloat QueryGLFloatRange(const FunctionsGL *functions, GLenum name, size_t index) in QueryGLFloatRange() argument
692 functions->getFloatv(name, result); in QueryGLFloatRange()
696 static gl::TypePrecision QueryTypePrecision(const FunctionsGL *functions, in QueryTypePrecision() argument
701 functions->getShaderPrecisionFormat(shaderType, precisionType, precision.range.data(), in QueryTypePrecision()
706 static GLint QueryQueryValue(const FunctionsGL *functions, GLenum target, GLenum name) in QueryQueryValue() argument
709 functions->getQueryiv(target, name, &result); in QueryQueryValue()
724 void GenerateCaps(const FunctionsGL *functions, in GenerateCaps() argument
742 GenerateTextureFormatCaps(functions, features, internalFormat, maxSupportedESVersion); in GenerateCaps()
747 if (functions->isAtLeastGL(gl::Version(4, 3)) || in GenerateCaps()
748 functions->hasGLExtension("GL_ARB_ES3_compatibility") || in GenerateCaps()
749 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
751 caps->maxElementIndex = QuerySingleGLInt64(functions, GL_MAX_ELEMENT_INDEX); in GenerateCaps()
773 if (functions->isAtLeastGL(gl::Version(1, 2)) || functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
774 functions->hasGLESExtension("GL_OES_texture_3D")) in GenerateCaps()
777 {QuerySingleGLInt(functions, GL_MAX_3D_TEXTURE_SIZE), max3dArrayTextureSizeLimit}); in GenerateCaps()
785 caps->max2DTextureSize = QuerySingleGLInt(functions, GL_MAX_TEXTURE_SIZE); // GL 1.0 / ES 2.0 in GenerateCaps()
787 QuerySingleGLInt(functions, GL_MAX_CUBE_MAP_TEXTURE_SIZE); // GL 1.3 / ES 2.0 in GenerateCaps()
789 if (functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
790 functions->hasGLExtension("GL_EXT_texture_array") || in GenerateCaps()
791 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
794 {QuerySingleGLInt(functions, GL_MAX_ARRAY_TEXTURE_LAYERS), max3dArrayTextureSizeLimit}); in GenerateCaps()
802 if (functions->isAtLeastGL(gl::Version(1, 5)) || in GenerateCaps()
803 functions->hasGLExtension("GL_EXT_texture_lod_bias") || in GenerateCaps()
804 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
806 caps->maxLODBias = QuerySingleGLFloat(functions, GL_MAX_TEXTURE_LOD_BIAS); in GenerateCaps()
813 if (functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
814 functions->hasGLExtension("GL_EXT_framebuffer_object") || in GenerateCaps()
815 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
817 caps->maxRenderbufferSize = QuerySingleGLInt(functions, GL_MAX_RENDERBUFFER_SIZE); in GenerateCaps()
818 caps->maxColorAttachments = QuerySingleGLInt(functions, GL_MAX_COLOR_ATTACHMENTS); in GenerateCaps()
820 else if (functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
822 caps->maxRenderbufferSize = QuerySingleGLInt(functions, GL_MAX_RENDERBUFFER_SIZE); in GenerateCaps()
831 if (functions->isAtLeastGL(gl::Version(2, 0)) || in GenerateCaps()
832 functions->hasGLExtension("ARB_draw_buffers") || in GenerateCaps()
833 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
834 functions->hasGLESExtension("GL_EXT_draw_buffers")) in GenerateCaps()
836 caps->maxDrawBuffers = QuerySingleGLInt(functions, GL_MAX_DRAW_BUFFERS); in GenerateCaps()
847 QueryGLIntRange(functions, GL_MAX_VIEWPORT_DIMS, 0); // GL 1.0 / ES 2.0 in GenerateCaps()
849 QueryGLIntRange(functions, GL_MAX_VIEWPORT_DIMS, 1); // GL 1.0 / ES 2.0 in GenerateCaps()
851 if (functions->standard == STANDARD_GL_DESKTOP && in GenerateCaps()
852 (functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0) in GenerateCaps()
857 std::max(1.0f, QueryGLFloatRange(functions, GL_POINT_SIZE_RANGE, 0)); in GenerateCaps()
858 caps->maxAliasedPointSize = QueryGLFloatRange(functions, GL_POINT_SIZE_RANGE, 1); in GenerateCaps()
863 std::max(1.0f, QueryGLFloatRange(functions, GL_ALIASED_POINT_SIZE_RANGE, 0)); in GenerateCaps()
864 caps->maxAliasedPointSize = QueryGLFloatRange(functions, GL_ALIASED_POINT_SIZE_RANGE, 1); in GenerateCaps()
868 QueryGLFloatRange(functions, GL_ALIASED_LINE_WIDTH_RANGE, 0); // GL 1.2 / ES 2.0 in GenerateCaps()
870 QueryGLFloatRange(functions, GL_ALIASED_LINE_WIDTH_RANGE, 1); // GL 1.2 / ES 2.0 in GenerateCaps()
873 if (functions->isAtLeastGL(gl::Version(1, 2)) || functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
875 caps->maxElementsIndices = QuerySingleGLInt(functions, GL_MAX_ELEMENTS_INDICES); in GenerateCaps()
876 caps->maxElementsVertices = QuerySingleGLInt(functions, GL_MAX_ELEMENTS_VERTICES); in GenerateCaps()
883 if (functions->isAtLeastGL(gl::Version(4, 1)) || in GenerateCaps()
884 functions->hasGLExtension("GL_ARB_get_program_binary") || in GenerateCaps()
885 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
886 functions->hasGLESExtension("GL_OES_get_program_binary")) in GenerateCaps()
890 GLint numBinaryFormats = QuerySingleGLInt(functions, GL_NUM_PROGRAM_BINARY_FORMATS_OES); in GenerateCaps()
903 if (functions->isAtLeastGL(gl::Version(4, 1)) || in GenerateCaps()
904 functions->hasGLExtension("GL_ARB_ES2_compatibility") || in GenerateCaps()
905 functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
907 caps->vertexHighpFloat = QueryTypePrecision(functions, GL_VERTEX_SHADER, GL_HIGH_FLOAT); in GenerateCaps()
908 caps->vertexMediumpFloat = QueryTypePrecision(functions, GL_VERTEX_SHADER, GL_MEDIUM_FLOAT); in GenerateCaps()
909 caps->vertexLowpFloat = QueryTypePrecision(functions, GL_VERTEX_SHADER, GL_LOW_FLOAT); in GenerateCaps()
910 caps->fragmentHighpFloat = QueryTypePrecision(functions, GL_FRAGMENT_SHADER, GL_HIGH_FLOAT); in GenerateCaps()
912 QueryTypePrecision(functions, GL_FRAGMENT_SHADER, GL_MEDIUM_FLOAT); in GenerateCaps()
913 caps->fragmentLowpFloat = QueryTypePrecision(functions, GL_FRAGMENT_SHADER, GL_LOW_FLOAT); in GenerateCaps()
914 caps->vertexHighpInt = QueryTypePrecision(functions, GL_VERTEX_SHADER, GL_HIGH_INT); in GenerateCaps()
915 caps->vertexMediumpInt = QueryTypePrecision(functions, GL_VERTEX_SHADER, GL_MEDIUM_INT); in GenerateCaps()
916 caps->vertexLowpInt = QueryTypePrecision(functions, GL_VERTEX_SHADER, GL_LOW_INT); in GenerateCaps()
917 caps->fragmentHighpInt = QueryTypePrecision(functions, GL_FRAGMENT_SHADER, GL_HIGH_INT); in GenerateCaps()
918 caps->fragmentMediumpInt = QueryTypePrecision(functions, GL_FRAGMENT_SHADER, GL_MEDIUM_INT); in GenerateCaps()
919 caps->fragmentLowpInt = QueryTypePrecision(functions, GL_FRAGMENT_SHADER, GL_LOW_INT); in GenerateCaps()
938 if (functions->isAtLeastGL(gl::Version(3, 2)) || functions->hasGLExtension("GL_ARB_sync") || in GenerateCaps()
939 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
943 std::max<GLint64>(QuerySingleGLInt64(functions, GL_MAX_SERVER_WAIT_TIMEOUT), 0); in GenerateCaps()
951 if (functions->isAtLeastGL(gl::Version(2, 0)) || functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
953 caps->maxVertexAttributes = QuerySingleGLInt(functions, GL_MAX_VERTEX_ATTRIBS); in GenerateCaps()
955 QuerySingleGLInt(functions, GL_MAX_VERTEX_UNIFORM_COMPONENTS); in GenerateCaps()
957 QuerySingleGLInt(functions, GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS); in GenerateCaps()
965 if (functions->isAtLeastGL(gl::Version(4, 1)) || in GenerateCaps()
966 functions->hasGLExtension("GL_ARB_ES2_compatibility") || in GenerateCaps()
967 functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
969 caps->maxVertexUniformVectors = QuerySingleGLInt(functions, GL_MAX_VERTEX_UNIFORM_VECTORS); in GenerateCaps()
971 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_UNIFORM_VECTORS); in GenerateCaps()
983 if (functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
986 QuerySingleGLInt(functions, GL_MAX_VERTEX_OUTPUT_COMPONENTS); in GenerateCaps()
996 if (functions->isAtLeastGL(gl::Version(2, 0)) || functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
999 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_UNIFORM_COMPONENTS); in GenerateCaps()
1001 QuerySingleGLInt(functions, GL_MAX_TEXTURE_IMAGE_UNITS); in GenerateCaps()
1009 if (functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1012 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_INPUT_COMPONENTS); in GenerateCaps()
1021 if (functions->isAtLeastGL(gl::Version(3, 0)) || functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1023 caps->minProgramTexelOffset = QuerySingleGLInt(functions, GL_MIN_PROGRAM_TEXEL_OFFSET); in GenerateCaps()
1024 caps->maxProgramTexelOffset = QuerySingleGLInt(functions, GL_MAX_PROGRAM_TEXEL_OFFSET); in GenerateCaps()
1033 if (functions->isAtLeastGL(gl::Version(3, 1)) || in GenerateCaps()
1034 functions->hasGLExtension("GL_ARB_uniform_buffer_object") || in GenerateCaps()
1035 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1038 QuerySingleGLInt(functions, GL_MAX_VERTEX_UNIFORM_BLOCKS); in GenerateCaps()
1040 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_UNIFORM_BLOCKS); in GenerateCaps()
1042 QuerySingleGLInt(functions, GL_MAX_UNIFORM_BUFFER_BINDINGS); in GenerateCaps()
1043 caps->maxUniformBlockSize = QuerySingleGLInt64(functions, GL_MAX_UNIFORM_BLOCK_SIZE); in GenerateCaps()
1045 QuerySingleGLInt(functions, GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT); in GenerateCaps()
1047 QuerySingleGLInt(functions, GL_MAX_COMBINED_UNIFORM_BLOCKS); in GenerateCaps()
1049 QuerySingleGLInt64(functions, GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS); in GenerateCaps()
1051 QuerySingleGLInt64(functions, GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS); in GenerateCaps()
1059 if (functions->isAtLeastGL(gl::Version(3, 2)) && in GenerateCaps()
1060 (functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0) in GenerateCaps()
1062 caps->maxVaryingComponents = QuerySingleGLInt(functions, GL_MAX_VERTEX_OUTPUT_COMPONENTS); in GenerateCaps()
1064 else if (functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1065 functions->hasGLExtension("GL_ARB_ES2_compatibility") || in GenerateCaps()
1066 functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
1068 caps->maxVaryingComponents = QuerySingleGLInt(functions, GL_MAX_VARYING_COMPONENTS); in GenerateCaps()
1070 else if (functions->isAtLeastGL(gl::Version(2, 0))) in GenerateCaps()
1072 caps->maxVaryingComponents = QuerySingleGLInt(functions, GL_MAX_VARYING_FLOATS); in GenerateCaps()
1080 if (functions->isAtLeastGL(gl::Version(4, 1)) || in GenerateCaps()
1081 functions->hasGLExtension("GL_ARB_ES2_compatibility") || in GenerateCaps()
1082 functions->isAtLeastGLES(gl::Version(2, 0))) in GenerateCaps()
1084 caps->maxVaryingVectors = QuerySingleGLInt(functions, GL_MAX_VARYING_VECTORS); in GenerateCaps()
1096 QuerySingleGLInt(functions, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS); in GenerateCaps()
1099 if (functions->isAtLeastGL(gl::Version(4, 0)) || in GenerateCaps()
1100 functions->hasGLExtension("GL_ARB_transform_feedback2") || in GenerateCaps()
1101 functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1104 QuerySingleGLInt(functions, GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS); in GenerateCaps()
1106 QuerySingleGLInt(functions, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS); in GenerateCaps()
1108 QuerySingleGLInt(functions, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS); in GenerateCaps()
1123 if (functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1124 functions->hasGLExtension("GL_EXT_framebuffer_multisample") || in GenerateCaps()
1125 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1126 functions->hasGLESExtension("GL_EXT_multisampled_render_to_texture")) in GenerateCaps()
1128 caps->maxSamples = std::min(QuerySingleGLInt(functions, GL_MAX_SAMPLES), sampleCountLimit); in GenerateCaps()
1142 if (!functions->isAtLeastGL(gl::Version(3, 3)) && in GenerateCaps()
1143 !functions->hasGLExtension("GL_ARB_sampler_objects") && in GenerateCaps()
1144 !functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1151 if (!functions->isAtLeastGL(gl::Version(3, 3)) && in GenerateCaps()
1152 !functions->hasGLExtension("GL_ARB_texture_swizzle") && in GenerateCaps()
1153 !functions->hasGLExtension("GL_EXT_texture_swizzle") && in GenerateCaps()
1154 !functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1160 if (functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) in GenerateCaps()
1168 if (!functions->isAtLeastGL(gl::Version(4, 2)) && in GenerateCaps()
1169 !(functions->isAtLeastGL(gl::Version(3, 2)) && in GenerateCaps()
1170 functions->hasGLExtension("GL_ARB_shader_bit_encoding")) && in GenerateCaps()
1171 !functions->hasGLExtension("GL_ARB_shading_language_packing") && in GenerateCaps()
1172 !functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1179 if (!functions->isAtLeastGL(gl::Version(3, 3)) && in GenerateCaps()
1180 !functions->hasGLExtension("GL_ARB_explicit_attrib_location") && in GenerateCaps()
1181 !functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1186 if (!functions->isAtLeastGL(gl::Version(4, 3)) && in GenerateCaps()
1187 !functions->hasGLExtension("GL_ARB_stencil_texturing") && in GenerateCaps()
1188 !functions->isAtLeastGLES(gl::Version(3, 1))) in GenerateCaps()
1193 if (functions->isAtLeastGL(gl::Version(4, 3)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1194 functions->hasGLExtension("GL_ARB_framebuffer_no_attachments")) in GenerateCaps()
1196 caps->maxFramebufferWidth = QuerySingleGLInt(functions, GL_MAX_FRAMEBUFFER_WIDTH); in GenerateCaps()
1197 caps->maxFramebufferHeight = QuerySingleGLInt(functions, GL_MAX_FRAMEBUFFER_HEIGHT); in GenerateCaps()
1199 std::min(QuerySingleGLInt(functions, GL_MAX_FRAMEBUFFER_SAMPLES), sampleCountLimit); in GenerateCaps()
1206 if (functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1207 functions->hasGLExtension("GL_ARB_texture_multisample")) in GenerateCaps()
1209 caps->maxSampleMaskWords = QuerySingleGLInt(functions, GL_MAX_SAMPLE_MASK_WORDS); in GenerateCaps()
1211 std::min(QuerySingleGLInt(functions, GL_MAX_COLOR_TEXTURE_SAMPLES), sampleCountLimit); in GenerateCaps()
1213 std::min(QuerySingleGLInt(functions, GL_MAX_DEPTH_TEXTURE_SAMPLES), sampleCountLimit); in GenerateCaps()
1215 std::min(QuerySingleGLInt(functions, GL_MAX_INTEGER_SAMPLES), sampleCountLimit); in GenerateCaps()
1222 if (functions->isAtLeastGL(gl::Version(4, 3)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1223 functions->hasGLExtension("GL_ARB_vertex_attrib_binding")) in GenerateCaps()
1226 QuerySingleGLInt(functions, GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET); in GenerateCaps()
1227 caps->maxVertexAttribBindings = QuerySingleGLInt(functions, GL_MAX_VERTEX_ATTRIB_BINDINGS); in GenerateCaps()
1232 (functions->standard == STANDARD_GL_DESKTOP && functions->version == gl::Version(4, 3))) in GenerateCaps()
1238 caps->maxVertexAttribStride = QuerySingleGLInt(functions, GL_MAX_VERTEX_ATTRIB_STRIDE); in GenerateCaps()
1246 if (functions->isAtLeastGL(gl::Version(4, 3)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1247 functions->hasGLExtension("GL_ARB_shader_storage_buffer_object")) in GenerateCaps()
1250 QuerySingleGLInt(functions, GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES); in GenerateCaps()
1252 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS); in GenerateCaps()
1254 QuerySingleGLInt(functions, GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS); in GenerateCaps()
1256 QuerySingleGLInt(functions, GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS); in GenerateCaps()
1258 QuerySingleGLInt64(functions, GL_MAX_SHADER_STORAGE_BLOCK_SIZE); in GenerateCaps()
1260 QuerySingleGLInt(functions, GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS); in GenerateCaps()
1262 QuerySingleGLInt(functions, GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT); in GenerateCaps()
1269 if (nativegl::SupportsCompute(functions)) in GenerateCaps()
1274 QuerySingleIndexGLInt(functions, GL_MAX_COMPUTE_WORK_GROUP_COUNT, index); in GenerateCaps()
1277 QuerySingleIndexGLInt(functions, GL_MAX_COMPUTE_WORK_GROUP_SIZE, index); in GenerateCaps()
1280 QuerySingleGLInt(functions, GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS); in GenerateCaps()
1282 QuerySingleGLInt(functions, GL_MAX_COMPUTE_UNIFORM_BLOCKS); in GenerateCaps()
1284 QuerySingleGLInt(functions, GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS); in GenerateCaps()
1286 QuerySingleGLInt(functions, GL_MAX_COMPUTE_SHARED_MEMORY_SIZE); in GenerateCaps()
1288 QuerySingleGLInt(functions, GL_MAX_COMPUTE_UNIFORM_COMPONENTS); in GenerateCaps()
1290 QuerySingleGLInt(functions, GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS); in GenerateCaps()
1292 QuerySingleGLInt(functions, GL_MAX_COMPUTE_ATOMIC_COUNTERS); in GenerateCaps()
1294 QuerySingleGLInt(functions, GL_MAX_COMPUTE_IMAGE_UNIFORMS); in GenerateCaps()
1296 QuerySingleGLInt(functions, GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS); in GenerateCaps()
1298 QuerySingleGLInt(functions, GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS); in GenerateCaps()
1305 if (functions->isAtLeastGL(gl::Version(4, 3)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1306 functions->hasGLExtension("GL_ARB_explicit_uniform_location")) in GenerateCaps()
1308 caps->maxUniformLocations = QuerySingleGLInt(functions, GL_MAX_UNIFORM_LOCATIONS); in GenerateCaps()
1315 if (functions->isAtLeastGL(gl::Version(4, 0)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1316 functions->hasGLExtension("GL_ARB_texture_gather")) in GenerateCaps()
1319 QuerySingleGLInt(functions, GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET); in GenerateCaps()
1321 QuerySingleGLInt(functions, GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET); in GenerateCaps()
1328 if (functions->isAtLeastGL(gl::Version(4, 2)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1329 functions->hasGLExtension("GL_ARB_shader_image_load_store")) in GenerateCaps()
1332 QuerySingleGLInt(functions, GL_MAX_VERTEX_IMAGE_UNIFORMS); in GenerateCaps()
1334 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_IMAGE_UNIFORMS); in GenerateCaps()
1335 caps->maxImageUnits = QuerySingleGLInt(functions, GL_MAX_IMAGE_UNITS); in GenerateCaps()
1337 QuerySingleGLInt(functions, GL_MAX_COMBINED_IMAGE_UNIFORMS); in GenerateCaps()
1344 if (functions->isAtLeastGL(gl::Version(4, 2)) || functions->isAtLeastGLES(gl::Version(3, 1)) || in GenerateCaps()
1345 functions->hasGLExtension("GL_ARB_shader_atomic_counters")) in GenerateCaps()
1348 QuerySingleGLInt(functions, GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS); in GenerateCaps()
1350 QuerySingleGLInt(functions, GL_MAX_VERTEX_ATOMIC_COUNTERS); in GenerateCaps()
1352 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS); in GenerateCaps()
1354 QuerySingleGLInt(functions, GL_MAX_FRAGMENT_ATOMIC_COUNTERS); in GenerateCaps()
1356 QuerySingleGLInt(functions, GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS); in GenerateCaps()
1358 QuerySingleGLInt(functions, GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE); in GenerateCaps()
1360 QuerySingleGLInt(functions, GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS); in GenerateCaps()
1362 QuerySingleGLInt(functions, GL_MAX_COMBINED_ATOMIC_COUNTERS); in GenerateCaps()
1384 if (!CanMapBufferForRead(functions)) in GenerateCaps()
1390 if (functions->isAtLeastGL(gl::Version(4, 0)) || in GenerateCaps()
1391 functions->hasGLESExtension("GL_OES_texture_cube_map_array") || in GenerateCaps()
1392 functions->hasGLESExtension("GL_EXT_texture_cube_map_array") || in GenerateCaps()
1393 functions->hasGLExtension("GL_ARB_texture_cube_map_array") || in GenerateCaps()
1394 functions->isAtLeastGLES(gl::Version(3, 2))) in GenerateCaps()
1405 if (!nativegl::SupportsVertexArrayObjects(functions) || in GenerateCaps()
1419 (features.allowAstcFormats.enabled || functions->standard == STANDARD_GL_ES); in GenerateCaps()
1422 functions->hasExtension("GL_KHR_texture_compression_astc_hdr"); in GenerateCaps()
1425 functions->hasExtension("GL_KHR_texture_compression_astc_sliced_3d")) || in GenerateCaps()
1427 extensions->elementIndexUintOES = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1428 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1429 functions->hasGLESExtension("GL_OES_element_index_uint"); in GenerateCaps()
1431 extensions->readFormatBgraEXT = functions->isAtLeastGL(gl::Version(1, 2)) || in GenerateCaps()
1432 functions->hasGLExtension("GL_EXT_bgra") || in GenerateCaps()
1433 functions->hasGLESExtension("GL_EXT_read_format_bgra"); in GenerateCaps()
1434 extensions->pixelBufferObjectNV = functions->isAtLeastGL(gl::Version(2, 1)) || in GenerateCaps()
1435 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1436 functions->hasGLExtension("GL_ARB_pixel_buffer_object") || in GenerateCaps()
1437 functions->hasGLExtension("GL_EXT_pixel_buffer_object") || in GenerateCaps()
1438 functions->hasGLESExtension("GL_NV_pixel_buffer_object"); in GenerateCaps()
1439 extensions->syncARB = nativegl::SupportsFenceSync(functions); in GenerateCaps()
1440 extensions->mapbufferOES = functions->isAtLeastGL(gl::Version(1, 5)) || in GenerateCaps()
1441 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1442 functions->hasGLESExtension("GL_OES_mapbuffer"); in GenerateCaps()
1443 extensions->mapBufferRangeEXT = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1444 functions->hasGLExtension("GL_ARB_map_buffer_range") || in GenerateCaps()
1445 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1446 functions->hasGLESExtension("GL_EXT_map_buffer_range"); in GenerateCaps()
1447 extensions->textureNpotOES = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1448 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1449 functions->hasGLESExtension("GL_OES_texture_npot"); in GenerateCaps()
1451 extensions->drawBuffersEXT = functions->isAtLeastGL(gl::Version(2, 0)) || in GenerateCaps()
1452 functions->hasGLExtension("ARB_draw_buffers") || in GenerateCaps()
1453 functions->hasGLESExtension("GL_EXT_draw_buffers"); in GenerateCaps()
1456 (functions->isAtLeastGL(gl::Version(4, 0)) || in GenerateCaps()
1457 (functions->hasGLExtension("GL_EXT_draw_buffers2") && in GenerateCaps()
1458 functions->hasGLExtension("GL_ARB_draw_buffers_blend")) || in GenerateCaps()
1459 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1460 functions->hasGLESExtension("GL_OES_draw_buffers_indexed") || in GenerateCaps()
1461 functions->hasGLESExtension("GL_EXT_draw_buffers_indexed")); in GenerateCaps()
1463 extensions->textureStorageEXT = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1464 functions->hasGLESExtension("GL_EXT_texture_storage"); in GenerateCaps()
1466 functions->hasGLExtension("GL_EXT_texture_filter_anisotropic") || in GenerateCaps()
1467 functions->hasGLESExtension("GL_EXT_texture_filter_anisotropic"); in GenerateCaps()
1468 extensions->occlusionQueryBooleanEXT = nativegl::SupportsOcclusionQueries(functions); in GenerateCaps()
1471 ? QuerySingleGLFloat(functions, GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT) in GenerateCaps()
1473 extensions->fenceNV = FenceNVGL::Supported(functions) || FenceNVSyncGL::Supported(functions); in GenerateCaps()
1474 extensions->blendMinmaxEXT = functions->isAtLeastGL(gl::Version(1, 5)) || in GenerateCaps()
1475 functions->hasGLExtension("GL_EXT_blend_minmax") || in GenerateCaps()
1476 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1477 functions->hasGLESExtension("GL_EXT_blend_minmax"); in GenerateCaps()
1478 extensions->framebufferBlitNV = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1479 functions->hasGLExtension("GL_EXT_framebuffer_blit") || in GenerateCaps()
1480 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1481 functions->hasGLESExtension("GL_NV_framebuffer_blit"); in GenerateCaps()
1483 extensions->framebufferBlitNV || functions->hasGLESExtension("GL_ANGLE_framebuffer_blit"); in GenerateCaps()
1488 (functions->hasGLESExtension("GL_EXT_multisampled_render_to_texture") || in GenerateCaps()
1489 functions->hasGLESExtension("GL_IMG_multisampled_render_to_texture")); in GenerateCaps()
1493 functions->hasGLESExtension("GL_EXT_multisampled_render_to_texture2"); in GenerateCaps()
1494 extensions->standardDerivativesOES = functions->isAtLeastGL(gl::Version(2, 0)) || in GenerateCaps()
1495 functions->hasGLExtension("GL_ARB_fragment_shader") || in GenerateCaps()
1496 functions->hasGLESExtension("GL_OES_standard_derivatives"); in GenerateCaps()
1497 extensions->shaderTextureLodEXT = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1498 functions->hasGLExtension("GL_ARB_shader_texture_lod") || in GenerateCaps()
1499 functions->hasGLESExtension("GL_EXT_shader_texture_lod"); in GenerateCaps()
1500 extensions->fragDepthEXT = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1501 functions->hasGLESExtension("GL_EXT_frag_depth"); in GenerateCaps()
1502 extensions->conservativeDepthEXT = functions->isAtLeastGL(gl::Version(4, 2)) || in GenerateCaps()
1503 functions->hasGLExtension("GL_ARB_conservative_depth") || in GenerateCaps()
1504 functions->hasGLESExtension("GL_EXT_conservative_depth"); in GenerateCaps()
1505 extensions->depthClampEXT = functions->isAtLeastGL(gl::Version(3, 2)) || in GenerateCaps()
1506 functions->hasGLExtension("GL_ARB_depth_clamp") || in GenerateCaps()
1507 functions->hasGLESExtension("GL_EXT_depth_clamp"); in GenerateCaps()
1508 extensions->polygonOffsetClampEXT = functions->hasExtension("GL_EXT_polygon_offset_clamp"); in GenerateCaps()
1511 extensions->polygonModeNV = functions->standard == STANDARD_GL_DESKTOP; in GenerateCaps()
1518 extensions->sampleVariablesOES = functions->isAtLeastGL(gl::Version(4, 2)) || in GenerateCaps()
1519 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1520 functions->hasGLESExtension("GL_OES_sample_variables"); in GenerateCaps()
1523 functions->isAtLeastGL(gl::Version(4, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1524 (functions->isAtLeastGLES(gl::Version(3, 1)) && in GenerateCaps()
1525 functions->hasGLESExtension("GL_OES_shader_multisample_interpolation")); in GenerateCaps()
1529 QuerySingleGLFloat(functions, GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES); in GenerateCaps()
1531 QuerySingleGLFloat(functions, GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES); in GenerateCaps()
1533 QuerySingleGLInt(functions, GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES); in GenerateCaps()
1540 if (functions->hasGLExtension("GL_ARB_shader_viewport_layer_array") || in GenerateCaps()
1541 functions->hasGLExtension("GL_NV_viewport_array2")) in GenerateCaps()
1546 const int maxLayers = QuerySingleGLInt(functions, GL_MAX_ARRAY_TEXTURE_LAYERS); in GenerateCaps()
1548 const int maxViewports = QuerySingleGLInt(functions, GL_MAX_VIEWPORTS); in GenerateCaps()
1553 extensions->fboRenderMipmapOES = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1554 functions->hasGLExtension("GL_EXT_framebuffer_object") || in GenerateCaps()
1555 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1556 functions->hasGLESExtension("GL_OES_fbo_render_mipmap"); in GenerateCaps()
1560 (functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1561 functions->hasGLESExtension("GL_EXT_texture_border_clamp") || in GenerateCaps()
1562 functions->hasGLESExtension("GL_OES_texture_border_clamp") || in GenerateCaps()
1563 functions->hasGLESExtension("GL_NV_texture_border_clamp")); in GenerateCaps()
1569 IsMac() || functions->isAtLeastGL(gl::Version(4, 4)) || in GenerateCaps()
1570 functions->hasGLExtension("GL_ARB_texture_mirror_clamp_to_edge") || in GenerateCaps()
1571 functions->hasGLExtension("GL_EXT_texture_mirror_clamp") || in GenerateCaps()
1572 functions->hasGLExtension("GL_ATI_texture_mirror_once") || in GenerateCaps()
1573 functions->hasGLESExtension("GL_EXT_texture_mirror_clamp_to_edge"); in GenerateCaps()
1576 extensions->instancedArraysANGLE = functions->isAtLeastGL(gl::Version(3, 1)) || in GenerateCaps()
1577 (functions->hasGLExtension("GL_ARB_instanced_arrays") && in GenerateCaps()
1578 (functions->hasGLExtension("GL_ARB_draw_instanced") || in GenerateCaps()
1579 functions->hasGLExtension("GL_EXT_draw_instanced"))) || in GenerateCaps()
1580 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1581 functions->hasGLESExtension("GL_EXT_instanced_arrays"); in GenerateCaps()
1583 extensions->unpackSubimageEXT = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1584 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1585 functions->hasGLESExtension("GL_EXT_unpack_subimage"); in GenerateCaps()
1588 functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1589 (functions->isAtLeastGLES(gl::Version(3, 1)) && in GenerateCaps()
1590 functions->hasGLESExtension("GL_NV_shader_noperspective_interpolation")); in GenerateCaps()
1591 extensions->packSubimageNV = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1592 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1593 functions->hasGLESExtension("GL_NV_pack_subimage"); in GenerateCaps()
1594 extensions->vertexArrayObjectOES = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1595 functions->hasGLExtension("GL_ARB_vertex_array_object") || in GenerateCaps()
1596 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1597 functions->hasGLESExtension("GL_OES_vertex_array_object"); in GenerateCaps()
1598 extensions->debugMarkerEXT = functions->isAtLeastGL(gl::Version(4, 3)) || in GenerateCaps()
1599 functions->hasGLExtension("GL_KHR_debug") || in GenerateCaps()
1600 functions->hasGLExtension("GL_EXT_debug_marker") || in GenerateCaps()
1601 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1602 functions->hasGLESExtension("GL_KHR_debug") || in GenerateCaps()
1603 functions->hasGLESExtension("GL_EXT_debug_marker"); in GenerateCaps()
1604 extensions->EGLImageOES = functions->hasGLESExtension("GL_OES_EGL_image"); in GenerateCaps()
1605 extensions->EGLImageExternalOES = functions->hasGLESExtension("GL_OES_EGL_image_external"); in GenerateCaps()
1607 functions->hasExtension("GL_EXT_EGL_image_external_wrap_modes"); in GenerateCaps()
1609 functions->hasGLESExtension("GL_OES_EGL_image_external_essl3"); in GenerateCaps()
1610 extensions->EGLImageArrayEXT = functions->hasGLESExtension("GL_EXT_EGL_image_array"); in GenerateCaps()
1612 extensions->EGLSyncOES = functions->hasGLESExtension("GL_OES_EGL_sync"); in GenerateCaps()
1615 (functions->isAtLeastGL(gl::Version(3, 3)) || in GenerateCaps()
1616 functions->hasGLExtension("GL_ARB_timer_query") || in GenerateCaps()
1617 functions->hasGLESExtension("GL_EXT_disjoint_timer_query"))) in GenerateCaps()
1625 QueryQueryValue(functions, GL_TIME_ELAPSED, GL_QUERY_COUNTER_BITS); in GenerateCaps()
1627 QueryQueryValue(functions, GL_TIMESTAMP, GL_QUERY_COUNTER_BITS); in GenerateCaps()
1635 functions->isAtLeastGL(gl::Version(1, 3)) || in GenerateCaps()
1636 functions->hasGLESExtension("GL_EXT_multisample_compatibility"); in GenerateCaps()
1639 functions->hasGLExtension("GL_NV_framebuffer_mixed_samples") || in GenerateCaps()
1640 functions->hasGLESExtension("GL_NV_framebuffer_mixed_samples"); in GenerateCaps()
1642 extensions->robustnessEXT = functions->isAtLeastGL(gl::Version(4, 5)) || in GenerateCaps()
1643 functions->hasGLExtension("GL_KHR_robustness") || in GenerateCaps()
1644 functions->hasGLExtension("GL_ARB_robustness") || in GenerateCaps()
1645 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1646 functions->hasGLESExtension("GL_KHR_robustness") || in GenerateCaps()
1647 functions->hasGLESExtension("GL_EXT_robustness"); in GenerateCaps()
1651 (functions->hasGLExtension("GL_ARB_robust_buffer_access_behavior") || in GenerateCaps()
1652 functions->hasGLESExtension("GL_KHR_robust_buffer_access_behavior")); in GenerateCaps()
1654 extensions->stencilTexturingANGLE = functions->isAtLeastGL(gl::Version(4, 3)) || in GenerateCaps()
1655 functions->hasGLExtension("GL_ARB_stencil_texturing") || in GenerateCaps()
1656 functions->isAtLeastGLES(gl::Version(3, 1)); in GenerateCaps()
1660 functions->isAtLeastGLES(gl::Version(3, 1))) in GenerateCaps()
1669 QuerySingleGLInt(functions, GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT); in GenerateCaps()
1689 if (functions->isAtLeastGL(gl::Version(4, 2)) || in GenerateCaps()
1690 functions->hasGLExtension("GL_ARB_shader_image_load_store")) in GenerateCaps()
1698 else if (functions->isAtLeastGLES(gl::Version(3, 1))) in GenerateCaps()
1737 functions->standard != StandardGL::STANDARD_GL_ES; in GenerateCaps()
1750 functions->standard != StandardGL::STANDARD_GL_ES; in GenerateCaps()
1769 extensions->syncQueryCHROMIUM = SyncQueryGL::IsSupported(functions); in GenerateCaps()
1774 functions->isAtLeastGL(gl::Version(4, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)); in GenerateCaps()
1779 extensions->textureMultisampleANGLE = functions->isAtLeastGL(gl::Version(3, 2)) || in GenerateCaps()
1780 functions->hasGLExtension("GL_ARB_texture_multisample"); in GenerateCaps()
1782 extensions->textureSRGBDecodeEXT = functions->hasGLExtension("GL_EXT_texture_sRGB_decode") || in GenerateCaps()
1783 functions->hasGLESExtension("GL_EXT_texture_sRGB_decode"); in GenerateCaps()
1788 extensions->compressedETC2RGB8TextureOES || functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1789 functions->hasGLESExtension("GL_EXT_compressed_ETC1_RGB8_sub_texture"); in GenerateCaps()
1792 VendorID vendor = GetVendorID(functions); in GenerateCaps()
1802 extensions->sRGBWriteControlEXT = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
1803 functions->hasGLExtension("GL_EXT_framebuffer_sRGB") || in GenerateCaps()
1804 functions->hasGLExtension("GL_ARB_framebuffer_sRGB") || in GenerateCaps()
1805 functions->hasGLESExtension("GL_EXT_sRGB_write_control"); in GenerateCaps()
1820 extensions->discardFramebufferEXT = functions->isAtLeastGL(gl::Version(4, 3)) || in GenerateCaps()
1821 functions->hasGLExtension("GL_ARB_invalidate_subdata") || in GenerateCaps()
1822 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1823 functions->hasGLESExtension("GL_EXT_discard_framebuffer") || in GenerateCaps()
1824 functions->hasGLESExtension("GL_ARB_invalidate_subdata"); in GenerateCaps()
1828 if (functions->isAtLeastGL(gl::Version(3, 1)) || in GenerateCaps()
1829 functions->hasGLExtension("GL_ARB_texture_rectangle")) in GenerateCaps()
1833 QuerySingleGLInt(functions, GL_MAX_RECTANGLE_TEXTURE_SIZE_ANGLE); in GenerateCaps()
1839 functions->isAtLeastGL(gl::Version(4, 3)) || functions->isAtLeastGLES(gl::Version(3, 2)); in GenerateCaps()
1844 bool hasInstancedGSSupport = functions->isAtLeastGL(gl::Version(4, 0)) && in GenerateCaps()
1845 functions->hasGLExtension("GL_ARB_shader_atomic_counters") && in GenerateCaps()
1846 functions->hasGLExtension("GL_ARB_shader_storage_buffer_object") && in GenerateCaps()
1847 functions->hasGLExtension("GL_ARB_shader_image_load_store"); in GenerateCaps()
1848 if (hasCoreGSSupport || functions->hasGLESExtension("GL_OES_geometry_shader") || in GenerateCaps()
1849 functions->hasGLESExtension("GL_EXT_geometry_shader") || hasInstancedGSSupport) in GenerateCaps()
1851 extensions->geometryShaderEXT = functions->hasGLESExtension("GL_EXT_geometry_shader") || in GenerateCaps()
1853 extensions->geometryShaderOES = functions->hasGLESExtension("GL_OES_geometry_shader") || in GenerateCaps()
1856 caps->maxFramebufferLayers = QuerySingleGLInt(functions, GL_MAX_FRAMEBUFFER_LAYERS_EXT); in GenerateCaps()
1867 caps->layerProvokingVertex = QuerySingleGLInt(functions, GL_LAYER_PROVOKING_VERTEX_EXT); in GenerateCaps()
1878 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT); in GenerateCaps()
1880 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT); in GenerateCaps()
1882 QuerySingleGLInt(functions, GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT); in GenerateCaps()
1884 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT); in GenerateCaps()
1886 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT); in GenerateCaps()
1888 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT); in GenerateCaps()
1890 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT); in GenerateCaps()
1892 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT); in GenerateCaps()
1894 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT); in GenerateCaps()
1896 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT); in GenerateCaps()
1898 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT); in GenerateCaps()
1900 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT); in GenerateCaps()
1902 QuerySingleGLInt(functions, GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT); in GenerateCaps()
1920 (functions->isAtLeastGL(gl::Version(3, 3)) || in GenerateCaps()
1921 functions->hasGLESExtension("GL_EXT_blend_func_extended")); in GenerateCaps()
1932 extensions->floatBlendEXT = functions->standard == STANDARD_GL_DESKTOP || in GenerateCaps()
1933 functions->hasGLESExtension("GL_EXT_float_blend") || in GenerateCaps()
1934 functions->isAtLeastGLES(gl::Version(3, 2)); in GenerateCaps()
1939 (functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1940 functions->hasGLESExtension("GL_OES_draw_elements_base_vertex") || in GenerateCaps()
1941 functions->hasGLESExtension("GL_EXT_draw_elements_base_vertex")); in GenerateCaps()
1946 (functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1947 functions->hasGLESExtension("GL_OES_draw_elements_base_vertex") || in GenerateCaps()
1948 functions->hasGLESExtension("GL_EXT_draw_elements_base_vertex") || in GenerateCaps()
1949 functions->hasGLESExtension("GL_EXT_base_instance")); in GenerateCaps()
1956 functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1957 functions->hasGLESExtension("GL_OES_draw_elements_base_vertex"); in GenerateCaps()
1961 functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
1962 functions->hasGLESExtension("GL_EXT_draw_elements_base_vertex"); in GenerateCaps()
1968 (features.allowETCFormats.enabled || functions->standard == STANDARD_GL_ES) && in GenerateCaps()
1974 !features.allowETCFormats.enabled && functions->standard == STANDARD_GL_DESKTOP; in GenerateCaps()
1979 !functions->isAtLeastGLES(gl::Version(3, 0))) in GenerateCaps()
1984 extensions->provokingVertexANGLE = functions->hasGLExtension("GL_ARB_provoking_vertex") || in GenerateCaps()
1985 functions->hasGLExtension("GL_EXT_provoking_vertex") || in GenerateCaps()
1986 functions->isAtLeastGL(gl::Version(3, 2)); in GenerateCaps()
1989 extensions->texture3DOES = functions->isAtLeastGL(gl::Version(1, 2)) || in GenerateCaps()
1990 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
1991 functions->hasGLESExtension("GL_OES_texture_3D"); in GenerateCaps()
1993 extensions->memoryObjectEXT = functions->hasGLExtension("GL_EXT_memory_object") || in GenerateCaps()
1994 functions->hasGLESExtension("GL_EXT_memory_object"); in GenerateCaps()
1995 extensions->semaphoreEXT = functions->hasGLExtension("GL_EXT_semaphore") || in GenerateCaps()
1996 functions->hasGLESExtension("GL_EXT_semaphore"); in GenerateCaps()
1997 extensions->memoryObjectFdEXT = functions->hasGLExtension("GL_EXT_memory_object_fd") || in GenerateCaps()
1998 functions->hasGLESExtension("GL_EXT_memory_object_fd"); in GenerateCaps()
2000 (functions->hasGLExtension("GL_EXT_semaphore_fd") || in GenerateCaps()
2001 functions->hasGLESExtension("GL_EXT_semaphore_fd")); in GenerateCaps()
2002 extensions->gpuShader5EXT = functions->isAtLeastGL(gl::Version(4, 0)) || in GenerateCaps()
2003 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
2004 functions->hasGLExtension("GL_ARB_gpu_shader5") || in GenerateCaps()
2005 functions->hasGLESExtension("GL_EXT_gpu_shader5"); in GenerateCaps()
2006 extensions->shaderIoBlocksOES = functions->isAtLeastGL(gl::Version(3, 2)) || in GenerateCaps()
2007 functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
2008 functions->hasGLESExtension("GL_OES_shader_io_blocks") || in GenerateCaps()
2009 functions->hasGLESExtension("GL_EXT_shader_io_blocks"); in GenerateCaps()
2012 extensions->shadowSamplersEXT = functions->isAtLeastGL(gl::Version(2, 0)) || in GenerateCaps()
2013 functions->isAtLeastGLES(gl::Version(3, 0)) || in GenerateCaps()
2014 functions->hasGLESExtension("GL_EXT_shadow_samplers"); in GenerateCaps()
2018 extensions->clipControlEXT = functions->isAtLeastGL(gl::Version(4, 5)) || in GenerateCaps()
2019 functions->hasGLExtension("GL_ARB_clip_control") || in GenerateCaps()
2020 functions->hasGLESExtension("GL_EXT_clip_control"); in GenerateCaps()
2029 extensions->clipDistanceAPPLE = functions->isAtLeastGL(gl::Version(3, 0)) || in GenerateCaps()
2030 functions->hasGLESExtension("GL_APPLE_clip_distance"); in GenerateCaps()
2033 caps->maxClipDistances = QuerySingleGLInt(functions, GL_MAX_CLIP_DISTANCES_APPLE); in GenerateCaps()
2046 functions->isAtLeastGL(gl::Version(4, 5)) || in GenerateCaps()
2047 (functions->isAtLeastGL(gl::Version(3, 0)) && in GenerateCaps()
2048 functions->hasGLExtension("GL_ARB_cull_distance")) || in GenerateCaps()
2049 (extensions->shaderIoBlocksEXT && functions->hasGLESExtension("GL_EXT_clip_cull_distance")); in GenerateCaps()
2052 caps->maxClipDistances = QuerySingleGLInt(functions, GL_MAX_CLIP_DISTANCES_EXT); in GenerateCaps()
2053 caps->maxCullDistances = QuerySingleGLInt(functions, GL_MAX_CULL_DISTANCES_EXT); in GenerateCaps()
2055 QuerySingleGLInt(functions, GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT); in GenerateCaps()
2071 (functions->isAtLeastGL(gl::Version(3, 0)) || extensions->clipCullDistanceEXT) && in GenerateCaps()
2081 if (functions->isAtLeastGL(gl::Version(4, 5)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
2082 functions->hasGLESExtension("GL_OES_shader_image_atomic")) in GenerateCaps()
2088 if (functions->isAtLeastGL(gl::Version(4, 3)) || functions->isAtLeastGLES(gl::Version(3, 2)) || in GenerateCaps()
2089 functions->hasGLESExtension("GL_OES_texture_buffer") || in GenerateCaps()
2090 functions->hasGLESExtension("GL_EXT_texture_buffer") || in GenerateCaps()
2091 functions->hasGLExtension("GL_ARB_texture_buffer_object")) in GenerateCaps()
2093 caps->maxTextureBufferSize = QuerySingleGLInt(functions, GL_MAX_TEXTURE_BUFFER_SIZE); in GenerateCaps()
2095 QuerySingleGLInt(functions, GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT); in GenerateCaps()
2105 extensions->YUVTargetEXT = functions->hasGLESExtension("GL_EXT_YUV_target"); in GenerateCaps()
2108 extensions->framebufferFlipYMESA = functions->hasGLESExtension("GL_MESA_framebuffer_flip_y") || in GenerateCaps()
2109 functions->hasGLExtension("GL_MESA_framebuffer_flip_y"); in GenerateCaps()
2115 extensions->logicOpANGLE = functions->isAtLeastGL(gl::Version(2, 0)); in GenerateCaps()
2124 if (IsQualcomm(GetVendorID(functions))) in GenerateCaps()
2128 functions->getFloatv(GL_BLEND_COLOR, oldColor); in GenerateCaps()
2132 functions->blendColor(2.0, 0.0, 0.0, 0.0); in GenerateCaps()
2133 functions->getFloatv(GL_BLEND_COLOR, color); in GenerateCaps()
2137 functions->blendColor(oldColor[0], oldColor[1], oldColor[2], oldColor[3]); in GenerateCaps()
2141 bool GetSystemInfoVendorIDAndDeviceID(const FunctionsGL *functions, in GetSystemInfoVendorIDAndDeviceID() argument
2147 *outVendor = GetVendorID(functions); in GetSystemInfoVendorIDAndDeviceID()
2181 *outDevice = GetDeviceID(functions); in GetSystemInfoVendorIDAndDeviceID()
2200 void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *features) in InitializeFeatures() argument
2207 GetSystemInfoVendorIDAndDeviceID(functions, &systemInfo, &vendor, &device); in InitializeFeatures()
2220 bool isMesa = IsMesa(functions, &mesaVersion); in InitializeFeatures()
2224 functions->standard == STANDARD_GL_DESKTOP && isAMD); in InitializeFeatures()
2227 functions->standard == STANDARD_GL_DESKTOP && isIntel); in InitializeFeatures()
2256 IsLinux() && functions->standard == STANDARD_GL_DESKTOP && isAMD); in InitializeFeatures()
2259 (IsApple() && functions->standard == STANDARD_GL_DESKTOP) || (IsLinux() && isAMD)); in InitializeFeatures()
2263 IsApple() && functions->standard == STANDARD_GL_DESKTOP && in InitializeFeatures()
2277 functions->standard == STANDARD_GL_DESKTOP && isNvidia); in InitializeFeatures()
2293 functions->isAtMostGL(gl::Version(4, 1)) || in InitializeFeatures()
2294 (functions->standard == STANDARD_GL_DESKTOP && isAMD)); in InitializeFeatures()
2339 IsIOS() || IsAndroid() || IsAndroidEmulator(functions)); in InitializeFeatures()
2358 IsAndroid() || isAMD || !functions->hasExtension("GL_KHR_robust_buffer_access_behavior")); in InitializeFeatures()
2368 (IsApple() && functions->standard == STANDARD_GL_ES)); in InitializeFeatures()
2378 functions->standard == STANDARD_GL_DESKTOP && in InitializeFeatures()
2379 functions->isAtLeastGL(gl::Version(3, 1)) && in InitializeFeatures()
2380 !functions->isAtLeastGL(gl::Version(4, 3))); in InitializeFeatures()
2396 !isIntel && functions->standard == STANDARD_GL_ES && in InitializeFeatures()
2397 functions->isAtLeastGLES(gl::Version(3, 1)) && in InitializeFeatures()
2398 functions->hasGLESExtension("GL_EXT_texture_norm16")); in InitializeFeatures()
2406 // IsApple() && functions->standard == STANDARD_GL_DESKTOP); in InitializeFeatures()
2419 (IsAndroid() && GetAndroidSdkLevel() < 27 && IsAdreno5xxOrOlder(functions)) || in InitializeFeatures()
2420 (!isMesa && IsMaliT8xxOrOlder(functions)) || (!isMesa && IsMaliG31OrOlder(functions))); in InitializeFeatures()
2430 IsApple() && functions->standard == STANDARD_GL_ES && !(isAMD && IsWindows())); in InitializeFeatures()
2443 if (IsApple() && functions->standard == STANDARD_GL_DESKTOP) in InitializeFeatures()
2482 ANGLE_FEATURE_CONDITION(features, keepBufferShadowCopy, !CanMapBufferForRead(functions)); in InitializeFeatures()
2491 ANGLE_FEATURE_CONDITION(features, initFragmentOutputVariables, IsAdreno42xOr3xx(functions)); in InitializeFeatures()
2499 !nativegl::SupportsVertexArrayObjects(functions)); in InitializeFeatures()
2520 IsAndroid() && IsAdreno4xx(functions) && GetAndroidSdkLevel() < 22; in InitializeFeatures()
2524 IsAndroid() && IsAdreno4xx(functions) && GetAndroidSdkLevel() == 24; in InitializeFeatures()
2526 IsAndroid() && IsAdreno5xx(functions) && GetAndroidSdkLevel() < 24; in InitializeFeatures()
2530 IsAndroid() && IsAdreno5xx(functions) && GetAndroidSdkLevel() == 25; in InitializeFeatures()
2548 ANGLE_FEATURE_CONDITION(features, emulateRGB10, functions->standard == STANDARD_GL_DESKTOP); in InitializeFeatures()
2567 functions->isAtLeastGL(gl::Version(4, 3)) && in InitializeFeatures()
2568 functions->hasGLExtension("GL_NV_fragment_shader_interlock")); in InitializeFeatures()
2570 functions->isAtLeastGL(gl::Version(4, 4)) && in InitializeFeatures()
2571 functions->hasGLExtension("GL_INTEL_fragment_shader_ordering")); in InitializeFeatures()
2573 functions->isAtLeastGL(gl::Version(4, 5)) && in InitializeFeatures()
2574 functions->hasGLExtension("GL_ARB_fragment_shader_interlock")); in InitializeFeatures()
2578 functions->hasGLESExtension("GL_EXT_shader_framebuffer_fetch")); in InitializeFeatures()
2583 functions->hasGLESExtension("GL_EXT_shader_framebuffer_fetch_non_coherent")); in InitializeFeatures()
2587 functions->hasGLESExtension("GL_EXT_shader_pixel_local_storage")); in InitializeFeatures()
2593 ANGLE_FEATURE_CONDITION(features, disableClipControl, IsMaliG72OrG76OrG51(functions)); in InitializeFeatures()
2596 ANGLE_FEATURE_CONDITION(features, disableBaseInstanceVertex, IsMaliValhall(functions)); in InitializeFeatures()
2605 void InitializeFrontendFeatures(const FunctionsGL *functions, angle::FrontendFeatures *features) in InitializeFrontendFeatures() argument
2607 VendorID vendor = GetVendorID(functions); in InitializeFrontendFeatures()
2611 bool isMesa = IsMesa(functions, &mesaVersion); in InitializeFrontendFeatures()
2617 ANGLE_FEATURE_CONDITION(features, disableProgramBinary, IsPowerVrRogue(functions)); in InitializeFrontendFeatures()
2620 void ReInitializeFeaturesAtGPUSwitch(const FunctionsGL *functions, angle::FeaturesGL *features) in ReInitializeFeaturesAtGPUSwitch() argument
2626 GetSystemInfoVendorIDAndDeviceID(functions, &systemInfo, &vendor, &device); in ReInitializeFeaturesAtGPUSwitch()
2641 bool SupportsVertexArrayObjects(const FunctionsGL *functions) in SupportsVertexArrayObjects() argument
2643 return functions->isAtLeastGLES(gl::Version(3, 0)) || in SupportsVertexArrayObjects()
2644 functions->hasGLESExtension("GL_OES_vertex_array_object") || in SupportsVertexArrayObjects()
2645 functions->isAtLeastGL(gl::Version(3, 0)) || in SupportsVertexArrayObjects()
2646 functions->hasGLExtension("GL_ARB_vertex_array_object"); in SupportsVertexArrayObjects()
2649 bool CanUseDefaultVertexArrayObject(const FunctionsGL *functions) in CanUseDefaultVertexArrayObject() argument
2651 return (functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) == 0; in CanUseDefaultVertexArrayObject()
2654 bool SupportsCompute(const FunctionsGL *functions) in SupportsCompute() argument
2659 return (functions->isAtLeastGL(gl::Version(4, 3)) || in SupportsCompute()
2660 functions->isAtLeastGLES(gl::Version(3, 1)) || in SupportsCompute()
2661 (functions->isAtLeastGL(gl::Version(4, 2)) && in SupportsCompute()
2662 functions->hasGLExtension("GL_ARB_compute_shader") && in SupportsCompute()
2663 functions->hasGLExtension("GL_ARB_shader_storage_buffer_object"))); in SupportsCompute()
2666 bool SupportsFenceSync(const FunctionsGL *functions) in SupportsFenceSync() argument
2668 return functions->isAtLeastGL(gl::Version(3, 2)) || functions->hasGLExtension("GL_ARB_sync") || in SupportsFenceSync()
2669 functions->isAtLeastGLES(gl::Version(3, 0)); in SupportsFenceSync()
2672 bool SupportsOcclusionQueries(const FunctionsGL *functions) in SupportsOcclusionQueries() argument
2674 return functions->isAtLeastGL(gl::Version(1, 5)) || in SupportsOcclusionQueries()
2675 functions->hasGLExtension("GL_ARB_occlusion_query2") || in SupportsOcclusionQueries()
2676 functions->isAtLeastGLES(gl::Version(3, 0)) || in SupportsOcclusionQueries()
2677 functions->hasGLESExtension("GL_EXT_occlusion_query_boolean"); in SupportsOcclusionQueries()
2680 bool SupportsNativeRendering(const FunctionsGL *functions, in SupportsNativeRendering() argument
2686 bool hasInternalFormatQuery = functions->isAtLeastGL(gl::Version(4, 3)) || in SupportsNativeRendering()
2687 functions->hasGLExtension("GL_ARB_internalformat_query2"); in SupportsNativeRendering()
2697 functions->getInternalformativ(ToGLenum(type), internalFormat, GL_FRAMEBUFFER_RENDERABLE, 1, in SupportsNativeRendering()
2704 nativegl::GetInternalFormatInfo(internalFormat, functions->standard); in SupportsNativeRendering()
2705 return nativegl_gl::MeetsRequirements(functions, nativeInfo.textureAttachment); in SupportsNativeRendering()
2893 const FunctionsGL *functions = GetFunctionsGL(context); in ClearErrors() local
2894 ClearErrors(functions, file, function, line); in ClearErrors()
2913 const FunctionsGL *functions = GetFunctionsGL(context); in HandleError() local
2924 GLenum nextError = functions->getError(); in HandleError()
2928 nextError = functions->getError(); in HandleError()
2937 bool CanMapBufferForRead(const FunctionsGL *functions) in CanMapBufferForRead() argument
2939 return (functions->mapBufferRange != nullptr) || in CanMapBufferForRead()
2940 (functions->mapBuffer != nullptr && functions->standard == STANDARD_GL_DESKTOP); in CanMapBufferForRead()
2943 uint8_t *MapBufferRangeWithFallback(const FunctionsGL *functions, in MapBufferRangeWithFallback() argument
2949 if (functions->mapBufferRange != nullptr) in MapBufferRangeWithFallback()
2951 return static_cast<uint8_t *>(functions->mapBufferRange(target, offset, length, access)); in MapBufferRangeWithFallback()
2953 else if (functions->mapBuffer != nullptr && in MapBufferRangeWithFallback()
2954 (functions->standard == STANDARD_GL_DESKTOP || access == GL_MAP_WRITE_BIT)) in MapBufferRangeWithFallback()
2978 return static_cast<uint8_t *>(functions->mapBuffer(target, accessEnum)) + offset; in MapBufferRangeWithFallback()
3085 std::string GetRendererString(const FunctionsGL *functions) in GetRendererString() argument
3087 return GetString(functions, GL_RENDERER); in GetRendererString()
3090 std::string GetVendorString(const FunctionsGL *functions) in GetVendorString() argument
3092 return GetString(functions, GL_VENDOR); in GetVendorString()
3095 std::string GetVersionString(const FunctionsGL *functions) in GetVersionString() argument
3097 return GetString(functions, GL_VERSION); in GetVersionString()