chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.cpp

//
// Copyright 2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

// renderergl_utils.cpp: Conversion functions and other utility routines
// specific to the OpenGL renderer.

#include "libANGLE/renderer/gl/renderergl_utils.h"

#include <array>
#include <limits>

#include "common/android_util.h"
#include "common/mathutil.h"
#include "common/platform.h"
#include "common/string_utils.h"
#include "gpu_info_util/SystemInfo.h"
#include "libANGLE/Buffer.h"
#include "libANGLE/Caps.h"
#include "libANGLE/Context.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/queryconversions.h"
#include "libANGLE/renderer/driver_utils.h"
#include "libANGLE/renderer/gl/ContextGL.h"
#include "libANGLE/renderer/gl/FenceNVGL.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
#include "libANGLE/renderer/gl/QueryGL.h"
#include "libANGLE/renderer/gl/formatutilsgl.h"
#include "platform/autogen/FeaturesGL_autogen.h"
#include "platform/autogen/FrontendFeatures_autogen.h"

#include <EGL/eglext.h>
#include <algorithm>
#include <sstream>

CheckedNumeric;

namespace rx
{

namespace
{

const char *GetString(const FunctionsGL *functions, GLenum name)
{}

bool IsMesa(const FunctionsGL *functions, std::array<int, 3> *version)
{}

int getAdrenoNumber(const FunctionsGL *functions)
{}

int GetQualcommVersion(const FunctionsGL *functions)
{}

int getMaliTNumber(const FunctionsGL *functions)
{}

int getMaliGNumber(const FunctionsGL *functions)
{}

bool IsAdreno3xx(const FunctionsGL *functions)
{}

bool IsAdreno42xOr3xx(const FunctionsGL *functions)
{}

bool IsAdreno4xx(const FunctionsGL *functions)
{}

bool IsAdreno5xxOrOlder(const FunctionsGL *functions)
{}

bool IsAdreno5xx(const FunctionsGL *functions)
{}

bool IsMaliT8xxOrOlder(const FunctionsGL *functions)
{}

bool IsMaliG31OrOlder(const FunctionsGL *functions)
{}

bool IsMaliG72OrG76OrG51(const FunctionsGL *functions)
{}

bool IsMaliValhall(const FunctionsGL *functions)
{}

bool IsPixel7OrPixel8(const FunctionsGL *functions)
{}

[[maybe_unused]] bool IsAndroidEmulator(const FunctionsGL *functions)
{}

bool IsPowerVrRogue(const FunctionsGL *functions)
{}

}  // namespace

SwapControlData::SwapControlData()
    :{}

VendorID GetVendorID(const FunctionsGL *functions)
{}

uint32_t GetDeviceID(const FunctionsGL *functions)
{}

ShShaderOutput GetShaderOutputType(const FunctionsGL *functions)
{}

namespace nativegl_gl
{

static bool MeetsRequirements(const FunctionsGL *functions,
                              const nativegl::SupportRequirement &requirements)
{}

static bool CheckSizedInternalFormatTextureRenderability(const FunctionsGL *functions,
                                                         const angle::FeaturesGL &features,
                                                         GLenum internalFormat)
{}

static bool CheckInternalFormatRenderbufferRenderability(const FunctionsGL *functions,
                                                         const angle::FeaturesGL &features,
                                                         GLenum internalFormat)
{}

static void LimitVersion(gl::Version *curVersion, const gl::Version &maxVersion)
{}

static gl::TextureCaps GenerateTextureFormatCaps(const FunctionsGL *functions,
                                                 const angle::FeaturesGL &features,
                                                 GLenum internalFormat,
                                                 gl::Version *maxSupportedESVersion)
{}

static GLint QuerySingleGLInt(const FunctionsGL *functions, GLenum name)
{}

static GLint QuerySingleIndexGLInt(const FunctionsGL *functions, GLenum name, GLuint index)
{}

static GLint QueryGLIntRange(const FunctionsGL *functions, GLenum name, size_t index)
{}

static GLint64 QuerySingleGLInt64(const FunctionsGL *functions, GLenum name)
{}

static GLfloat QuerySingleGLFloat(const FunctionsGL *functions, GLenum name)
{}

static GLfloat QueryGLFloatRange(const FunctionsGL *functions, GLenum name, size_t index)
{}

static gl::TypePrecision QueryTypePrecision(const FunctionsGL *functions,
                                            GLenum shaderType,
                                            GLenum precisionType)
{}

static GLint QueryQueryValue(const FunctionsGL *functions, GLenum target, GLenum name)
{}

void CapCombinedLimitToESShaders(GLint *combinedLimit, gl::ShaderMap<GLint> &perShaderLimit)
{}

void GenerateCaps(const FunctionsGL *functions,
                  const angle::FeaturesGL &features,
                  gl::Caps *caps,
                  gl::TextureCapsMap *textureCapsMap,
                  gl::Extensions *extensions,
                  gl::Limitations *limitations,
                  gl::Version *maxSupportedESVersion,
                  MultiviewImplementationTypeGL *multiviewImplementationType,
                  ShPixelLocalStorageOptions *plsOptions)
{}

bool GetSystemInfoVendorIDAndDeviceID(const FunctionsGL *functions,
                                      angle::SystemInfo *outSystemInfo,
                                      angle::VendorID *outVendor,
                                      angle::DeviceID *outDevice)
{}

bool Has9thGenIntelGPU(const angle::SystemInfo &systemInfo)
{}

void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *features)
{}

void InitializeFrontendFeatures(const FunctionsGL *functions, angle::FrontendFeatures *features)
{}

void ReInitializeFeaturesAtGPUSwitch(const FunctionsGL *functions, angle::FeaturesGL *features)
{}

}  // namespace nativegl_gl

namespace nativegl
{

bool SupportsVertexArrayObjects(const FunctionsGL *functions)
{}

bool CanUseDefaultVertexArrayObject(const FunctionsGL *functions)
{}

bool CanUseClientSideArrays(const FunctionsGL *functions, GLuint vao)
{}

bool SupportsCompute(const FunctionsGL *functions)
{}

bool SupportsFenceSync(const FunctionsGL *functions)
{}

bool SupportsOcclusionQueries(const FunctionsGL *functions)
{}

bool SupportsNativeRendering(const FunctionsGL *functions,
                             gl::TextureType type,
                             GLenum internalFormat)
{}

bool SupportsTexImage(gl::TextureType type)
{}

bool UseTexImage2D(gl::TextureType textureType)
{}

bool UseTexImage3D(gl::TextureType textureType)
{}

GLenum GetTextureBindingQuery(gl::TextureType textureType)
{}

GLenum GetTextureBindingTarget(gl::TextureType textureType)
{}

GLenum GetTextureBindingTarget(gl::TextureTarget textureTarget)
{}

GLenum GetBufferBindingQuery(gl::BufferBinding bufferBinding)
{}

std::string GetBufferBindingString(gl::BufferBinding bufferBinding)
{}

gl::TextureType GetNativeTextureType(gl::TextureType type)
{}

gl::TextureTarget GetNativeTextureTarget(gl::TextureTarget target)
{}

}  // namespace nativegl

const FunctionsGL *GetFunctionsGL(const gl::Context *context)
{}

StateManagerGL *GetStateManagerGL(const gl::Context *context)
{}

BlitGL *GetBlitGL(const gl::Context *context)
{}

ClearMultiviewGL *GetMultiviewClearer(const gl::Context *context)
{}

const angle::FeaturesGL &GetFeaturesGL(const gl::Context *context)
{}

void ClearErrors(const FunctionsGL *functions,
                 const char *file,
                 const char *function,
                 unsigned int line)
{}

void ClearErrors(const gl::Context *context,
                 const char *file,
                 const char *function,
                 unsigned int line)
{}

angle::Result CheckError(const gl::Context *context,
                         const char *call,
                         const char *file,
                         const char *function,
                         unsigned int line)
{}

angle::Result HandleError(const gl::Context *context,
                          GLenum error,
                          const char *call,
                          const char *file,
                          const char *function,
                          unsigned int line)
{}

bool CanMapBufferForRead(const FunctionsGL *functions)
{}

uint8_t *MapBufferRangeWithFallback(const FunctionsGL *functions,
                                    GLenum target,
                                    size_t offset,
                                    size_t length,
                                    GLbitfield access)
{}

angle::Result ShouldApplyLastRowPaddingWorkaround(ContextGL *contextGL,
                                                  const gl::Extents &size,
                                                  const gl::PixelStoreStateBase &state,
                                                  const gl::Buffer *pixelBuffer,
                                                  GLenum format,
                                                  GLenum type,
                                                  bool is3D,
                                                  const void *pixels,
                                                  bool *shouldApplyOut)
{}

std::vector<ContextCreationTry> GenerateContextCreationToTry(EGLint requestedType, bool isMesaGLX)
{}

std::string GetRendererString(const FunctionsGL *functions)
{}

std::string GetVendorString(const FunctionsGL *functions)
{}

std::string GetVersionString(const FunctionsGL *functions)
{}

}  // namespace rx