#include "libANGLE/renderer/gl/VertexArrayGL.h"
#include "common/bitset_utils.h"
#include "common/debug.h"
#include "common/mathutil.h"
#include "common/utilities.h"
#include "libANGLE/Buffer.h"
#include "libANGLE/Context.h"
#include "libANGLE/angletypes.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/gl/BufferGL.h"
#include "libANGLE/renderer/gl/ContextGL.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
#include "libANGLE/renderer/gl/StateManagerGL.h"
#include "libANGLE/renderer/gl/renderergl_utils.h"
usingnamespacegl;
namespace rx
{
namespace
{
GLuint GetNativeBufferID(const gl::Buffer *frontendBuffer)
{ … }
bool SameVertexAttribFormat(const VertexAttributeGL &a, const VertexAttribute &b)
{ … }
bool SameVertexBuffer(const VertexBindingGL &a, const VertexBinding &b)
{ … }
bool SameIndexBuffer(const VertexArrayStateGL *a, const gl::Buffer *frontendBuffer)
{ … }
bool SameAttribPointer(const VertexAttributeGL &a, const VertexAttribute &b)
{ … }
bool IsVertexAttribPointerSupported(size_t attribIndex, const VertexAttribute &attrib)
{ … }
GLuint GetAdjustedDivisor(GLuint numViews, GLuint divisor)
{ … }
static angle::Result ValidateStateHelperGetIntegerv(const gl::Context *context,
const GLuint localValue,
const GLenum pname,
const char *localName,
const char *driverName)
{ … }
static angle::Result ValidateStateHelperGetVertexAttribiv(const gl::Context *context,
const GLint index,
const GLuint localValue,
const GLenum pname,
const char *localName,
const char *driverName)
{ … }
}
VertexArrayGL::VertexArrayGL(const VertexArrayState &state, GLuint id)
: … { … }
VertexArrayGL::VertexArrayGL(const gl::VertexArrayState &state,
GLuint id,
VertexArrayStateGL *sharedState)
: … { … }
VertexArrayGL::~VertexArrayGL() { … }
void VertexArrayGL::destroy(const gl::Context *context)
{ … }
angle::Result VertexArrayGL::syncClientSideData(const gl::Context *context,
const gl::AttributesMask &activeAttributesMask,
GLint first,
GLsizei count,
GLsizei instanceCount) const
{ … }
angle::Result VertexArrayGL::updateElementArrayBufferBinding(const gl::Context *context) const
{ … }
angle::Result VertexArrayGL::syncDrawState(const gl::Context *context,
const gl::AttributesMask &activeAttributesMask,
GLint first,
GLsizei count,
gl::DrawElementsType type,
const void *indices,
GLsizei instanceCount,
bool primitiveRestartEnabled,
const void **outIndices) const
{ … }
angle::Result VertexArrayGL::syncIndexData(const gl::Context *context,
GLsizei count,
gl::DrawElementsType type,
const void *indices,
bool primitiveRestartEnabled,
bool attributesNeedStreaming,
IndexRange *outIndexRange,
const void **outIndices) const
{ … }
void VertexArrayGL::computeStreamingAttributeSizes(const gl::AttributesMask &attribsToStream,
GLsizei instanceCount,
const gl::IndexRange &indexRange,
size_t *outStreamingDataSize,
size_t *outMaxAttributeDataSize) const
{ … }
angle::Result VertexArrayGL::streamAttributes(
const gl::Context *context,
const gl::AttributesMask &attribsToStream,
GLsizei instanceCount,
const gl::IndexRange &indexRange,
bool applyExtraOffsetWorkaroundForInstancedAttributes) const
{ … }
angle::Result VertexArrayGL::recoverForcedStreamingAttributesForDrawArraysInstanced(
const gl::Context *context) const
{ … }
angle::Result VertexArrayGL::recoverForcedStreamingAttributesForDrawArraysInstanced(
const gl::Context *context,
gl::AttributesMask *attributeMask) const
{ … }
GLuint VertexArrayGL::getVertexArrayID() const
{ … }
rx::VertexArrayStateGL *VertexArrayGL::getNativeState() const
{ … }
angle::Result VertexArrayGL::updateAttribEnabled(const gl::Context *context, size_t attribIndex)
{ … }
angle::Result VertexArrayGL::updateAttribPointer(const gl::Context *context, size_t attribIndex)
{ … }
angle::Result VertexArrayGL::callVertexAttribPointer(const gl::Context *context,
GLuint attribIndex,
const VertexAttribute &attrib,
GLsizei stride,
GLintptr offset) const
{ … }
bool VertexArrayGL::supportVertexAttribBinding(const gl::Context *context) const
{ … }
angle::Result VertexArrayGL::updateAttribFormat(const gl::Context *context, size_t attribIndex)
{ … }
angle::Result VertexArrayGL::updateAttribBinding(const gl::Context *context, size_t attribIndex)
{ … }
angle::Result VertexArrayGL::updateBindingBuffer(const gl::Context *context, size_t bindingIndex)
{ … }
angle::Result VertexArrayGL::updateBindingDivisor(const gl::Context *context, size_t bindingIndex)
{ … }
angle::Result VertexArrayGL::syncDirtyAttrib(
const gl::Context *context,
size_t attribIndex,
const gl::VertexArray::DirtyAttribBits &dirtyAttribBits)
{ … }
angle::Result VertexArrayGL::syncDirtyBinding(
const gl::Context *context,
size_t bindingIndex,
const gl::VertexArray::DirtyBindingBits &dirtyBindingBits)
{ … }
#define ANGLE_DIRTY_ATTRIB_FUNC(INDEX) …
#define ANGLE_DIRTY_BINDING_FUNC(INDEX) …
#define ANGLE_DIRTY_BUFFER_DATA_FUNC(INDEX) …
angle::Result VertexArrayGL::syncState(const gl::Context *context,
const gl::VertexArray::DirtyBits &dirtyBits,
gl::VertexArray::DirtyAttribBitsArray *attribBits,
gl::VertexArray::DirtyBindingBitsArray *bindingBits)
{ … }
angle::Result VertexArrayGL::applyNumViewsToDivisor(const gl::Context *context, int numViews)
{ … }
angle::Result VertexArrayGL::applyActiveAttribLocationsMask(const gl::Context *context,
const gl::AttributesMask &activeMask)
{ … }
angle::Result VertexArrayGL::validateState(const gl::Context *context) const
{ … }
}