src/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.cpp
// Warning: you should ensure binding really matches attrib.bindingIndex before using this function.
you should ensure binding really matches attrib.bindingIndex before using this function.
you should ensure binding really matches attrib . bindingIndex before using this function .
VertexStorageType ClassifyAttributeStorage(const gl::Context *context,
                                           const gl::VertexAttribute &attrib,
                                           const gl::VertexBinding &binding)
{
    if (!attrib.enabled)
    {
        return VertexStorageType::CURRENT_VALUE;
    }
    gl::Buffer *buffer = binding.getBuffer().get();
    if (!buffer)
    {
        return VertexStorageType::DYNAMIC;
    }
    if (DirectStoragePossible(context, attrib, binding))
    {
        return VertexStorageType::DIRECT;
    }
    BufferD3D *bufferD3D = GetImplAs<BufferD3D>(buffer);
    ASSERT(bufferD3D);
    switch (bufferD3D->getUsage())
    {
        case D3DBufferUsage::DYNAMIC:
            return VertexStorageType::DYNAMIC;
        case D3DBufferUsage::STATIC:
            return VertexStorageType::STATIC;
        default:
            UNREACHABLE();
            return VertexStorageType::UNKNOWN;
    }
}
VertexStorageType ClassifyAttributeStorage ( const gl :: Context * context , const gl :: VertexAttribute & attrib , const gl :: VertexBinding & binding ) { if ( ! attrib . enabled ) { return VertexStorageType :: CURRENT_VALUE ; } gl :: Buffer * buffer = binding . getBuffer ( ) . get ( ) ; if ( ! buffer ) { return VertexStorageType :: DYNAMIC ; } if ( DirectStoragePossible ( context , attrib , binding ) ) { return VertexStorageType :: DIRECT ; } BufferD3D * bufferD3D = GetImplAs < BufferD3D > ( buffer ) ; ASSERT ( bufferD3D ) ; switch ( bufferD3D -> getUsage ( ) ) { case D3DBufferUsage :: DYNAMIC : return VertexStorageType :: DYNAMIC ; case D3DBufferUsage :: STATIC : return VertexStorageType :: STATIC ; default : UNREACHABLE ( ) ; return VertexStorageType :: UNKNOWN ; } }
Warning: you should ensure binding really matches attrib.bindingIndex before using this function.
Warning : you should ensure binding really matches attrib . bindingIndex before using this function .
// If attribute is disabled, we use the current value. // If specified with immediate data, we must use dynamic storage. // Check if the buffer supports direct storage. // Otherwise the storage is static or dynamic.