summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/libANGLE/Buffer.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-05-18 15:16:30 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-05-26 15:11:40 +0200
commit752497910b67b2a1a80560840ca44548d8893434 (patch)
tree541501c9abfd97c3d2fa450d2e6abb60582c4420 /src/3rdparty/angle/src/libANGLE/Buffer.cpp
parent7db527dbdd911c79f31425d099d1fc9c63e42453 (diff)
Remove ANGLE
This marks the end of EGL and OpenGL ES support on Windows. The concepts of -opengl dynamic, -opengl desktop, QT_OPENGL=software, etc. remain unchanged, with the exception of the disapperance of everything ANGLE related. CMake builds now work identically to qmake on Windows: they default to 'dynamic' OpenGL on Windows, unless -DINPUT_opengl=desktop is specified. On Windows, Qt 6 is expected to default to the "dynamic" OpenGL model by default, just like Qt 5.15. This can be changed by switching to "desktop" OpenGL, which will link to opengl32 (publicly, so other libs and applications will do so as well) and disallows using another OpenGL DLL. The "dynamic" mode is essential still because the fallback to a software rasterizer, such as the opengl32sw.dll we ship with the Qt packages, has to to work exactly like in Qt 5, the removal of ANGLE does not change this concept in any way (except of course that the middle option of using ANGLE is now gone) When it comes to the windows plugin's OpenGL blacklist feature, it works like before and accepts the ANGLE/D3D related keywords. They will then be ignored. Similarly, requesting QT_OPENGL=angle is ignored (but will show a warning). The D3D11 and DXGI configure time tests are removed: Qt 5.14 already depends on D3D 11.1 and DXGI 1.3 headers being available unconditionally on Win32 (in QRhi's D3D11 backend). No need to test for these. [ChangeLog][Windows] ANGLE is no longer included with Qt. Dynamic OpenGL builds work like before but ANGLE is no longer an option. OpenGL proper or an alternative opengl32 implementation are the two remaining options now. Attempting to set QT_OPENGL=angle or Qt::AA_UseOpenGLES will have no effect on Windows. Fixes: QTBUG-79103 Change-Id: Ia404e0d07f3fe191b27434d863c81180112ecb3b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/3rdparty/angle/src/libANGLE/Buffer.cpp')
-rw-r--r--src/3rdparty/angle/src/libANGLE/Buffer.cpp215
1 files changed, 0 insertions, 215 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/Buffer.cpp b/src/3rdparty/angle/src/libANGLE/Buffer.cpp
deleted file mode 100644
index a1ebfc1acb..0000000000
--- a/src/3rdparty/angle/src/libANGLE/Buffer.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-//
-// Copyright (c) 2002-2014 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.
-//
-
-// Buffer.cpp: Implements the gl::Buffer class, representing storage of vertex and/or
-// index data. Implements GL buffer objects and related functionality.
-// [OpenGL ES 2.0.24] section 2.9 page 21.
-
-#include "libANGLE/Buffer.h"
-
-#include "libANGLE/Context.h"
-#include "libANGLE/renderer/BufferImpl.h"
-#include "libANGLE/renderer/GLImplFactory.h"
-
-namespace gl
-{
-
-BufferState::BufferState()
- : mLabel(),
- mUsage(BufferUsage::StaticDraw),
- mSize(0),
- mAccessFlags(0),
- mAccess(GL_WRITE_ONLY_OES),
- mMapped(GL_FALSE),
- mMapPointer(nullptr),
- mMapOffset(0),
- mMapLength(0)
-{
-}
-
-BufferState::~BufferState()
-{
-}
-
-Buffer::Buffer(rx::GLImplFactory *factory, GLuint id)
- : RefCountObject(id), mImpl(factory->createBuffer(mState))
-{
-}
-
-Buffer::~Buffer()
-{
- SafeDelete(mImpl);
-}
-
-Error Buffer::onDestroy(const Context *context)
-{
- // In tests, mImpl might be null.
- if (mImpl)
- mImpl->destroy(context);
- return NoError();
-}
-
-void Buffer::setLabel(const std::string &label)
-{
- mState.mLabel = label;
-}
-
-const std::string &Buffer::getLabel() const
-{
- return mState.mLabel;
-}
-
-Error Buffer::bufferData(const Context *context,
- BufferBinding target,
- const void *data,
- GLsizeiptr size,
- BufferUsage usage)
-{
- const void *dataForImpl = data;
-
- // If we are using robust resource init, make sure the buffer starts cleared.
- // Note: the Context is checked for nullptr because of some testing code.
- // TODO(jmadill): Investigate lazier clearing.
- if (context && context->getGLState().isRobustResourceInitEnabled() && !data && size > 0)
- {
- angle::MemoryBuffer *scratchBuffer = nullptr;
- ANGLE_TRY(context->getZeroFilledBuffer(static_cast<size_t>(size), &scratchBuffer));
- dataForImpl = scratchBuffer->data();
- }
-
- ANGLE_TRY(mImpl->setData(context, target, dataForImpl, size, usage));
-
- mIndexRangeCache.clear();
- mState.mUsage = usage;
- mState.mSize = size;
-
- return NoError();
-}
-
-Error Buffer::bufferSubData(const Context *context,
- BufferBinding target,
- const void *data,
- GLsizeiptr size,
- GLintptr offset)
-{
- ANGLE_TRY(mImpl->setSubData(context, target, data, size, offset));
-
- mIndexRangeCache.invalidateRange(static_cast<unsigned int>(offset), static_cast<unsigned int>(size));
-
- return NoError();
-}
-
-Error Buffer::copyBufferSubData(const Context *context,
- Buffer *source,
- GLintptr sourceOffset,
- GLintptr destOffset,
- GLsizeiptr size)
-{
- ANGLE_TRY(
- mImpl->copySubData(context, source->getImplementation(), sourceOffset, destOffset, size));
-
- mIndexRangeCache.invalidateRange(static_cast<unsigned int>(destOffset), static_cast<unsigned int>(size));
-
- return NoError();
-}
-
-Error Buffer::map(const Context *context, GLenum access)
-{
- ASSERT(!mState.mMapped);
-
- mState.mMapPointer = nullptr;
- ANGLE_TRY(mImpl->map(context, access, &mState.mMapPointer));
-
- ASSERT(access == GL_WRITE_ONLY_OES);
-
- mState.mMapped = GL_TRUE;
- mState.mMapOffset = 0;
- mState.mMapLength = mState.mSize;
- mState.mAccess = access;
- mState.mAccessFlags = GL_MAP_WRITE_BIT;
- mIndexRangeCache.clear();
-
- return NoError();
-}
-
-Error Buffer::mapRange(const Context *context,
- GLintptr offset,
- GLsizeiptr length,
- GLbitfield access)
-{
- ASSERT(!mState.mMapped);
- ASSERT(offset + length <= mState.mSize);
-
- mState.mMapPointer = nullptr;
- ANGLE_TRY(mImpl->mapRange(context, offset, length, access, &mState.mMapPointer));
-
- mState.mMapped = GL_TRUE;
- mState.mMapOffset = static_cast<GLint64>(offset);
- mState.mMapLength = static_cast<GLint64>(length);
- mState.mAccess = GL_WRITE_ONLY_OES;
- mState.mAccessFlags = access;
-
- // The OES_mapbuffer extension states that GL_WRITE_ONLY_OES is the only valid
- // value for GL_BUFFER_ACCESS_OES because it was written against ES2. Since there is
- // no update for ES3 and the GL_READ_ONLY and GL_READ_WRITE enums don't exist for ES,
- // we cannot properly set GL_BUFFER_ACCESS_OES when glMapBufferRange is called.
-
- if ((access & GL_MAP_WRITE_BIT) > 0)
- {
- mIndexRangeCache.invalidateRange(static_cast<unsigned int>(offset), static_cast<unsigned int>(length));
- }
-
- return NoError();
-}
-
-Error Buffer::unmap(const Context *context, GLboolean *result)
-{
- ASSERT(mState.mMapped);
-
- *result = GL_FALSE;
- ANGLE_TRY(mImpl->unmap(context, result));
-
- mState.mMapped = GL_FALSE;
- mState.mMapPointer = nullptr;
- mState.mMapOffset = 0;
- mState.mMapLength = 0;
- mState.mAccess = GL_WRITE_ONLY_OES;
- mState.mAccessFlags = 0;
-
- return NoError();
-}
-
-void Buffer::onTransformFeedback()
-{
- mIndexRangeCache.clear();
-}
-
-void Buffer::onPixelUnpack()
-{
- mIndexRangeCache.clear();
-}
-
-Error Buffer::getIndexRange(const gl::Context *context,
- GLenum type,
- size_t offset,
- size_t count,
- bool primitiveRestartEnabled,
- IndexRange *outRange) const
-{
- if (mIndexRangeCache.findRange(type, offset, count, primitiveRestartEnabled, outRange))
- {
- return NoError();
- }
-
- ANGLE_TRY(
- mImpl->getIndexRange(context, type, offset, count, primitiveRestartEnabled, outRange));
-
- mIndexRangeCache.addRange(type, offset, count, primitiveRestartEnabled, *outRange);
-
- return NoError();
-}
-
-} // namespace gl