chromium/third_party/angle/src/common/utilities.cpp

//
// Copyright 2002 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.
//

// utilities.cpp: Conversion functions and other utility routines.

#include "common/utilities.h"
#include "GLES3/gl3.h"
#include "common/mathutil.h"
#include "common/platform.h"
#include "common/string_utils.h"

#include <set>

#if defined(ANGLE_ENABLE_WINDOWS_UWP)
#    include <windows.applicationmodel.core.h>
#    include <windows.graphics.display.h>
#    include <wrl.h>
#    include <wrl/wrappers/corewrappers.h>
#endif

namespace
{

template <class IndexType>
gl::IndexRange ComputeTypedIndexRange(const IndexType *indices,
                                      size_t count,
                                      bool primitiveRestartEnabled,
                                      GLuint primitiveRestartIndex)
{}

}  // anonymous namespace

namespace gl
{

int VariableComponentCount(GLenum type)
{}

GLenum VariableComponentType(GLenum type)
{}

size_t VariableComponentSize(GLenum type)
{}

size_t VariableInternalSize(GLenum type)
{}

size_t VariableExternalSize(GLenum type)
{}

std::string GetGLSLTypeString(GLenum type)
{}

GLenum VariableBoolVectorType(GLenum type)
{}

int VariableRowCount(GLenum type)
{}

int VariableColumnCount(GLenum type)
{}

bool IsSamplerType(GLenum type)
{}

bool IsSamplerCubeType(GLenum type)
{}

bool IsSamplerYUVType(GLenum type)
{}

bool IsImageType(GLenum type)
{}

bool IsImage2DType(GLenum type)
{}

bool IsAtomicCounterType(GLenum type)
{}

bool IsOpaqueType(GLenum type)
{}

bool IsMatrixType(GLenum type)
{}

GLenum TransposeMatrixType(GLenum type)
{}

int MatrixRegisterCount(GLenum type, bool isRowMajorMatrix)
{}

int MatrixComponentCount(GLenum type, bool isRowMajorMatrix)
{}

int VariableRegisterCount(GLenum type)
{}

int AllocateFirstFreeBits(unsigned int *bits, unsigned int allocationSize, unsigned int bitsSize)
{}

IndexRange ComputeIndexRange(DrawElementsType indexType,
                             const GLvoid *indices,
                             size_t count,
                             bool primitiveRestartEnabled)
{}

GLuint GetPrimitiveRestartIndex(DrawElementsType indexType)
{}

bool IsTriangleMode(PrimitiveMode drawMode)
{}

bool IsPolygonMode(PrimitiveMode mode)
{}

namespace priv
{
const angle::PackedEnumMap<PrimitiveMode, bool> gLineModes =;
}  // namespace priv

bool IsIntegerFormat(GLenum unsizedFormat)
{}

// [OpenGL ES SL 3.00.4] Section 11 p. 120
// Vertex Outs/Fragment Ins packing priorities
int VariableSortOrder(GLenum type)
{}

std::string ParseResourceName(const std::string &name, std::vector<unsigned int> *outSubscripts)
{}

bool IsBuiltInName(const char *name)
{}

std::string StripLastArrayIndex(const std::string &name)
{}

bool SamplerNameContainsNonZeroArrayElement(const std::string &name)
{}

unsigned int ArraySizeProduct(const std::vector<unsigned int> &arraySizes)
{}

unsigned int InnerArraySizeProduct(const std::vector<unsigned int> &arraySizes)
{}

unsigned int OutermostArraySize(const std::vector<unsigned int> &arraySizes)
{}

unsigned int ParseArrayIndex(const std::string &name, size_t *nameLengthWithoutArrayIndexOut)
{}

const char *GetGenericErrorMessage(GLenum error)
{}

unsigned int ElementTypeSize(GLenum elementType)
{}

bool IsMipmapFiltered(GLenum minFilterMode)
{}

PipelineType GetPipelineType(ShaderType type)
{}

const char *GetDebugMessageSourceString(GLenum source)
{}

const char *GetDebugMessageTypeString(GLenum type)
{}

const char *GetDebugMessageSeverityString(GLenum severity)
{}

ShaderType GetShaderTypeFromBitfield(size_t singleShaderType)
{}

GLbitfield GetBitfieldFromShaderType(ShaderType shaderType)
{}

bool ShaderTypeSupportsTransformFeedback(ShaderType shaderType)
{}

ShaderType GetLastPreFragmentStage(ShaderBitSet shaderTypes)
{}
}  // namespace gl

namespace egl
{
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;

bool IsCubeMapTextureTarget(EGLenum target)
{}

size_t CubeMapTextureTargetToLayerIndex(EGLenum target)
{}

EGLenum LayerIndexToCubeMapTextureTarget(size_t index)
{}

bool IsTextureTarget(EGLenum target)
{}

bool IsRenderbufferTarget(EGLenum target)
{}

bool IsExternalImageTarget(EGLenum target)
{}

const char *GetGenericErrorMessage(EGLint error)
{}

}  // namespace egl

namespace egl_gl
{
GLuint EGLClientBufferToGLObjectHandle(EGLClientBuffer buffer)
{}
}  // namespace egl_gl

namespace gl_egl
{
EGLenum GLComponentTypeToEGLColorComponentType(GLenum glComponentType)
{}

EGLClientBuffer GLObjectHandleToEGLClientBuffer(GLuint handle)
{}

}  // namespace gl_egl

namespace angle
{
bool IsDrawEntryPoint(EntryPoint entryPoint)
{}

bool IsDispatchEntryPoint(EntryPoint entryPoint)
{}

bool IsClearEntryPoint(EntryPoint entryPoint)
{}

bool IsQueryEntryPoint(EntryPoint entryPoint)
{}
}  // namespace angle

void writeFile(const char *path, const void *content, size_t size)
{}