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 ...@@ -49,7 +49,7 @@ Context::Context(int clientVersion, const gl::Context *shareContext, rx::Rendere
{ {
ASSERT(robustAccess == false); // Unimplemented ASSERT(robustAccess == false); // Unimplemented
mFenceHandleAllocator.setBaseHandle(0); mFenceNVHandleAllocator.setBaseHandle(0);
setClearColor(0.0f, 0.0f, 0.0f, 0.0f); setClearColor(0.0f, 0.0f, 0.0f, 0.0f);
...@@ -229,9 +229,9 @@ Context::~Context() ...@@ -229,9 +229,9 @@ Context::~Context()
deleteFramebuffer(mFramebufferMap.begin()->first); deleteFramebuffer(mFramebufferMap.begin()->first);
} }
while (!mFenceMap.empty()) while (!mFenceNVMap.empty())
{ {
deleteFence(mFenceMap.begin()->first); deleteFenceNV(mFenceNVMap.begin()->first);
} }
while (!mQueryMap.empty()) while (!mQueryMap.empty())
...@@ -816,11 +816,11 @@ GLuint Context::createFramebuffer() ...@@ -816,11 +816,11 @@ GLuint Context::createFramebuffer()
return handle; 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; return handle;
} }
...@@ -913,15 +913,15 @@ void Context::deleteFramebuffer(GLuint framebuffer) ...@@ -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; delete fenceObject->second;
mFenceMap.erase(fenceObject); mFenceNVMap.erase(fenceObject);
} }
} }
...@@ -1350,11 +1350,11 @@ Framebuffer *Context::getFramebuffer(unsigned int handle) ...@@ -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; return NULL;
} }
......
...@@ -63,7 +63,7 @@ class Colorbuffer; ...@@ -63,7 +63,7 @@ class Colorbuffer;
class Depthbuffer; class Depthbuffer;
class Stencilbuffer; class Stencilbuffer;
class DepthStencilbuffer; class DepthStencilbuffer;
class Fence; class FenceNV;
class Query; class Query;
class ResourceManager; class ResourceManager;
class Buffer; class Buffer;
...@@ -272,8 +272,8 @@ class Context ...@@ -272,8 +272,8 @@ class Context
void deleteFramebuffer(GLuint framebuffer); void deleteFramebuffer(GLuint framebuffer);
// Fences are owned by the Context. // Fences are owned by the Context.
GLuint createFence(); GLuint createFenceNV();
void deleteFence(GLuint fence); void deleteFenceNV(GLuint fence);
// Queries are owned by the Context; // Queries are owned by the Context;
GLuint createQuery(); GLuint createQuery();
...@@ -320,7 +320,7 @@ class Context ...@@ -320,7 +320,7 @@ class Context
GLfloat getSamplerParameterf(GLuint sampler, GLenum pname); GLfloat getSamplerParameterf(GLuint sampler, GLenum pname);
Buffer *getBuffer(GLuint handle); Buffer *getBuffer(GLuint handle);
Fence *getFence(GLuint handle); FenceNV *getFenceNV(GLuint handle);
Shader *getShader(GLuint handle); Shader *getShader(GLuint handle);
Program *getProgram(GLuint handle); Program *getProgram(GLuint handle);
Texture *getTexture(GLuint handle); Texture *getTexture(GLuint handle);
...@@ -478,9 +478,9 @@ class Context ...@@ -478,9 +478,9 @@ class Context
FramebufferMap mFramebufferMap; FramebufferMap mFramebufferMap;
HandleAllocator mFramebufferHandleAllocator; HandleAllocator mFramebufferHandleAllocator;
typedef HASH_MAP<GLuint, Fence*> FenceMap; typedef HASH_MAP<GLuint, FenceNV*> FenceNVMap;
FenceMap mFenceMap; FenceNVMap mFenceNVMap;
HandleAllocator mFenceHandleAllocator; HandleAllocator mFenceNVHandleAllocator;
typedef HASH_MAP<GLuint, Query*> QueryMap; typedef HASH_MAP<GLuint, Query*> QueryMap;
QueryMap mQueryMap; QueryMap mQueryMap;
......
...@@ -15,24 +15,24 @@ ...@@ -15,24 +15,24 @@
namespace gl namespace gl
{ {
Fence::Fence(rx::Renderer *renderer) FenceNV::FenceNV(rx::Renderer *renderer)
{ {
mFence = renderer->createFence(); mFence = renderer->createFence();
} }
Fence::~Fence() FenceNV::~FenceNV()
{ {
delete mFence; delete mFence;
} }
GLboolean Fence::isFence() const GLboolean FenceNV::isFence() const
{ {
// GL_NV_fence spec: // GL_NV_fence spec:
// A name returned by GenFencesNV, but not yet set via SetFenceNV, is not the name of an existing fence. // 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); return (mFence->isSet() ? GL_TRUE : GL_FALSE);
} }
void Fence::setFence(GLenum condition) void FenceNV::setFence(GLenum condition)
{ {
mFence->set(); mFence->set();
...@@ -40,7 +40,7 @@ void Fence::setFence(GLenum condition) ...@@ -40,7 +40,7 @@ void Fence::setFence(GLenum condition)
mStatus = GL_FALSE; mStatus = GL_FALSE;
} }
GLboolean Fence::testFence() GLboolean FenceNV::testFence()
{ {
// Flush the command buffer by default // Flush the command buffer by default
bool result = mFence->test(true); bool result = mFence->test(true);
...@@ -49,7 +49,7 @@ GLboolean Fence::testFence() ...@@ -49,7 +49,7 @@ GLboolean Fence::testFence()
return mStatus; return mStatus;
} }
void Fence::finishFence() void FenceNV::finishFence()
{ {
ASSERT(mFence->isSet()); ASSERT(mFence->isSet());
...@@ -59,7 +59,7 @@ void Fence::finishFence() ...@@ -59,7 +59,7 @@ void Fence::finishFence()
} }
} }
GLint Fence::getFencei(GLenum pname) GLint FenceNV::getFencei(GLenum pname)
{ {
ASSERT(mFence->isSet()); ASSERT(mFence->isSet());
......
...@@ -20,11 +20,11 @@ class FenceImpl; ...@@ -20,11 +20,11 @@ class FenceImpl;
namespace gl namespace gl
{ {
class Fence class FenceNV
{ {
public: public:
explicit Fence(rx::Renderer *renderer); explicit FenceNV(rx::Renderer *renderer);
virtual ~Fence(); virtual ~FenceNV();
GLboolean isFence() const; GLboolean isFence() const;
void setFence(GLenum condition); void setFence(GLenum condition);
...@@ -36,7 +36,7 @@ class Fence ...@@ -36,7 +36,7 @@ class Fence
GLuint getCondition() const { return mCondition; } GLuint getCondition() const { return mCondition; }
private: private:
DISALLOW_COPY_AND_ASSIGN(Fence); DISALLOW_COPY_AND_ASSIGN(FenceNV);
rx::FenceImpl *mFence; rx::FenceImpl *mFence;
......
...@@ -3396,7 +3396,7 @@ void __stdcall glDeleteFencesNV(GLsizei n, const GLuint* fences) ...@@ -3396,7 +3396,7 @@ void __stdcall glDeleteFencesNV(GLsizei n, const GLuint* fences)
{ {
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
{ {
context->deleteFence(fences[i]); context->deleteFenceNV(fences[i]);
} }
} }
} }
...@@ -4011,7 +4011,7 @@ void __stdcall glFinishFenceNV(GLuint fence) ...@@ -4011,7 +4011,7 @@ void __stdcall glFinishFenceNV(GLuint fence)
if (context) if (context)
{ {
gl::Fence* fenceObject = context->getFence(fence); gl::FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == NULL) if (fenceObject == NULL)
{ {
...@@ -4457,7 +4457,7 @@ void __stdcall glGenFencesNV(GLsizei n, GLuint* fences) ...@@ -4457,7 +4457,7 @@ void __stdcall glGenFencesNV(GLsizei n, GLuint* fences)
{ {
for (int i = 0; i < n; i++) 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) ...@@ -4898,7 +4898,7 @@ void __stdcall glGetFenceivNV(GLuint fence, GLenum pname, GLint *params)
if (context) if (context)
{ {
gl::Fence *fenceObject = context->getFence(fence); gl::FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == NULL) if (fenceObject == NULL)
{ {
...@@ -6292,7 +6292,7 @@ GLboolean __stdcall glIsFenceNV(GLuint fence) ...@@ -6292,7 +6292,7 @@ GLboolean __stdcall glIsFenceNV(GLuint fence)
if (context) if (context)
{ {
gl::Fence *fenceObject = context->getFence(fence); gl::FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == NULL) if (fenceObject == NULL)
{ {
...@@ -6775,7 +6775,7 @@ void __stdcall glSetFenceNV(GLuint fence, GLenum condition) ...@@ -6775,7 +6775,7 @@ void __stdcall glSetFenceNV(GLuint fence, GLenum condition)
if (context) if (context)
{ {
gl::Fence *fenceObject = context->getFence(fence); gl::FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == NULL) if (fenceObject == NULL)
{ {
...@@ -7068,7 +7068,7 @@ GLboolean __stdcall glTestFenceNV(GLuint fence) ...@@ -7068,7 +7068,7 @@ GLboolean __stdcall glTestFenceNV(GLuint fence)
if (context) if (context)
{ {
gl::Fence *fenceObject = context->getFence(fence); gl::FenceNV *fenceObject = context->getFenceNV(fence);
if (fenceObject == NULL) 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