diff options
author | Andrew Knight <andrew.knight@digia.com> | 2013-04-03 19:57:09 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-08 11:35:44 +0200 |
commit | 710ad8ce1bd5d01ce048851d210ac3831ca17dde (patch) | |
tree | bb3f645e57a7887341113275c9caa2583f7e2dfa /src/3rdparty/angle/src/libGLESv2/Fence.cpp | |
parent | 8307ab784eb4d8d22441ee61f02cb381684ca3a2 (diff) |
Upgrade ANGLE to DX11 Proto
Upgrades ANGLE to dx11proto (dx11-MRT-support tag), which splits out support
for DirectX9 & DirectX11. The DX9 codepath is used by default;
CONFIG+=angle_d3d11 must be passed to the ANGLE project to build for DX11.
Existing patches to ANGLE have been updated (or removed if no longer
needed), and a patch has been added to make DX9/DX11 codepaths mutually
exclusive.
Change-Id: Ibe13befadb94f04883eca449d0ee1f0da955ff92
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Axel Waggershauser <awagger@gmail.com>
Diffstat (limited to 'src/3rdparty/angle/src/libGLESv2/Fence.cpp')
-rw-r--r-- | src/3rdparty/angle/src/libGLESv2/Fence.cpp | 104 |
1 files changed, 12 insertions, 92 deletions
diff --git a/src/3rdparty/angle/src/libGLESv2/Fence.cpp b/src/3rdparty/angle/src/libGLESv2/Fence.cpp index 14d1239abf..e4218bbeec 100644 --- a/src/3rdparty/angle/src/libGLESv2/Fence.cpp +++ b/src/3rdparty/angle/src/libGLESv2/Fence.cpp @@ -1,5 +1,6 @@ +#include "precompiled.h" // -// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. +// Copyright (c) 2002-2013 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. // @@ -7,126 +8,45 @@ // Fence.cpp: Implements the gl::Fence class, which supports the GL_NV_fence extension. #include "libGLESv2/Fence.h" - -#include "libGLESv2/main.h" +#include "libGLESv2/renderer/FenceImpl.h" +#include "libGLESv2/renderer/Renderer.h" namespace gl { -Fence::Fence(egl::Display* display) +Fence::Fence(rx::Renderer *renderer) { - mDisplay = display; - mQuery = NULL; - mCondition = GL_NONE; - mStatus = GL_FALSE; + mFence = renderer->createFence(); } Fence::~Fence() { - if (mQuery != NULL) - { - mDisplay->freeEventQuery(mQuery); - } + delete mFence; } GLboolean Fence::isFence() { - // GL_NV_fence spec: - // A name returned by GenFencesNV, but not yet set via SetFenceNV, is not the name of an existing fence. - return mQuery != NULL; + return mFence->isFence(); } void Fence::setFence(GLenum condition) { - if (!mQuery) - { - mQuery = mDisplay->allocateEventQuery(); - if (!mQuery) - { - return error(GL_OUT_OF_MEMORY); - } - } - - HRESULT result = mQuery->Issue(D3DISSUE_END); - ASSERT(SUCCEEDED(result)); - - mCondition = condition; - mStatus = GL_FALSE; + mFence->setFence(condition); } GLboolean Fence::testFence() { - if (mQuery == NULL) - { - return error(GL_INVALID_OPERATION, GL_TRUE); - } - - HRESULT result = mQuery->GetData(NULL, 0, D3DGETDATA_FLUSH); - - if (checkDeviceLost(result)) - { - return error(GL_OUT_OF_MEMORY, GL_TRUE); - } - - ASSERT(result == S_OK || result == S_FALSE); - mStatus = result == S_OK; - return mStatus; + return mFence->testFence(); } void Fence::finishFence() { - if (mQuery == NULL) - { - return error(GL_INVALID_OPERATION); - } - - while (!testFence()) - { - Sleep(0); - } + mFence->finishFence(); } void Fence::getFenceiv(GLenum pname, GLint *params) { - if (mQuery == NULL) - { - return error(GL_INVALID_OPERATION); - } - - switch (pname) - { - case GL_FENCE_STATUS_NV: - { - // GL_NV_fence spec: - // Once the status of a fence has been finished (via FinishFenceNV) or tested and the returned status is TRUE (via either TestFenceNV - // or GetFenceivNV querying the FENCE_STATUS_NV), the status remains TRUE until the next SetFenceNV of the fence. - if (mStatus) - { - params[0] = GL_TRUE; - return; - } - - HRESULT result = mQuery->GetData(NULL, 0, 0); - - if (checkDeviceLost(result)) - { - params[0] = GL_TRUE; - return error(GL_OUT_OF_MEMORY); - } - - ASSERT(result == S_OK || result == S_FALSE); - mStatus = result == S_OK; - params[0] = mStatus; - - break; - } - case GL_FENCE_CONDITION_NV: - params[0] = mCondition; - break; - default: - return error(GL_INVALID_ENUM); - break; - } + mFence->getFenceiv(pname, params); } } |