Commit f0640bc3 by Jiacheng Lu Committed by Commit Bot

Use SemaphoreID in place of GLuint handle

Bug: angleproject:3804 Change-Id: Iabaae60ed7cbbe423bf768c506099d26cf0dedcf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1768978 Commit-Queue: Jiacheng Lu <lujc@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent f92adbbc
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"scripts/egl_angle_ext.xml": "scripts/egl_angle_ext.xml":
"fc2e249239fb1365f6d145cdf1a3cfcf", "fc2e249239fb1365f6d145cdf1a3cfcf",
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"8ee962008357069b1d2a8ec6f38b8305", "8451cf7defe0d98dac54fcbf37614e73",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
"00dc8410ad87e122314ac58579445188", "00dc8410ad87e122314ac58579445188",
"scripts/gl.xml": "scripts/gl.xml":
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
"src/libANGLE/Context_gles_3_1_autogen.h": "src/libANGLE/Context_gles_3_1_autogen.h":
"8aef8ceb87eed9cc7e9586f6c98796e3", "8aef8ceb87eed9cc7e9586f6c98796e3",
"src/libANGLE/Context_gles_ext_autogen.h": "src/libANGLE/Context_gles_ext_autogen.h":
"81b0d87ea5234d62cf11ed87538ee121", "c7176e590dfc07ec670f2cb678154789",
"src/libANGLE/capture_gles_1_0_autogen.cpp": "src/libANGLE/capture_gles_1_0_autogen.cpp":
"f4e1335bebff584d2ac5198571b19972", "f4e1335bebff584d2ac5198571b19972",
"src/libANGLE/capture_gles_1_0_autogen.h": "src/libANGLE/capture_gles_1_0_autogen.h":
...@@ -80,9 +80,9 @@ ...@@ -80,9 +80,9 @@
"src/libANGLE/capture_gles_3_1_autogen.h": "src/libANGLE/capture_gles_3_1_autogen.h":
"389c0212c9d2da8bdc159aecee243551", "389c0212c9d2da8bdc159aecee243551",
"src/libANGLE/capture_gles_ext_autogen.cpp": "src/libANGLE/capture_gles_ext_autogen.cpp":
"cf79d27e5cf5392b653fa2cad155d393", "efca1e085a34165f2ac13107d6778436",
"src/libANGLE/capture_gles_ext_autogen.h": "src/libANGLE/capture_gles_ext_autogen.h":
"474ad56a50bff5e48d31415ce12658cf", "7b955199f769acdbb9a37b4e2d22487e",
"src/libANGLE/entry_points_enum_autogen.cpp": "src/libANGLE/entry_points_enum_autogen.cpp":
"97b5fe98b95b4ae36c68f723e64f993a", "97b5fe98b95b4ae36c68f723e64f993a",
"src/libANGLE/entry_points_enum_autogen.h": "src/libANGLE/entry_points_enum_autogen.h":
...@@ -90,9 +90,9 @@ ...@@ -90,9 +90,9 @@
"src/libANGLE/frame_capture_replay_autogen.cpp": "src/libANGLE/frame_capture_replay_autogen.cpp":
"00efb888e3ceff27fab7e9e85a497041", "00efb888e3ceff27fab7e9e85a497041",
"src/libANGLE/frame_capture_utils_autogen.cpp": "src/libANGLE/frame_capture_utils_autogen.cpp":
"3f1dc6fe8700f440900af30ab5c105d4", "0542fbffae8f723d49f5014ff2b12e49",
"src/libANGLE/frame_capture_utils_autogen.h": "src/libANGLE/frame_capture_utils_autogen.h":
"0d1cdb72333963345387abf549058431", "594024324a582c72a4ba6f82ac4b8966",
"src/libANGLE/validationES1_autogen.h": "src/libANGLE/validationES1_autogen.h":
"8d3131d2bf2e6f521f46b44e64a6bff9", "8d3131d2bf2e6f521f46b44e64a6bff9",
"src/libANGLE/validationES2_autogen.h": "src/libANGLE/validationES2_autogen.h":
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
"src/libANGLE/validationES3_autogen.h": "src/libANGLE/validationES3_autogen.h":
"c3142a7eb36b6f4f132e7a1f66e15459", "c3142a7eb36b6f4f132e7a1f66e15459",
"src/libANGLE/validationESEXT_autogen.h": "src/libANGLE/validationESEXT_autogen.h":
"17f2b1279f7f60dc7bf26972bf958054", "63effdeb898b95959057c2e9c084cb28",
"src/libANGLE/validationGL11_autogen.h": "src/libANGLE/validationGL11_autogen.h":
"c5ac1ca523a39df2621d11e92c9c821a", "c5ac1ca523a39df2621d11e92c9c821a",
"src/libANGLE/validationGL12_autogen.h": "src/libANGLE/validationGL12_autogen.h":
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
"src/libGLESv2/entry_points_gles_3_1_autogen.h": "src/libGLESv2/entry_points_gles_3_1_autogen.h":
"043d09a964c740067bf4279e0b544aed", "043d09a964c740067bf4279e0b544aed",
"src/libGLESv2/entry_points_gles_ext_autogen.cpp": "src/libGLESv2/entry_points_gles_ext_autogen.cpp":
"a895e2ddf7e2ffdbab2bbb1957a15980", "9f98d7515bb0794c89e4f8f3bef07942",
"src/libGLESv2/entry_points_gles_ext_autogen.h": "src/libGLESv2/entry_points_gles_ext_autogen.h":
"fea36fa137e55dd2f244dbb49d31cc41", "fea36fa137e55dd2f244dbb49d31cc41",
"src/libGLESv2/libGLESv2_autogen.cpp": "src/libGLESv2/libGLESv2_autogen.cpp":
......
...@@ -466,6 +466,7 @@ ...@@ -466,6 +466,7 @@
"handleType": "HandleType" "handleType": "HandleType"
}, },
"glImportSemaphoreFd": { "glImportSemaphoreFd": {
"semaphore": "SemaphoreID",
"handleType": "HandleType" "handleType": "HandleType"
}, },
"glInvalidateBufferData": { "glInvalidateBufferData": {
...@@ -648,6 +649,7 @@ ...@@ -648,6 +649,7 @@
"mode": "ShadingModel" "mode": "ShadingModel"
}, },
"glSignalSemaphore": { "glSignalSemaphore": {
"semaphore": "SemaphoreID",
"buffers": "const BufferID *", "buffers": "const BufferID *",
"textures": "const TextureID *" "textures": "const TextureID *"
}, },
...@@ -861,6 +863,7 @@ ...@@ -861,6 +863,7 @@
"type": "VertexAttribType" "type": "VertexAttribType"
}, },
"glWaitSemaphore": { "glWaitSemaphore": {
"semaphore": "SemaphoreID",
"buffers": "const BufferID *", "buffers": "const BufferID *",
"textures": "const TextureID *" "textures": "const TextureID *"
}, },
...@@ -1511,5 +1514,20 @@ ...@@ -1511,5 +1514,20 @@
}, },
"glDeleteFramebuffers": { "glDeleteFramebuffers": {
"framebuffers": "const FramebufferID *" "framebuffers": "const FramebufferID *"
},
"glGenSemaphores": {
"semaphores": "SemaphoreID *"
},
"glDeleteSemaphores": {
"semaphores": "const SemaphoreID *"
},
"glIsSemaphore": {
"semaphore": "SemaphoreID"
},
"glSemaphoreParameterui64v": {
"semaphore": "SemaphoreID"
},
"glGetSemaphoreParameterui64v": {
"semaphore": "SemaphoreID"
} }
} }
...@@ -391,6 +391,11 @@ struct FramebufferID ...@@ -391,6 +391,11 @@ struct FramebufferID
GLuint value; GLuint value;
}; };
struct SemaphoreID
{
GLuint value;
};
struct RenderbufferID struct RenderbufferID
{ {
GLuint value; GLuint value;
......
...@@ -750,7 +750,7 @@ GLuint Context::createMemoryObject() ...@@ -750,7 +750,7 @@ GLuint Context::createMemoryObject()
return mState.mMemoryObjectManager->createMemoryObject(mImplementation.get()); return mState.mMemoryObjectManager->createMemoryObject(mImplementation.get());
} }
GLuint Context::createSemaphore() SemaphoreID Context::createSemaphore()
{ {
return mState.mSemaphoreManager->createSemaphore(mImplementation.get()); return mState.mSemaphoreManager->createSemaphore(mImplementation.get());
} }
...@@ -820,7 +820,7 @@ void Context::deleteMemoryObject(GLuint memoryObject) ...@@ -820,7 +820,7 @@ void Context::deleteMemoryObject(GLuint memoryObject)
mState.mMemoryObjectManager->deleteMemoryObject(this, memoryObject); mState.mMemoryObjectManager->deleteMemoryObject(this, memoryObject);
} }
void Context::deleteSemaphore(GLuint semaphore) void Context::deleteSemaphore(SemaphoreID semaphore)
{ {
mState.mSemaphoreManager->deleteSemaphore(this, semaphore); mState.mSemaphoreManager->deleteSemaphore(this, semaphore);
} }
...@@ -6127,7 +6127,7 @@ MemoryObject *Context::getMemoryObject(GLuint handle) const ...@@ -6127,7 +6127,7 @@ MemoryObject *Context::getMemoryObject(GLuint handle) const
return mState.mMemoryObjectManager->getMemoryObject(handle); return mState.mMemoryObjectManager->getMemoryObject(handle);
} }
Semaphore *Context::getSemaphore(GLuint handle) const Semaphore *Context::getSemaphore(SemaphoreID handle) const
{ {
return mState.mSemaphoreManager->getSemaphore(handle); return mState.mSemaphoreManager->getSemaphore(handle);
} }
...@@ -7715,7 +7715,7 @@ void Context::importMemoryFd(GLuint memory, GLuint64 size, HandleType handleType ...@@ -7715,7 +7715,7 @@ void Context::importMemoryFd(GLuint memory, GLuint64 size, HandleType handleType
ANGLE_CONTEXT_TRY(memoryObject->importFd(this, size, handleType, fd)); ANGLE_CONTEXT_TRY(memoryObject->importFd(this, size, handleType, fd));
} }
void Context::genSemaphores(GLsizei n, GLuint *semaphores) void Context::genSemaphores(GLsizei n, SemaphoreID *semaphores)
{ {
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
{ {
...@@ -7723,7 +7723,7 @@ void Context::genSemaphores(GLsizei n, GLuint *semaphores) ...@@ -7723,7 +7723,7 @@ void Context::genSemaphores(GLsizei n, GLuint *semaphores)
} }
} }
void Context::deleteSemaphores(GLsizei n, const GLuint *semaphores) void Context::deleteSemaphores(GLsizei n, const SemaphoreID *semaphores)
{ {
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
{ {
...@@ -7731,9 +7731,9 @@ void Context::deleteSemaphores(GLsizei n, const GLuint *semaphores) ...@@ -7731,9 +7731,9 @@ void Context::deleteSemaphores(GLsizei n, const GLuint *semaphores)
} }
} }
GLboolean Context::isSemaphore(GLuint semaphore) GLboolean Context::isSemaphore(SemaphoreID semaphore)
{ {
if (semaphore == 0) if (semaphore.value == 0)
{ {
return GL_FALSE; return GL_FALSE;
} }
...@@ -7741,17 +7741,17 @@ GLboolean Context::isSemaphore(GLuint semaphore) ...@@ -7741,17 +7741,17 @@ GLboolean Context::isSemaphore(GLuint semaphore)
return ConvertToGLBoolean(getSemaphore(semaphore)); return ConvertToGLBoolean(getSemaphore(semaphore));
} }
void Context::semaphoreParameterui64v(GLuint semaphore, GLenum pname, const GLuint64 *params) void Context::semaphoreParameterui64v(SemaphoreID semaphore, GLenum pname, const GLuint64 *params)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
void Context::getSemaphoreParameterui64v(GLuint semaphore, GLenum pname, GLuint64 *params) void Context::getSemaphoreParameterui64v(SemaphoreID semaphore, GLenum pname, GLuint64 *params)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
void Context::waitSemaphore(GLuint semaphoreHandle, void Context::waitSemaphore(SemaphoreID semaphoreHandle,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffers, const BufferID *buffers,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -7777,7 +7777,7 @@ void Context::waitSemaphore(GLuint semaphoreHandle, ...@@ -7777,7 +7777,7 @@ void Context::waitSemaphore(GLuint semaphoreHandle,
ANGLE_CONTEXT_TRY(semaphore->wait(this, bufferBarriers, textureBarriers)); ANGLE_CONTEXT_TRY(semaphore->wait(this, bufferBarriers, textureBarriers));
} }
void Context::signalSemaphore(GLuint semaphoreHandle, void Context::signalSemaphore(SemaphoreID semaphoreHandle,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffers, const BufferID *buffers,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -7803,7 +7803,7 @@ void Context::signalSemaphore(GLuint semaphoreHandle, ...@@ -7803,7 +7803,7 @@ void Context::signalSemaphore(GLuint semaphoreHandle,
ANGLE_CONTEXT_TRY(semaphore->signal(this, bufferBarriers, textureBarriers)); ANGLE_CONTEXT_TRY(semaphore->signal(this, bufferBarriers, textureBarriers));
} }
void Context::importSemaphoreFd(GLuint semaphore, HandleType handleType, GLint fd) void Context::importSemaphoreFd(SemaphoreID semaphore, HandleType handleType, GLint fd)
{ {
Semaphore *semaphoreObject = getSemaphore(semaphore); Semaphore *semaphoreObject = getSemaphore(semaphore);
ASSERT(semaphoreObject != nullptr); ASSERT(semaphoreObject != nullptr);
......
...@@ -356,14 +356,14 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl ...@@ -356,14 +356,14 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
RenderbufferID createRenderbuffer(); RenderbufferID createRenderbuffer();
ProgramPipelineID createProgramPipeline(); ProgramPipelineID createProgramPipeline();
GLuint createMemoryObject(); GLuint createMemoryObject();
GLuint createSemaphore(); SemaphoreID createSemaphore();
void deleteBuffer(BufferID buffer); void deleteBuffer(BufferID buffer);
void deleteTexture(TextureID texture); void deleteTexture(TextureID texture);
void deleteRenderbuffer(RenderbufferID renderbuffer); void deleteRenderbuffer(RenderbufferID renderbuffer);
void deleteProgramPipeline(ProgramPipelineID pipeline); void deleteProgramPipeline(ProgramPipelineID pipeline);
void deleteMemoryObject(GLuint memoryObject); void deleteMemoryObject(GLuint memoryObject);
void deleteSemaphore(GLuint semaphore); void deleteSemaphore(SemaphoreID semaphore);
// CHROMIUM_path_rendering // CHROMIUM_path_rendering
bool isPathGenerated(PathID path) const; bool isPathGenerated(PathID path) const;
...@@ -388,7 +388,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl ...@@ -388,7 +388,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
TransformFeedback *getTransformFeedback(GLuint handle) const; TransformFeedback *getTransformFeedback(GLuint handle) const;
ProgramPipeline *getProgramPipeline(ProgramPipelineID handle) const; ProgramPipeline *getProgramPipeline(ProgramPipelineID handle) const;
MemoryObject *getMemoryObject(GLuint handle) const; MemoryObject *getMemoryObject(GLuint handle) const;
Semaphore *getSemaphore(GLuint handle) const; Semaphore *getSemaphore(SemaphoreID handle) const;
Texture *getTextureByType(TextureType type) const; Texture *getTextureByType(TextureType type) const;
Texture *getTextureByTarget(TextureTarget target) const; Texture *getTextureByTarget(TextureTarget target) const;
......
...@@ -362,19 +362,20 @@ ...@@ -362,19 +362,20 @@
void readnPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, \ void readnPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, \
GLsizei bufSize, void *data); \ GLsizei bufSize, void *data); \
/* GL_EXT_semaphore */ \ /* GL_EXT_semaphore */ \
void deleteSemaphores(GLsizei n, const GLuint *semaphores); \ void deleteSemaphores(GLsizei n, const SemaphoreID *semaphoresPacked); \
void genSemaphores(GLsizei n, GLuint *semaphores); \ void genSemaphores(GLsizei n, SemaphoreID *semaphoresPacked); \
void getSemaphoreParameterui64v(GLuint semaphore, GLenum pname, GLuint64 *params); \ void getSemaphoreParameterui64v(SemaphoreID semaphorePacked, GLenum pname, GLuint64 *params); \
GLboolean isSemaphore(GLuint semaphore); \ GLboolean isSemaphore(SemaphoreID semaphorePacked); \
void semaphoreParameterui64v(GLuint semaphore, GLenum pname, const GLuint64 *params); \ void semaphoreParameterui64v(SemaphoreID semaphorePacked, GLenum pname, \
void signalSemaphore(GLuint semaphore, GLuint numBufferBarriers, \ const GLuint64 *params); \
void signalSemaphore(SemaphoreID semaphorePacked, GLuint numBufferBarriers, \
const BufferID *buffersPacked, GLuint numTextureBarriers, \ const BufferID *buffersPacked, GLuint numTextureBarriers, \
const TextureID *texturesPacked, const GLenum *dstLayouts); \ const TextureID *texturesPacked, const GLenum *dstLayouts); \
void waitSemaphore(GLuint semaphore, GLuint numBufferBarriers, const BufferID *buffersPacked, \ void waitSemaphore(SemaphoreID semaphorePacked, GLuint numBufferBarriers, \
GLuint numTextureBarriers, const TextureID *texturesPacked, \ const BufferID *buffersPacked, GLuint numTextureBarriers, \
const GLenum *srcLayouts); \ const TextureID *texturesPacked, const GLenum *srcLayouts); \
/* GL_EXT_semaphore_fd */ \ /* GL_EXT_semaphore_fd */ \
void importSemaphoreFd(GLuint semaphore, HandleType handleTypePacked, GLint fd); \ void importSemaphoreFd(SemaphoreID semaphorePacked, HandleType handleTypePacked, GLint fd); \
/* GL_EXT_texture_storage */ \ /* GL_EXT_texture_storage */ \
void texStorage1D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); \ void texStorage1D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); \
/* GL_KHR_debug */ \ /* GL_KHR_debug */ \
......
...@@ -876,6 +876,12 @@ void WriteParamValueToStream<ParamType::TFramebufferID>(std::ostream &os, gl::Fr ...@@ -876,6 +876,12 @@ void WriteParamValueToStream<ParamType::TFramebufferID>(std::ostream &os, gl::Fr
} }
template <> template <>
void WriteParamValueToStream<ParamType::TSemaphoreID>(std::ostream &os, gl::SemaphoreID value)
{
os << value.value;
}
template <>
void WriteParamValueToStream<ParamType::TRenderbufferID>(std::ostream &os, gl::RenderbufferID value) void WriteParamValueToStream<ParamType::TRenderbufferID>(std::ostream &os, gl::RenderbufferID value)
{ {
os << "gRenderbufferMap[" << value.value << "]"; os << "gRenderbufferMap[" << value.value << "]";
......
...@@ -274,6 +274,9 @@ void WriteParamValueToStream<ParamType::TShaderProgramID>(std::ostream &os, ...@@ -274,6 +274,9 @@ void WriteParamValueToStream<ParamType::TShaderProgramID>(std::ostream &os,
gl::ShaderProgramID value); gl::ShaderProgramID value);
template <> template <>
void WriteParamValueToStream<ParamType::TSemaphoreID>(std::ostream &os, gl::SemaphoreID value);
template <>
void WriteParamValueToStream<ParamType::TRenderbufferID>(std::ostream &os, void WriteParamValueToStream<ParamType::TRenderbufferID>(std::ostream &os,
gl::RenderbufferID value); gl::RenderbufferID value);
......
...@@ -555,21 +555,21 @@ void SemaphoreManager::reset(const Context *context) ...@@ -555,21 +555,21 @@ void SemaphoreManager::reset(const Context *context)
{ {
while (!mSemaphores.empty()) while (!mSemaphores.empty())
{ {
deleteSemaphore(context, mSemaphores.begin()->first); deleteSemaphore(context, {mSemaphores.begin()->first});
} }
mSemaphores.clear(); mSemaphores.clear();
} }
GLuint SemaphoreManager::createSemaphore(rx::GLImplFactory *factory) SemaphoreID SemaphoreManager::createSemaphore(rx::GLImplFactory *factory)
{ {
GLuint handle = mHandleAllocator.allocate(); SemaphoreID handle = SemaphoreID{mHandleAllocator.allocate()};
Semaphore *semaphore = new Semaphore(factory, handle); Semaphore *semaphore = new Semaphore(factory, handle);
semaphore->addRef(); semaphore->addRef();
mSemaphores.assign(handle, semaphore); mSemaphores.assign(handle, semaphore);
return handle; return handle;
} }
void SemaphoreManager::deleteSemaphore(const Context *context, GLuint handle) void SemaphoreManager::deleteSemaphore(const Context *context, SemaphoreID handle)
{ {
Semaphore *semaphore = nullptr; Semaphore *semaphore = nullptr;
if (!mSemaphores.erase(handle, &semaphore)) if (!mSemaphores.erase(handle, &semaphore))
...@@ -578,7 +578,7 @@ void SemaphoreManager::deleteSemaphore(const Context *context, GLuint handle) ...@@ -578,7 +578,7 @@ void SemaphoreManager::deleteSemaphore(const Context *context, GLuint handle)
} }
// Requires an explicit this-> because of C++ template rules. // Requires an explicit this-> because of C++ template rules.
this->mHandleAllocator.release(handle); this->mHandleAllocator.release(handle.value);
if (semaphore) if (semaphore)
{ {
...@@ -586,7 +586,7 @@ void SemaphoreManager::deleteSemaphore(const Context *context, GLuint handle) ...@@ -586,7 +586,7 @@ void SemaphoreManager::deleteSemaphore(const Context *context, GLuint handle)
} }
} }
Semaphore *SemaphoreManager::getSemaphore(GLuint handle) const Semaphore *SemaphoreManager::getSemaphore(SemaphoreID handle) const
{ {
return mSemaphores.query(handle); return mSemaphores.query(handle);
} }
......
...@@ -346,9 +346,9 @@ class SemaphoreManager : public ResourceManagerBase<HandleAllocator> ...@@ -346,9 +346,9 @@ class SemaphoreManager : public ResourceManagerBase<HandleAllocator>
public: public:
SemaphoreManager(); SemaphoreManager();
GLuint createSemaphore(rx::GLImplFactory *factory); SemaphoreID createSemaphore(rx::GLImplFactory *factory);
void deleteSemaphore(const Context *context, GLuint handle); void deleteSemaphore(const Context *context, SemaphoreID handle);
Semaphore *getSemaphore(GLuint handle) const; Semaphore *getSemaphore(SemaphoreID handle) const;
protected: protected:
~SemaphoreManager() override; ~SemaphoreManager() override;
...@@ -356,7 +356,7 @@ class SemaphoreManager : public ResourceManagerBase<HandleAllocator> ...@@ -356,7 +356,7 @@ class SemaphoreManager : public ResourceManagerBase<HandleAllocator>
private: private:
void reset(const Context *context) override; void reset(const Context *context) override;
ResourceMap<Semaphore> mSemaphores; ResourceMap<Semaphore, SemaphoreID> mSemaphores;
}; };
} // namespace gl } // namespace gl
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
namespace gl namespace gl
{ {
Semaphore::Semaphore(rx::GLImplFactory *factory, GLuint id) Semaphore::Semaphore(rx::GLImplFactory *factory, SemaphoreID id)
: RefCountObject(id), mImplementation(factory->createSemaphore()) : RefCountObject(id.value), mImplementation(factory->createSemaphore())
{} {}
Semaphore::~Semaphore() {} Semaphore::~Semaphore() {}
......
...@@ -30,7 +30,7 @@ class Context; ...@@ -30,7 +30,7 @@ class Context;
class Semaphore final : public RefCountObject class Semaphore final : public RefCountObject
{ {
public: public:
Semaphore(rx::GLImplFactory *factory, GLuint id); Semaphore(rx::GLImplFactory *factory, SemaphoreID id);
~Semaphore() override; ~Semaphore() override;
void onDestroy(const Context *context) override; void onDestroy(const Context *context) override;
......
...@@ -1196,28 +1196,28 @@ angle::CallCapture CaptureReadnPixelsEXT(const Context *context, ...@@ -1196,28 +1196,28 @@ angle::CallCapture CaptureReadnPixelsEXT(const Context *context,
angle::CallCapture CaptureDeleteSemaphoresEXT(const Context *context, angle::CallCapture CaptureDeleteSemaphoresEXT(const Context *context,
bool isCallValid, bool isCallValid,
GLsizei n, GLsizei n,
const GLuint *semaphores); const SemaphoreID *semaphoresPacked);
angle::CallCapture CaptureGenSemaphoresEXT(const Context *context, angle::CallCapture CaptureGenSemaphoresEXT(const Context *context,
bool isCallValid, bool isCallValid,
GLsizei n, GLsizei n,
GLuint *semaphores); SemaphoreID *semaphoresPacked);
angle::CallCapture CaptureGetSemaphoreParameterui64vEXT(const Context *context, angle::CallCapture CaptureGetSemaphoreParameterui64vEXT(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLenum pname, GLenum pname,
GLuint64 *params); GLuint64 *params);
angle::CallCapture CaptureIsSemaphoreEXT(const Context *context, angle::CallCapture CaptureIsSemaphoreEXT(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLboolean returnValue); GLboolean returnValue);
angle::CallCapture CaptureSemaphoreParameterui64vEXT(const Context *context, angle::CallCapture CaptureSemaphoreParameterui64vEXT(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLenum pname, GLenum pname,
const GLuint64 *params); const GLuint64 *params);
angle::CallCapture CaptureSignalSemaphoreEXT(const Context *context, angle::CallCapture CaptureSignalSemaphoreEXT(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffersPacked, const BufferID *buffersPacked,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -1225,7 +1225,7 @@ angle::CallCapture CaptureSignalSemaphoreEXT(const Context *context, ...@@ -1225,7 +1225,7 @@ angle::CallCapture CaptureSignalSemaphoreEXT(const Context *context,
const GLenum *dstLayouts); const GLenum *dstLayouts);
angle::CallCapture CaptureWaitSemaphoreEXT(const Context *context, angle::CallCapture CaptureWaitSemaphoreEXT(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffersPacked, const BufferID *buffersPacked,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -1235,7 +1235,7 @@ angle::CallCapture CaptureWaitSemaphoreEXT(const Context *context, ...@@ -1235,7 +1235,7 @@ angle::CallCapture CaptureWaitSemaphoreEXT(const Context *context,
// GL_EXT_semaphore_fd // GL_EXT_semaphore_fd
angle::CallCapture CaptureImportSemaphoreFdEXT(const Context *context, angle::CallCapture CaptureImportSemaphoreFdEXT(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
HandleType handleTypePacked, HandleType handleTypePacked,
GLint fd); GLint fd);
...@@ -3345,31 +3345,31 @@ void CaptureReadnPixelsEXT_data(const Context *context, ...@@ -3345,31 +3345,31 @@ void CaptureReadnPixelsEXT_data(const Context *context,
GLsizei bufSize, GLsizei bufSize,
void *data, void *data,
angle::ParamCapture *paramCapture); angle::ParamCapture *paramCapture);
void CaptureDeleteSemaphoresEXT_semaphores(const Context *context, void CaptureDeleteSemaphoresEXT_semaphoresPacked(const Context *context,
bool isCallValid, bool isCallValid,
GLsizei n, GLsizei n,
const GLuint *semaphores, const SemaphoreID *semaphoresPacked,
angle::ParamCapture *paramCapture); angle::ParamCapture *paramCapture);
void CaptureGenSemaphoresEXT_semaphores(const Context *context, void CaptureGenSemaphoresEXT_semaphoresPacked(const Context *context,
bool isCallValid, bool isCallValid,
GLsizei n, GLsizei n,
GLuint *semaphores, SemaphoreID *semaphoresPacked,
angle::ParamCapture *paramCapture); angle::ParamCapture *paramCapture);
void CaptureGetSemaphoreParameterui64vEXT_params(const Context *context, void CaptureGetSemaphoreParameterui64vEXT_params(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLenum pname, GLenum pname,
GLuint64 *params, GLuint64 *params,
angle::ParamCapture *paramCapture); angle::ParamCapture *paramCapture);
void CaptureSemaphoreParameterui64vEXT_params(const Context *context, void CaptureSemaphoreParameterui64vEXT_params(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLenum pname, GLenum pname,
const GLuint64 *params, const GLuint64 *params,
angle::ParamCapture *paramCapture); angle::ParamCapture *paramCapture);
void CaptureSignalSemaphoreEXT_buffersPacked(const Context *context, void CaptureSignalSemaphoreEXT_buffersPacked(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffersPacked, const BufferID *buffersPacked,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -3378,7 +3378,7 @@ void CaptureSignalSemaphoreEXT_buffersPacked(const Context *context, ...@@ -3378,7 +3378,7 @@ void CaptureSignalSemaphoreEXT_buffersPacked(const Context *context,
angle::ParamCapture *paramCapture); angle::ParamCapture *paramCapture);
void CaptureSignalSemaphoreEXT_texturesPacked(const Context *context, void CaptureSignalSemaphoreEXT_texturesPacked(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffersPacked, const BufferID *buffersPacked,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -3387,7 +3387,7 @@ void CaptureSignalSemaphoreEXT_texturesPacked(const Context *context, ...@@ -3387,7 +3387,7 @@ void CaptureSignalSemaphoreEXT_texturesPacked(const Context *context,
angle::ParamCapture *paramCapture); angle::ParamCapture *paramCapture);
void CaptureSignalSemaphoreEXT_dstLayouts(const Context *context, void CaptureSignalSemaphoreEXT_dstLayouts(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffersPacked, const BufferID *buffersPacked,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -3396,7 +3396,7 @@ void CaptureSignalSemaphoreEXT_dstLayouts(const Context *context, ...@@ -3396,7 +3396,7 @@ void CaptureSignalSemaphoreEXT_dstLayouts(const Context *context,
angle::ParamCapture *paramCapture); angle::ParamCapture *paramCapture);
void CaptureWaitSemaphoreEXT_buffersPacked(const Context *context, void CaptureWaitSemaphoreEXT_buffersPacked(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffersPacked, const BufferID *buffersPacked,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -3405,7 +3405,7 @@ void CaptureWaitSemaphoreEXT_buffersPacked(const Context *context, ...@@ -3405,7 +3405,7 @@ void CaptureWaitSemaphoreEXT_buffersPacked(const Context *context,
angle::ParamCapture *paramCapture); angle::ParamCapture *paramCapture);
void CaptureWaitSemaphoreEXT_texturesPacked(const Context *context, void CaptureWaitSemaphoreEXT_texturesPacked(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffersPacked, const BufferID *buffersPacked,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -3414,7 +3414,7 @@ void CaptureWaitSemaphoreEXT_texturesPacked(const Context *context, ...@@ -3414,7 +3414,7 @@ void CaptureWaitSemaphoreEXT_texturesPacked(const Context *context,
angle::ParamCapture *paramCapture); angle::ParamCapture *paramCapture);
void CaptureWaitSemaphoreEXT_srcLayouts(const Context *context, void CaptureWaitSemaphoreEXT_srcLayouts(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphorePacked,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffersPacked, const BufferID *buffersPacked,
GLuint numTextureBarriers, GLuint numTextureBarriers,
......
...@@ -2354,27 +2354,27 @@ void CaptureReadnPixelsEXT_data(const Context *context, ...@@ -2354,27 +2354,27 @@ void CaptureReadnPixelsEXT_data(const Context *context,
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
void CaptureDeleteSemaphoresEXT_semaphores(const Context *context, void CaptureDeleteSemaphoresEXT_semaphoresPacked(const Context *context,
bool isCallValid, bool isCallValid,
GLsizei n, GLsizei n,
const GLuint *semaphores, const SemaphoreID *semaphores,
ParamCapture *paramCapture) ParamCapture *paramCapture)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
void CaptureGenSemaphoresEXT_semaphores(const Context *context, void CaptureGenSemaphoresEXT_semaphoresPacked(const Context *context,
bool isCallValid, bool isCallValid,
GLsizei n, GLsizei n,
GLuint *semaphores, SemaphoreID *semaphores,
ParamCapture *paramCapture) ParamCapture *paramCapture)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
void CaptureGetSemaphoreParameterui64vEXT_params(const Context *context, void CaptureGetSemaphoreParameterui64vEXT_params(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphore,
GLenum pname, GLenum pname,
GLuint64 *params, GLuint64 *params,
ParamCapture *paramCapture) ParamCapture *paramCapture)
...@@ -2384,7 +2384,7 @@ void CaptureGetSemaphoreParameterui64vEXT_params(const Context *context, ...@@ -2384,7 +2384,7 @@ void CaptureGetSemaphoreParameterui64vEXT_params(const Context *context,
void CaptureSemaphoreParameterui64vEXT_params(const Context *context, void CaptureSemaphoreParameterui64vEXT_params(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphore,
GLenum pname, GLenum pname,
const GLuint64 *params, const GLuint64 *params,
ParamCapture *paramCapture) ParamCapture *paramCapture)
...@@ -2394,7 +2394,7 @@ void CaptureSemaphoreParameterui64vEXT_params(const Context *context, ...@@ -2394,7 +2394,7 @@ void CaptureSemaphoreParameterui64vEXT_params(const Context *context,
void CaptureSignalSemaphoreEXT_buffersPacked(const Context *context, void CaptureSignalSemaphoreEXT_buffersPacked(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphore,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffers, const BufferID *buffers,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -2407,7 +2407,7 @@ void CaptureSignalSemaphoreEXT_buffersPacked(const Context *context, ...@@ -2407,7 +2407,7 @@ void CaptureSignalSemaphoreEXT_buffersPacked(const Context *context,
void CaptureSignalSemaphoreEXT_texturesPacked(const Context *context, void CaptureSignalSemaphoreEXT_texturesPacked(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphore,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffers, const BufferID *buffers,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -2420,7 +2420,7 @@ void CaptureSignalSemaphoreEXT_texturesPacked(const Context *context, ...@@ -2420,7 +2420,7 @@ void CaptureSignalSemaphoreEXT_texturesPacked(const Context *context,
void CaptureSignalSemaphoreEXT_dstLayouts(const Context *context, void CaptureSignalSemaphoreEXT_dstLayouts(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphore,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffers, const BufferID *buffers,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -2433,7 +2433,7 @@ void CaptureSignalSemaphoreEXT_dstLayouts(const Context *context, ...@@ -2433,7 +2433,7 @@ void CaptureSignalSemaphoreEXT_dstLayouts(const Context *context,
void CaptureWaitSemaphoreEXT_buffersPacked(const Context *context, void CaptureWaitSemaphoreEXT_buffersPacked(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphore,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffers, const BufferID *buffers,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -2446,7 +2446,7 @@ void CaptureWaitSemaphoreEXT_buffersPacked(const Context *context, ...@@ -2446,7 +2446,7 @@ void CaptureWaitSemaphoreEXT_buffersPacked(const Context *context,
void CaptureWaitSemaphoreEXT_texturesPacked(const Context *context, void CaptureWaitSemaphoreEXT_texturesPacked(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphore,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffers, const BufferID *buffers,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -2459,7 +2459,7 @@ void CaptureWaitSemaphoreEXT_texturesPacked(const Context *context, ...@@ -2459,7 +2459,7 @@ void CaptureWaitSemaphoreEXT_texturesPacked(const Context *context,
void CaptureWaitSemaphoreEXT_srcLayouts(const Context *context, void CaptureWaitSemaphoreEXT_srcLayouts(const Context *context,
bool isCallValid, bool isCallValid,
GLuint semaphore, SemaphoreID semaphore,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffers, const BufferID *buffers,
GLuint numTextureBarriers, GLuint numTextureBarriers,
......
...@@ -330,6 +330,17 @@ void WriteParamTypeToStream(std::ostream &os, ParamType paramType, const ParamVa ...@@ -330,6 +330,17 @@ void WriteParamTypeToStream(std::ostream &os, ParamType paramType, const ParamVa
WriteParamValueToStream<ParamType::TSamplerIDPointer>(os, WriteParamValueToStream<ParamType::TSamplerIDPointer>(os,
paramValue.SamplerIDPointerVal); paramValue.SamplerIDPointerVal);
break; break;
case ParamType::TSemaphoreID:
WriteParamValueToStream<ParamType::TSemaphoreID>(os, paramValue.SemaphoreIDVal);
break;
case ParamType::TSemaphoreIDConstPointer:
WriteParamValueToStream<ParamType::TSemaphoreIDConstPointer>(
os, paramValue.SemaphoreIDConstPointerVal);
break;
case ParamType::TSemaphoreIDPointer:
WriteParamValueToStream<ParamType::TSemaphoreIDPointer>(
os, paramValue.SemaphoreIDPointerVal);
break;
case ParamType::TShaderProgramID: case ParamType::TShaderProgramID:
WriteParamValueToStream<ParamType::TShaderProgramID>(os, paramValue.ShaderProgramIDVal); WriteParamValueToStream<ParamType::TShaderProgramID>(os, paramValue.ShaderProgramIDVal);
break; break;
...@@ -583,6 +594,12 @@ const char *ParamTypeToString(ParamType paramType) ...@@ -583,6 +594,12 @@ const char *ParamTypeToString(ParamType paramType)
return "const GLuint *"; return "const GLuint *";
case ParamType::TSamplerIDPointer: case ParamType::TSamplerIDPointer:
return "GLuint *"; return "GLuint *";
case ParamType::TSemaphoreID:
return "GLuint";
case ParamType::TSemaphoreIDConstPointer:
return "const GLuint *";
case ParamType::TSemaphoreIDPointer:
return "GLuint *";
case ParamType::TShaderProgramID: case ParamType::TShaderProgramID:
return "GLuint"; return "GLuint";
case ParamType::TShaderProgramIDConstPointer: case ParamType::TShaderProgramIDConstPointer:
......
...@@ -108,6 +108,9 @@ enum class ParamType ...@@ -108,6 +108,9 @@ enum class ParamType
TSamplerID, TSamplerID,
TSamplerIDConstPointer, TSamplerIDConstPointer,
TSamplerIDPointer, TSamplerIDPointer,
TSemaphoreID,
TSemaphoreIDConstPointer,
TSemaphoreIDPointer,
TShaderProgramID, TShaderProgramID,
TShaderProgramIDConstPointer, TShaderProgramIDConstPointer,
TShaderProgramIDPointer, TShaderProgramIDPointer,
...@@ -220,6 +223,9 @@ union ParamValue ...@@ -220,6 +223,9 @@ union ParamValue
gl::SamplerID SamplerIDVal; gl::SamplerID SamplerIDVal;
const gl::SamplerID *SamplerIDConstPointerVal; const gl::SamplerID *SamplerIDConstPointerVal;
gl::SamplerID *SamplerIDPointerVal; gl::SamplerID *SamplerIDPointerVal;
gl::SemaphoreID SemaphoreIDVal;
const gl::SemaphoreID *SemaphoreIDConstPointerVal;
gl::SemaphoreID *SemaphoreIDPointerVal;
gl::ShaderProgramID ShaderProgramIDVal; gl::ShaderProgramID ShaderProgramIDVal;
const gl::ShaderProgramID *ShaderProgramIDConstPointerVal; const gl::ShaderProgramID *ShaderProgramIDConstPointerVal;
gl::ShaderProgramID *ShaderProgramIDPointerVal; gl::ShaderProgramID *ShaderProgramIDPointerVal;
...@@ -840,6 +846,27 @@ inline gl::SamplerID *GetParamVal<ParamType::TSamplerIDPointer, gl::SamplerID *> ...@@ -840,6 +846,27 @@ inline gl::SamplerID *GetParamVal<ParamType::TSamplerIDPointer, gl::SamplerID *>
} }
template <> template <>
inline gl::SemaphoreID GetParamVal<ParamType::TSemaphoreID, gl::SemaphoreID>(
const ParamValue &value)
{
return value.SemaphoreIDVal;
}
template <>
inline const gl::SemaphoreID *
GetParamVal<ParamType::TSemaphoreIDConstPointer, const gl::SemaphoreID *>(const ParamValue &value)
{
return value.SemaphoreIDConstPointerVal;
}
template <>
inline gl::SemaphoreID *GetParamVal<ParamType::TSemaphoreIDPointer, gl::SemaphoreID *>(
const ParamValue &value)
{
return value.SemaphoreIDPointerVal;
}
template <>
inline gl::ShaderProgramID GetParamVal<ParamType::TShaderProgramID, gl::ShaderProgramID>( inline gl::ShaderProgramID GetParamVal<ParamType::TShaderProgramID, gl::ShaderProgramID>(
const ParamValue &value) const ParamValue &value)
{ {
...@@ -1147,6 +1174,12 @@ T AccessParamValue(ParamType paramType, const ParamValue &value) ...@@ -1147,6 +1174,12 @@ T AccessParamValue(ParamType paramType, const ParamValue &value)
return GetParamVal<ParamType::TSamplerIDConstPointer, T>(value); return GetParamVal<ParamType::TSamplerIDConstPointer, T>(value);
case ParamType::TSamplerIDPointer: case ParamType::TSamplerIDPointer:
return GetParamVal<ParamType::TSamplerIDPointer, T>(value); return GetParamVal<ParamType::TSamplerIDPointer, T>(value);
case ParamType::TSemaphoreID:
return GetParamVal<ParamType::TSemaphoreID, T>(value);
case ParamType::TSemaphoreIDConstPointer:
return GetParamVal<ParamType::TSemaphoreIDConstPointer, T>(value);
case ParamType::TSemaphoreIDPointer:
return GetParamVal<ParamType::TSemaphoreIDPointer, T>(value);
case ParamType::TShaderProgramID: case ParamType::TShaderProgramID:
return GetParamVal<ParamType::TShaderProgramID, T>(value); return GetParamVal<ParamType::TShaderProgramID, T>(value);
case ParamType::TShaderProgramIDConstPointer: case ParamType::TShaderProgramIDConstPointer:
...@@ -1769,6 +1802,26 @@ inline void SetParamVal<ParamType::TSamplerIDPointer>(gl::SamplerID *valueIn, Pa ...@@ -1769,6 +1802,26 @@ inline void SetParamVal<ParamType::TSamplerIDPointer>(gl::SamplerID *valueIn, Pa
} }
template <> template <>
inline void SetParamVal<ParamType::TSemaphoreID>(gl::SemaphoreID valueIn, ParamValue *valueOut)
{
valueOut->SemaphoreIDVal = valueIn;
}
template <>
inline void SetParamVal<ParamType::TSemaphoreIDConstPointer>(const gl::SemaphoreID *valueIn,
ParamValue *valueOut)
{
valueOut->SemaphoreIDConstPointerVal = valueIn;
}
template <>
inline void SetParamVal<ParamType::TSemaphoreIDPointer>(gl::SemaphoreID *valueIn,
ParamValue *valueOut)
{
valueOut->SemaphoreIDPointerVal = valueIn;
}
template <>
inline void SetParamVal<ParamType::TShaderProgramID>(gl::ShaderProgramID valueIn, inline void SetParamVal<ParamType::TShaderProgramID>(gl::ShaderProgramID valueIn,
ParamValue *valueOut) ParamValue *valueOut)
{ {
...@@ -2162,6 +2215,15 @@ void InitParamValue(ParamType paramType, T valueIn, ParamValue *valueOut) ...@@ -2162,6 +2215,15 @@ void InitParamValue(ParamType paramType, T valueIn, ParamValue *valueOut)
case ParamType::TSamplerIDPointer: case ParamType::TSamplerIDPointer:
SetParamVal<ParamType::TSamplerIDPointer>(valueIn, valueOut); SetParamVal<ParamType::TSamplerIDPointer>(valueIn, valueOut);
break; break;
case ParamType::TSemaphoreID:
SetParamVal<ParamType::TSemaphoreID>(valueIn, valueOut);
break;
case ParamType::TSemaphoreIDConstPointer:
SetParamVal<ParamType::TSemaphoreIDConstPointer>(valueIn, valueOut);
break;
case ParamType::TSemaphoreIDPointer:
SetParamVal<ParamType::TSemaphoreIDPointer>(valueIn, valueOut);
break;
case ParamType::TShaderProgramID: case ParamType::TShaderProgramID:
SetParamVal<ParamType::TShaderProgramID>(valueIn, valueOut); SetParamVal<ParamType::TShaderProgramID>(valueIn, valueOut);
break; break;
......
...@@ -3400,7 +3400,7 @@ bool ValidateImportMemoryFdEXT(Context *context, ...@@ -3400,7 +3400,7 @@ bool ValidateImportMemoryFdEXT(Context *context,
return true; return true;
} }
bool ValidateDeleteSemaphoresEXT(Context *context, GLsizei n, const GLuint *semaphores) bool ValidateDeleteSemaphoresEXT(Context *context, GLsizei n, const SemaphoreID *semaphores)
{ {
if (!context->getExtensions().semaphore) if (!context->getExtensions().semaphore)
{ {
...@@ -3411,7 +3411,7 @@ bool ValidateDeleteSemaphoresEXT(Context *context, GLsizei n, const GLuint *sema ...@@ -3411,7 +3411,7 @@ bool ValidateDeleteSemaphoresEXT(Context *context, GLsizei n, const GLuint *sema
return ValidateGenOrDelete(context, n); return ValidateGenOrDelete(context, n);
} }
bool ValidateGenSemaphoresEXT(Context *context, GLsizei n, GLuint *semaphores) bool ValidateGenSemaphoresEXT(Context *context, GLsizei n, SemaphoreID *semaphores)
{ {
if (!context->getExtensions().semaphore) if (!context->getExtensions().semaphore)
{ {
...@@ -3423,7 +3423,7 @@ bool ValidateGenSemaphoresEXT(Context *context, GLsizei n, GLuint *semaphores) ...@@ -3423,7 +3423,7 @@ bool ValidateGenSemaphoresEXT(Context *context, GLsizei n, GLuint *semaphores)
} }
bool ValidateGetSemaphoreParameterui64vEXT(Context *context, bool ValidateGetSemaphoreParameterui64vEXT(Context *context,
GLuint semaphore, SemaphoreID semaphore,
GLenum pname, GLenum pname,
GLuint64 *params) GLuint64 *params)
{ {
...@@ -3437,7 +3437,7 @@ bool ValidateGetSemaphoreParameterui64vEXT(Context *context, ...@@ -3437,7 +3437,7 @@ bool ValidateGetSemaphoreParameterui64vEXT(Context *context,
return false; return false;
} }
bool ValidateIsSemaphoreEXT(Context *context, GLuint semaphore) bool ValidateIsSemaphoreEXT(Context *context, SemaphoreID semaphore)
{ {
if (!context->getExtensions().semaphore) if (!context->getExtensions().semaphore)
{ {
...@@ -3449,7 +3449,7 @@ bool ValidateIsSemaphoreEXT(Context *context, GLuint semaphore) ...@@ -3449,7 +3449,7 @@ bool ValidateIsSemaphoreEXT(Context *context, GLuint semaphore)
} }
bool ValidateSemaphoreParameterui64vEXT(Context *context, bool ValidateSemaphoreParameterui64vEXT(Context *context,
GLuint semaphore, SemaphoreID semaphore,
GLenum pname, GLenum pname,
const GLuint64 *params) const GLuint64 *params)
{ {
...@@ -3464,7 +3464,7 @@ bool ValidateSemaphoreParameterui64vEXT(Context *context, ...@@ -3464,7 +3464,7 @@ bool ValidateSemaphoreParameterui64vEXT(Context *context,
} }
bool ValidateSignalSemaphoreEXT(Context *context, bool ValidateSignalSemaphoreEXT(Context *context,
GLuint semaphore, SemaphoreID semaphore,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffers, const BufferID *buffers,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -3490,7 +3490,7 @@ bool ValidateSignalSemaphoreEXT(Context *context, ...@@ -3490,7 +3490,7 @@ bool ValidateSignalSemaphoreEXT(Context *context,
} }
bool ValidateWaitSemaphoreEXT(Context *context, bool ValidateWaitSemaphoreEXT(Context *context,
GLuint semaphore, SemaphoreID semaphore,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffers, const BufferID *buffers,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -3516,7 +3516,7 @@ bool ValidateWaitSemaphoreEXT(Context *context, ...@@ -3516,7 +3516,7 @@ bool ValidateWaitSemaphoreEXT(Context *context,
} }
bool ValidateImportSemaphoreFdEXT(Context *context, bool ValidateImportSemaphoreFdEXT(Context *context,
GLuint semaphore, SemaphoreID semaphore,
HandleType handleType, HandleType handleType,
GLint fd) GLint fd)
{ {
......
...@@ -952,26 +952,26 @@ bool ValidateReadnPixelsEXT(Context *context, ...@@ -952,26 +952,26 @@ bool ValidateReadnPixelsEXT(Context *context,
void *data); void *data);
// GL_EXT_semaphore // GL_EXT_semaphore
bool ValidateDeleteSemaphoresEXT(Context *context, GLsizei n, const GLuint *semaphores); bool ValidateDeleteSemaphoresEXT(Context *context, GLsizei n, const SemaphoreID *semaphoresPacked);
bool ValidateGenSemaphoresEXT(Context *context, GLsizei n, GLuint *semaphores); bool ValidateGenSemaphoresEXT(Context *context, GLsizei n, SemaphoreID *semaphoresPacked);
bool ValidateGetSemaphoreParameterui64vEXT(Context *context, bool ValidateGetSemaphoreParameterui64vEXT(Context *context,
GLuint semaphore, SemaphoreID semaphorePacked,
GLenum pname, GLenum pname,
GLuint64 *params); GLuint64 *params);
bool ValidateIsSemaphoreEXT(Context *context, GLuint semaphore); bool ValidateIsSemaphoreEXT(Context *context, SemaphoreID semaphorePacked);
bool ValidateSemaphoreParameterui64vEXT(Context *context, bool ValidateSemaphoreParameterui64vEXT(Context *context,
GLuint semaphore, SemaphoreID semaphorePacked,
GLenum pname, GLenum pname,
const GLuint64 *params); const GLuint64 *params);
bool ValidateSignalSemaphoreEXT(Context *context, bool ValidateSignalSemaphoreEXT(Context *context,
GLuint semaphore, SemaphoreID semaphorePacked,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffersPacked, const BufferID *buffersPacked,
GLuint numTextureBarriers, GLuint numTextureBarriers,
const TextureID *texturesPacked, const TextureID *texturesPacked,
const GLenum *dstLayouts); const GLenum *dstLayouts);
bool ValidateWaitSemaphoreEXT(Context *context, bool ValidateWaitSemaphoreEXT(Context *context,
GLuint semaphore, SemaphoreID semaphorePacked,
GLuint numBufferBarriers, GLuint numBufferBarriers,
const BufferID *buffersPacked, const BufferID *buffersPacked,
GLuint numTextureBarriers, GLuint numTextureBarriers,
...@@ -980,7 +980,7 @@ bool ValidateWaitSemaphoreEXT(Context *context, ...@@ -980,7 +980,7 @@ bool ValidateWaitSemaphoreEXT(Context *context,
// GL_EXT_semaphore_fd // GL_EXT_semaphore_fd
bool ValidateImportSemaphoreFdEXT(Context *context, bool ValidateImportSemaphoreFdEXT(Context *context,
GLuint semaphore, SemaphoreID semaphorePacked,
HandleType handleTypePacked, HandleType handleTypePacked,
GLint fd); GLint fd);
......
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