Commit 33dc8439 by Jamie Madill

Rename the old Fence class and associated methods to show an NV suffix, for…

Rename the old Fence class and associated methods to show an NV suffix, for differentiation with ES3 fences sync objects. ES3 fences are shared across contexts, while NV fences are not. TRAC #23446 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Authored-by: Jamie Madill
parent fb9a7409
......@@ -49,7 +49,7 @@ Context::Context(int clientVersion, const gl::Context *shareContext, rx::Rendere
{
ASSERT(robustAccess == false); // Unimplemented
mFenceHandleAllocator.setBaseHandle(0);
mFenceNVHandleAllocator.setBaseHandle(0);
setClearColor(0.0f, 0.0f, 0.0f, 0.0f);
......@@ -229,9 +229,9 @@ Context::~Context()
deleteFramebuffer(mFramebufferMap.begin()->first);
}
while (!mFenceMap.empty())
while (!mFenceNVMap.empty())
{
deleteFence(mFenceMap.begin()->first);
deleteFenceNV(mFenceNVMap.begin()->first);
}
while (!mQueryMap.empty())
......@@ -816,11 +816,11 @@ GLuint Context::createFramebuffer()
return handle;
}
GLuint Context::createFence()
GLuint Context::createFenceNV()
{
GLuint handle = mFenceHandleAllocator.allocate();
GLuint handle = mFenceNVHandleAllocator.allocate();
mFenceMap[handle] = new Fence(mRenderer);
mFenceNVMap[handle] = new FenceNV(mRenderer);
return handle;
}
......@@ -913,15 +913,15 @@ void Context::deleteFramebuffer(GLuint framebuffer)
}
}
void Context::deleteFence(GLuint fence)
void Context::deleteFenceNV(GLuint fence)
{
FenceMap::iterator fenceObject = mFenceMap.find(fence);
FenceNVMap::iterator fenceObject = mFenceNVMap.find(fence);
if (fenceObject != mFenceMap.end())
if (fenceObject != mFenceNVMap.end())
{
mFenceHandleAllocator.release(fenceObject->first);
mFenceNVHandleAllocator.release(fenceObject->first);
delete fenceObject->second;
mFenceMap.erase(fenceObject);
mFenceNVMap.erase(fenceObject);
}
}
......@@ -1350,11 +1350,11 @@ Framebuffer *Context::getFramebuffer(unsigned int handle)
}
}
Fence *Context::getFence(unsigned int handle)
FenceNV *Context::getFenceNV(unsigned int handle)
{
FenceMap::iterator fence = mFenceMap.find(handle);
FenceNVMap::iterator fence = mFenceNVMap.find(handle);
if (fence == mFenceMap.end())
if (fence == mFenceNVMap.end())
{
return NULL;
}
......
......@@ -63,7 +63,7 @@ class Colorbuffer;
class Depthbuffer;
class Stencilbuffer;
class DepthStencilbuffer;
class Fence;
class FenceNV;
class Query;
class ResourceManager;
class Buffer;
......@@ -272,8 +272,8 @@ class Context
void deleteFramebuffer(GLuint framebuffer);
// Fences are owned by the Context.
GLuint createFence();
void deleteFence(GLuint fence);
GLuint createFenceNV();
void deleteFenceNV(GLuint fence);
// Queries are owned by the Context;
GLuint createQuery();
......@@ -320,7 +320,7 @@ class Context
GLfloat getSamplerParameterf(GLuint sampler, GLenum pname);
Buffer *getBuffer(GLuint handle);
Fence *getFence(GLuint handle);
FenceNV *getFenceNV(GLuint handle);
Shader *getShader(GLuint handle);
Program *getProgram(GLuint handle);
Texture *getTexture(GLuint handle);
......@@ -478,9 +478,9 @@ class Context
FramebufferMap mFramebufferMap;
HandleAllocator mFramebufferHandleAllocator;
typedef HASH_MAP<GLuint, Fence*> FenceMap;
FenceMap mFenceMap;
HandleAllocator mFenceHandleAllocator;
typedef HASH_MAP<GLuint, FenceNV*> FenceNVMap;
FenceNVMap mFenceNVMap;
HandleAllocator mFenceNVHandleAllocator;
typedef HASH_MAP<GLuint, Query*> QueryMap;
QueryMap mQueryMap;
......
......@@ -15,24 +15,24 @@
namespace gl
{
Fence::Fence(rx::Renderer *renderer)
FenceNV::FenceNV(rx::Renderer *renderer)
{
mFence = renderer->createFence();
}
Fence::~Fence()
FenceNV::~FenceNV()
{
delete mFence;
}
GLboolean Fence::isFence() const
GLboolean FenceNV::isFence() const
{
// GL_NV_fence spec:
// A name returned by GenFencesNV, but not yet set via SetFenceNV, is not the name of an existing fence.
return (mFence->isSet() ? GL_TRUE : GL_FALSE);
}
void Fence::setFence(GLenum condition)
void FenceNV::setFence(GLenum condition)
{
mFence->set();
......@@ -40,7 +40,7 @@ void Fence::setFence(GLenum condition)
mStatus = GL_FALSE;
}
GLboolean Fence::testFence()
GLboolean FenceNV::testFence()
{
// Flush the command buffer by default
bool result = mFence->test(true);
......@@ -49,7 +49,7 @@ GLboolean Fence::testFence()
return mStatus;
}
void Fence::finishFence()
void FenceNV::finishFence()
{
ASSERT(mFence->isSet());
......@@ -59,7 +59,7 @@ void Fence::finishFence()
}
}
GLint Fence::getFencei(GLenum pname)
GLint FenceNV::getFencei(GLenum pname)
{
ASSERT(mFence->isSet());
......
......@@ -20,11 +20,11 @@ class FenceImpl;
namespace gl
{
class Fence
class FenceNV
{
public:
explicit Fence(rx::Renderer *renderer);
virtual ~Fence();
explicit FenceNV(rx::Renderer *renderer);
virtual ~FenceNV();
GLboolean isFence() const;
void setFence(GLenum condition);
......@@ -36,7 +36,7 @@ class Fence
GLuint getCondition() const { return mCondition; }
private:
DISALLOW_COPY_AND_ASSIGN(Fence);
DISALLOW_COPY_AND_ASSIGN(FenceNV);
rx::FenceImpl *mFence;
......
......@@ -3396,7 +3396,7 @@ void __stdcall glDeleteFencesNV(GLsizei n, const GLuint* fences)
{
for (int i = 0; i < n; i++)
{
context->deleteFence(fences[i]);
context->deleteFenceNV(fences[i]);
}
}
}
......@@ -4011,7 +4011,7 @@ void __stdcall glFinishFenceNV(GLuint fence)
if (context)
{
gl::Fence* fenceObject = context->getFence(fence);
gl::FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == NULL)
{
......@@ -4457,7 +4457,7 @@ void __stdcall glGenFencesNV(GLsizei n, GLuint* fences)
{
for (int i = 0; i < n; i++)
{
fences[i] = context->createFence();
fences[i] = context->createFenceNV();
}
}
}
......@@ -4898,7 +4898,7 @@ void __stdcall glGetFenceivNV(GLuint fence, GLenum pname, GLint *params)
if (context)
{
gl::Fence *fenceObject = context->getFence(fence);
gl::FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == NULL)
{
......@@ -6292,7 +6292,7 @@ GLboolean __stdcall glIsFenceNV(GLuint fence)
if (context)
{
gl::Fence *fenceObject = context->getFence(fence);
gl::FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == NULL)
{
......@@ -6775,7 +6775,7 @@ void __stdcall glSetFenceNV(GLuint fence, GLenum condition)
if (context)
{
gl::Fence *fenceObject = context->getFence(fence);
gl::FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == NULL)
{
......@@ -7068,7 +7068,7 @@ GLboolean __stdcall glTestFenceNV(GLuint fence)
if (context)
{
gl::Fence *fenceObject = context->getFence(fence);
gl::FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == NULL)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment