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