1 // SwiftShader Software Renderer
\r
3 // Copyright(c) 2005-2012 TransGaming Inc.
\r
5 // All rights reserved. No part of this software may be copied, distributed, transmitted,
\r
6 // transcribed, stored in a retrieval system, translated into any human or computer
\r
7 // language by any means, or disclosed to third parties without the explicit written
\r
8 // agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
\r
9 // or implied, including but not limited to any patent rights, are granted to you.
\r
12 // Fence.cpp: Implements the Fence class, which supports the GL_NV_fence extension.
\r
17 #include "Common/Thread.hpp"
\r
25 mCondition = GL_NONE;
\r
34 GLboolean Fence::isFence()
\r
36 // GL_NV_fence spec:
\r
37 // A name returned by GenFencesNV, but not yet set via SetFenceNV, is not the name of an existing fence.
\r
41 void Fence::setFence(GLenum condition)
\r
44 mCondition = condition;
\r
48 GLboolean Fence::testFence()
\r
52 return error(GL_INVALID_OPERATION, GL_TRUE);
\r
61 void Fence::finishFence()
\r
65 return error(GL_INVALID_OPERATION);
\r
70 sw::Thread::yield();
\r
74 void Fence::getFenceiv(GLenum pname, GLint *params)
\r
78 return error(GL_INVALID_OPERATION);
\r
83 case GL_FENCE_STATUS_NV:
\r
85 // GL_NV_fence spec:
\r
86 // Once the status of a fence has been finished (via FinishFenceNV) or tested and the returned status is TRUE (via either TestFenceNV
\r
87 // or GetFenceivNV querying the FENCE_STATUS_NV), the status remains TRUE until the next SetFenceNV of the fence.
\r
90 params[0] = GL_TRUE;
\r
94 mStatus = testFence();
\r
96 params[0] = mStatus;
\r
99 case GL_FENCE_CONDITION_NV:
\r
100 params[0] = mCondition;
\r
103 return error(GL_INVALID_ENUM);
\r