Commit 9deb3bfa by Jiacheng Lu Committed by Commit Bot

Use MemoryObjectID in place of GLuint handle

Bug: angleproject:3804 Change-Id: I7ca86089fe1e72c136c0fc1947ad43cecee122eb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769544 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent a3c7c2ff
......@@ -4,7 +4,7 @@
"scripts/egl_angle_ext.xml":
"fc2e249239fb1365f6d145cdf1a3cfcf",
"scripts/entry_point_packed_gl_enums.json":
"8451cf7defe0d98dac54fcbf37614e73",
"2a487e33d95a56c409b1b9828fa0540e",
"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":
"c7176e590dfc07ec670f2cb678154789",
"593b3d3d806e2e5a3d695c9753f22aa7",
"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":
"efca1e085a34165f2ac13107d6778436",
"43ac9f3e72fb3192a8ed6d2e429684ab",
"src/libANGLE/capture_gles_ext_autogen.h":
"7b955199f769acdbb9a37b4e2d22487e",
"b615990d9059baff07d96ce39c2ca486",
"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":
"0542fbffae8f723d49f5014ff2b12e49",
"a10fb5ea447d2a82d84407a78ac46274",
"src/libANGLE/frame_capture_utils_autogen.h":
"594024324a582c72a4ba6f82ac4b8966",
"5b19dd9bd714fb6dbcd5ac4ca4bf2bc5",
"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":
"63effdeb898b95959057c2e9c084cb28",
"b4e3538e7d8d4e7e9ca3cf23aea96293",
"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":
"9f98d7515bb0794c89e4f8f3bef07942",
"68680cde7f8d4602adfdb0d0cf62cd01",
"src/libGLESv2/entry_points_gles_ext_autogen.h":
"fea36fa137e55dd2f244dbb49d31cc41",
"src/libGLESv2/libGLESv2_autogen.cpp":
......
......@@ -68,7 +68,8 @@
"usage": "BufferUsage"
},
"glBufferStorageMem": {
"target": "TextureType"
"target": "TextureType",
"memory": "MemoryObjectID"
},
"glBufferSubData": {
"target": "BufferBinding"
......@@ -463,6 +464,7 @@
"texture": "TextureID"
},
"glImportMemoryFd": {
"memory": "MemoryObjectID",
"handleType": "HandleType"
},
"glImportSemaphoreFd": {
......@@ -750,16 +752,20 @@
"target": "TextureType"
},
"glTexStorageMem2D": {
"target": "TextureType"
"target": "TextureType",
"memory": "MemoryObjectID"
},
"glTexStorageMem2DMultisample": {
"target": "TextureType"
"target": "TextureType",
"memory": "MemoryObjectID"
},
"glTexStorageMem3D": {
"target": "TextureType"
"target": "TextureType",
"memory": "MemoryObjectID"
},
"glTexStorageMem3DMultisample": {
"target": "TextureType"
"target": "TextureType",
"memory": "MemoryObjectID"
},
"glTexSubImage2D": {
"target": "TextureTarget"
......@@ -1529,5 +1535,20 @@
},
"glGetSemaphoreParameterui64v": {
"semaphore": "SemaphoreID"
},
"glIsMemoryObject": {
"memoryObject": "MemoryObjectID"
},
"glDeleteMemoryObjects": {
"memoryObjects": "const MemoryObjectID *"
},
"glCreateMemoryObjects": {
"memoryObjects": "MemoryObjectID *"
},
"glMemoryObjectParameteriv": {
"memoryObject": "MemoryObjectID"
},
"glGetMemoryObjectParameteriv": {
"memoryObject": "MemoryObjectID"
}
}
......@@ -396,6 +396,11 @@ struct SemaphoreID
GLuint value;
};
struct MemoryObjectID
{
GLuint value;
};
struct RenderbufferID
{
GLuint value;
......
......@@ -745,7 +745,7 @@ GLuint Context::createShaderProgramv(ShaderType type, GLsizei count, const GLcha
return 0u;
}
GLuint Context::createMemoryObject()
MemoryObjectID Context::createMemoryObject()
{
return mState.mMemoryObjectManager->createMemoryObject(mImplementation.get());
}
......@@ -815,7 +815,7 @@ void Context::deleteProgramPipeline(ProgramPipelineID pipeline)
mState.mProgramPipelineManager->deleteObject(this, pipeline);
}
void Context::deleteMemoryObject(GLuint memoryObject)
void Context::deleteMemoryObject(MemoryObjectID memoryObject)
{
mState.mMemoryObjectManager->deleteMemoryObject(this, memoryObject);
}
......@@ -6127,7 +6127,7 @@ void Context::getProgramPipelineiv(ProgramPipelineID pipeline, GLenum pname, GLi
UNIMPLEMENTED();
}
MemoryObject *Context::getMemoryObject(GLuint handle) const
MemoryObject *Context::getMemoryObject(MemoryObjectID handle) const
{
return mState.mMemoryObjectManager->getMemoryObject(handle);
}
......@@ -7619,7 +7619,7 @@ GLboolean Context::testFenceNV(FenceNVID fence)
return result;
}
void Context::deleteMemoryObjects(GLsizei n, const GLuint *memoryObjects)
void Context::deleteMemoryObjects(GLsizei n, const MemoryObjectID *memoryObjects)
{
for (int i = 0; i < n; i++)
{
......@@ -7627,9 +7627,9 @@ void Context::deleteMemoryObjects(GLsizei n, const GLuint *memoryObjects)
}
}
GLboolean Context::isMemoryObject(GLuint memoryObject)
GLboolean Context::isMemoryObject(MemoryObjectID memoryObject)
{
if (memoryObject == 0)
if (memoryObject.value == 0)
{
return GL_FALSE;
}
......@@ -7637,7 +7637,7 @@ GLboolean Context::isMemoryObject(GLuint memoryObject)
return ConvertToGLBoolean(getMemoryObject(memoryObject));
}
void Context::createMemoryObjects(GLsizei n, GLuint *memoryObjects)
void Context::createMemoryObjects(GLsizei n, MemoryObjectID *memoryObjects)
{
for (int i = 0; i < n; i++)
{
......@@ -7645,12 +7645,14 @@ void Context::createMemoryObjects(GLsizei n, GLuint *memoryObjects)
}
}
void Context::memoryObjectParameteriv(GLuint memoryObject, GLenum pname, const GLint *params)
void Context::memoryObjectParameteriv(MemoryObjectID memoryObject,
GLenum pname,
const GLint *params)
{
UNIMPLEMENTED();
}
void Context::getMemoryObjectParameteriv(GLuint memoryObject, GLenum pname, GLint *params)
void Context::getMemoryObjectParameteriv(MemoryObjectID memoryObject, GLenum pname, GLint *params)
{
UNIMPLEMENTED();
}
......@@ -7660,7 +7662,7 @@ void Context::texStorageMem2D(TextureType target,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLuint memory,
MemoryObjectID memory,
GLuint64 offset)
{
MemoryObject *memoryObject = getMemoryObject(memory);
......@@ -7677,7 +7679,7 @@ void Context::texStorageMem2DMultisample(TextureType target,
GLsizei width,
GLsizei height,
GLboolean fixedSampleLocations,
GLuint memory,
MemoryObjectID memory,
GLuint64 offset)
{
UNIMPLEMENTED();
......@@ -7689,7 +7691,7 @@ void Context::texStorageMem3D(TextureType target,
GLsizei width,
GLsizei height,
GLsizei depth,
GLuint memory,
MemoryObjectID memory,
GLuint64 offset)
{
UNIMPLEMENTED();
......@@ -7702,18 +7704,21 @@ void Context::texStorageMem3DMultisample(TextureType target,
GLsizei height,
GLsizei depth,
GLboolean fixedSampleLocations,
GLuint memory,
MemoryObjectID memory,
GLuint64 offset)
{
UNIMPLEMENTED();
}
void Context::bufferStorageMem(TextureType target, GLsizeiptr size, GLuint memory, GLuint64 offset)
void Context::bufferStorageMem(TextureType target,
GLsizeiptr size,
MemoryObjectID memory,
GLuint64 offset)
{
UNIMPLEMENTED();
}
void Context::importMemoryFd(GLuint memory, GLuint64 size, HandleType handleType, GLint fd)
void Context::importMemoryFd(MemoryObjectID memory, GLuint64 size, HandleType handleType, GLint fd)
{
MemoryObject *memoryObject = getMemoryObject(memory);
ASSERT(memoryObject != nullptr);
......
......@@ -355,14 +355,14 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
TextureID createTexture();
RenderbufferID createRenderbuffer();
ProgramPipelineID createProgramPipeline();
GLuint createMemoryObject();
MemoryObjectID createMemoryObject();
SemaphoreID createSemaphore();
void deleteBuffer(BufferID buffer);
void deleteTexture(TextureID texture);
void deleteRenderbuffer(RenderbufferID renderbuffer);
void deleteProgramPipeline(ProgramPipelineID pipeline);
void deleteMemoryObject(GLuint memoryObject);
void deleteMemoryObject(MemoryObjectID memoryObject);
void deleteSemaphore(SemaphoreID semaphore);
// CHROMIUM_path_rendering
......@@ -387,7 +387,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
Query *getQuery(QueryID handle) const;
TransformFeedback *getTransformFeedback(GLuint handle) const;
ProgramPipeline *getProgramPipeline(ProgramPipelineID handle) const;
MemoryObject *getMemoryObject(GLuint handle) const;
MemoryObject *getMemoryObject(MemoryObjectID handle) const;
Semaphore *getSemaphore(SemaphoreID handle) const;
Texture *getTextureByType(TextureType type) const;
......
......@@ -329,29 +329,34 @@
/* GL_EXT_instanced_arrays */ \
/* GL_EXT_map_buffer_range */ \
/* GL_EXT_memory_object */ \
void bufferStorageMem(TextureType targetPacked, GLsizeiptr size, GLuint memory, \
void bufferStorageMem(TextureType targetPacked, GLsizeiptr size, MemoryObjectID memoryPacked, \
GLuint64 offset); \
void createMemoryObjects(GLsizei n, GLuint *memoryObjects); \
void deleteMemoryObjects(GLsizei n, const GLuint *memoryObjects); \
void getMemoryObjectParameteriv(GLuint memoryObject, GLenum pname, GLint *params); \
void createMemoryObjects(GLsizei n, MemoryObjectID *memoryObjectsPacked); \
void deleteMemoryObjects(GLsizei n, const MemoryObjectID *memoryObjectsPacked); \
void getMemoryObjectParameteriv(MemoryObjectID memoryObjectPacked, GLenum pname, \
GLint *params); \
void getUnsignedBytev(GLenum pname, GLubyte *data); \
void getUnsignedBytei_v(GLenum target, GLuint index, GLubyte *data); \
GLboolean isMemoryObject(GLuint memoryObject); \
void memoryObjectParameteriv(GLuint memoryObject, GLenum pname, const GLint *params); \
GLboolean isMemoryObject(MemoryObjectID memoryObjectPacked); \
void memoryObjectParameteriv(MemoryObjectID memoryObjectPacked, GLenum pname, \
const GLint *params); \
void texStorageMem2D(TextureType targetPacked, GLsizei levels, GLenum internalFormat, \
GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); \
void texStorageMem2DMultisample( \
TextureType targetPacked, GLsizei samples, GLenum internalFormat, GLsizei width, \
GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); \
void texStorageMem3D(TextureType targetPacked, GLsizei levels, GLenum internalFormat, \
GLsizei width, GLsizei height, GLsizei depth, GLuint memory, \
GLsizei width, GLsizei height, MemoryObjectID memoryPacked, \
GLuint64 offset); \
void texStorageMem3DMultisample(TextureType targetPacked, GLsizei samples, \
void texStorageMem2DMultisample(TextureType targetPacked, GLsizei samples, \
GLenum internalFormat, GLsizei width, GLsizei height, \
GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, \
GLboolean fixedSampleLocations, MemoryObjectID memoryPacked, \
GLuint64 offset); \
void texStorageMem3D(TextureType targetPacked, GLsizei levels, GLenum internalFormat, \
GLsizei width, GLsizei height, GLsizei depth, \
MemoryObjectID memoryPacked, GLuint64 offset); \
void texStorageMem3DMultisample(TextureType targetPacked, GLsizei samples, \
GLenum internalFormat, GLsizei width, GLsizei height, \
GLsizei depth, GLboolean fixedSampleLocations, \
MemoryObjectID memoryPacked, GLuint64 offset); \
/* GL_EXT_memory_object_fd */ \
void importMemoryFd(GLuint memory, GLuint64 size, HandleType handleTypePacked, GLint fd); \
void importMemoryFd(MemoryObjectID memoryPacked, GLuint64 size, HandleType handleTypePacked, \
GLint fd); \
/* GL_EXT_occlusion_query_boolean */ \
/* GL_EXT_robustness */ \
GLenum getGraphicsResetStatus(); \
......
......@@ -882,6 +882,12 @@ void WriteParamValueToStream<ParamType::TSemaphoreID>(std::ostream &os, gl::Sema
}
template <>
void WriteParamValueToStream<ParamType::TMemoryObjectID>(std::ostream &os, gl::MemoryObjectID value)
{
os << value.value;
}
template <>
void WriteParamValueToStream<ParamType::TRenderbufferID>(std::ostream &os, gl::RenderbufferID value)
{
os << "gRenderbufferMap[" << value.value << "]";
......
......@@ -277,6 +277,10 @@ template <>
void WriteParamValueToStream<ParamType::TSemaphoreID>(std::ostream &os, gl::SemaphoreID value);
template <>
void WriteParamValueToStream<ParamType::TMemoryObjectID>(std::ostream &os,
gl::MemoryObjectID value);
template <>
void WriteParamValueToStream<ParamType::TRenderbufferID>(std::ostream &os,
gl::RenderbufferID value);
......
......@@ -14,8 +14,8 @@
namespace gl
{
MemoryObject::MemoryObject(rx::GLImplFactory *factory, GLuint id)
: RefCountObject(id), mImplementation(factory->createMemoryObject())
MemoryObject::MemoryObject(rx::GLImplFactory *factory, MemoryObjectID id)
: RefCountObject(id.value), mImplementation(factory->createMemoryObject())
{}
MemoryObject::~MemoryObject() {}
......
......@@ -27,7 +27,7 @@ class Context;
class MemoryObject final : public RefCountObject
{
public:
MemoryObject(rx::GLImplFactory *factory, GLuint id);
MemoryObject(rx::GLImplFactory *factory, MemoryObjectID id);
~MemoryObject() override;
void onDestroy(const Context *context) override;
......
......@@ -506,21 +506,21 @@ void MemoryObjectManager::reset(const Context *context)
{
while (!mMemoryObjects.empty())
{
deleteMemoryObject(context, mMemoryObjects.begin()->first);
deleteMemoryObject(context, {mMemoryObjects.begin()->first});
}
mMemoryObjects.clear();
}
GLuint MemoryObjectManager::createMemoryObject(rx::GLImplFactory *factory)
MemoryObjectID MemoryObjectManager::createMemoryObject(rx::GLImplFactory *factory)
{
GLuint handle = mHandleAllocator.allocate();
MemoryObjectID handle = MemoryObjectID{mHandleAllocator.allocate()};
MemoryObject *memoryObject = new MemoryObject(factory, handle);
memoryObject->addRef();
mMemoryObjects.assign(handle, memoryObject);
return handle;
}
void MemoryObjectManager::deleteMemoryObject(const Context *context, GLuint handle)
void MemoryObjectManager::deleteMemoryObject(const Context *context, MemoryObjectID handle)
{
MemoryObject *memoryObject = nullptr;
if (!mMemoryObjects.erase(handle, &memoryObject))
......@@ -529,7 +529,7 @@ void MemoryObjectManager::deleteMemoryObject(const Context *context, GLuint hand
}
// Requires an explicit this-> because of C++ template rules.
this->mHandleAllocator.release(handle);
this->mHandleAllocator.release(handle.value);
if (memoryObject)
{
......@@ -537,7 +537,7 @@ void MemoryObjectManager::deleteMemoryObject(const Context *context, GLuint hand
}
}
MemoryObject *MemoryObjectManager::getMemoryObject(GLuint handle) const
MemoryObject *MemoryObjectManager::getMemoryObject(MemoryObjectID handle) const
{
return mMemoryObjects.query(handle);
}
......
......@@ -328,9 +328,9 @@ class MemoryObjectManager : public ResourceManagerBase<HandleAllocator>
public:
MemoryObjectManager();
GLuint createMemoryObject(rx::GLImplFactory *factory);
void deleteMemoryObject(const Context *context, GLuint handle);
MemoryObject *getMemoryObject(GLuint handle) const;
MemoryObjectID createMemoryObject(rx::GLImplFactory *factory);
void deleteMemoryObject(const Context *context, MemoryObjectID handle);
MemoryObject *getMemoryObject(MemoryObjectID handle) const;
protected:
~MemoryObjectManager() override;
......@@ -338,7 +338,7 @@ class MemoryObjectManager : public ResourceManagerBase<HandleAllocator>
private:
void reset(const Context *context) override;
ResourceMap<MemoryObject> mMemoryObjects;
ResourceMap<MemoryObject, MemoryObjectID> mMemoryObjects;
};
class SemaphoreManager : public ResourceManagerBase<HandleAllocator>
......
......@@ -1081,19 +1081,19 @@ angle::CallCapture CaptureBufferStorageMemEXT(const Context *context,
bool isCallValid,
TextureType targetPacked,
GLsizeiptr size,
GLuint memory,
MemoryObjectID memoryPacked,
GLuint64 offset);
angle::CallCapture CaptureCreateMemoryObjectsEXT(const Context *context,
bool isCallValid,
GLsizei n,
GLuint *memoryObjects);
MemoryObjectID *memoryObjectsPacked);
angle::CallCapture CaptureDeleteMemoryObjectsEXT(const Context *context,
bool isCallValid,
GLsizei n,
const GLuint *memoryObjects);
const MemoryObjectID *memoryObjectsPacked);
angle::CallCapture CaptureGetMemoryObjectParameterivEXT(const Context *context,
bool isCallValid,
GLuint memoryObject,
MemoryObjectID memoryObjectPacked,
GLenum pname,
GLint *params);
angle::CallCapture CaptureGetUnsignedBytevEXT(const Context *context,
......@@ -1107,11 +1107,11 @@ angle::CallCapture CaptureGetUnsignedBytei_vEXT(const Context *context,
GLubyte *data);
angle::CallCapture CaptureIsMemoryObjectEXT(const Context *context,
bool isCallValid,
GLuint memoryObject,
MemoryObjectID memoryObjectPacked,
GLboolean returnValue);
angle::CallCapture CaptureMemoryObjectParameterivEXT(const Context *context,
bool isCallValid,
GLuint memoryObject,
MemoryObjectID memoryObjectPacked,
GLenum pname,
const GLint *params);
angle::CallCapture CaptureTexStorageMem2DEXT(const Context *context,
......@@ -1121,7 +1121,7 @@ angle::CallCapture CaptureTexStorageMem2DEXT(const Context *context,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLuint memory,
MemoryObjectID memoryPacked,
GLuint64 offset);
angle::CallCapture CaptureTexStorageMem2DMultisampleEXT(const Context *context,
bool isCallValid,
......@@ -1131,7 +1131,7 @@ angle::CallCapture CaptureTexStorageMem2DMultisampleEXT(const Context *context,
GLsizei width,
GLsizei height,
GLboolean fixedSampleLocations,
GLuint memory,
MemoryObjectID memoryPacked,
GLuint64 offset);
angle::CallCapture CaptureTexStorageMem3DEXT(const Context *context,
bool isCallValid,
......@@ -1141,7 +1141,7 @@ angle::CallCapture CaptureTexStorageMem3DEXT(const Context *context,
GLsizei width,
GLsizei height,
GLsizei depth,
GLuint memory,
MemoryObjectID memoryPacked,
GLuint64 offset);
angle::CallCapture CaptureTexStorageMem3DMultisampleEXT(const Context *context,
bool isCallValid,
......@@ -1152,13 +1152,13 @@ angle::CallCapture CaptureTexStorageMem3DMultisampleEXT(const Context *context,
GLsizei height,
GLsizei depth,
GLboolean fixedSampleLocations,
GLuint memory,
MemoryObjectID memoryPacked,
GLuint64 offset);
// GL_EXT_memory_object_fd
angle::CallCapture CaptureImportMemoryFdEXT(const Context *context,
bool isCallValid,
GLuint memory,
MemoryObjectID memoryPacked,
GLuint64 size,
HandleType handleTypePacked,
GLint fd);
......@@ -3287,19 +3287,19 @@ void CaptureDrawElementsInstancedEXT_indices(const Context *context,
const void *indices,
GLsizei primcount,
angle::ParamCapture *paramCapture);
void CaptureCreateMemoryObjectsEXT_memoryObjects(const Context *context,
bool isCallValid,
GLsizei n,
GLuint *memoryObjects,
angle::ParamCapture *paramCapture);
void CaptureDeleteMemoryObjectsEXT_memoryObjects(const Context *context,
bool isCallValid,
GLsizei n,
const GLuint *memoryObjects,
angle::ParamCapture *paramCapture);
void CaptureCreateMemoryObjectsEXT_memoryObjectsPacked(const Context *context,
bool isCallValid,
GLsizei n,
MemoryObjectID *memoryObjectsPacked,
angle::ParamCapture *paramCapture);
void CaptureDeleteMemoryObjectsEXT_memoryObjectsPacked(const Context *context,
bool isCallValid,
GLsizei n,
const MemoryObjectID *memoryObjectsPacked,
angle::ParamCapture *paramCapture);
void CaptureGetMemoryObjectParameterivEXT_params(const Context *context,
bool isCallValid,
GLuint memoryObject,
MemoryObjectID memoryObjectPacked,
GLenum pname,
GLint *params,
angle::ParamCapture *paramCapture);
......@@ -3316,7 +3316,7 @@ void CaptureGetUnsignedBytei_vEXT_data(const Context *context,
angle::ParamCapture *paramCapture);
void CaptureMemoryObjectParameterivEXT_params(const Context *context,
bool isCallValid,
GLuint memoryObject,
MemoryObjectID memoryObjectPacked,
GLenum pname,
const GLint *params,
angle::ParamCapture *paramCapture);
......
......@@ -2260,27 +2260,27 @@ void CaptureDrawElementsInstancedEXT_indices(const Context *context,
UNIMPLEMENTED();
}
void CaptureCreateMemoryObjectsEXT_memoryObjects(const Context *context,
bool isCallValid,
GLsizei n,
GLuint *memoryObjects,
ParamCapture *paramCapture)
void CaptureCreateMemoryObjectsEXT_memoryObjectsPacked(const Context *context,
bool isCallValid,
GLsizei n,
MemoryObjectID *memoryObjects,
ParamCapture *paramCapture)
{
UNIMPLEMENTED();
}
void CaptureDeleteMemoryObjectsEXT_memoryObjects(const Context *context,
bool isCallValid,
GLsizei n,
const GLuint *memoryObjects,
ParamCapture *paramCapture)
void CaptureDeleteMemoryObjectsEXT_memoryObjectsPacked(const Context *context,
bool isCallValid,
GLsizei n,
const MemoryObjectID *memoryObjects,
ParamCapture *paramCapture)
{
UNIMPLEMENTED();
}
void CaptureGetMemoryObjectParameterivEXT_params(const Context *context,
bool isCallValid,
GLuint memoryObject,
MemoryObjectID memoryObject,
GLenum pname,
GLint *params,
ParamCapture *paramCapture)
......@@ -2309,7 +2309,7 @@ void CaptureGetUnsignedBytei_vEXT_data(const Context *context,
void CaptureMemoryObjectParameterivEXT_params(const Context *context,
bool isCallValid,
GLuint memoryObject,
MemoryObjectID memoryObject,
GLenum pname,
const GLint *params,
ParamCapture *paramCapture)
......
......@@ -270,6 +270,17 @@ void WriteParamTypeToStream(std::ostream &os, ParamType paramType, const ParamVa
case ParamType::TMatrixType:
WriteParamValueToStream<ParamType::TMatrixType>(os, paramValue.MatrixTypeVal);
break;
case ParamType::TMemoryObjectID:
WriteParamValueToStream<ParamType::TMemoryObjectID>(os, paramValue.MemoryObjectIDVal);
break;
case ParamType::TMemoryObjectIDConstPointer:
WriteParamValueToStream<ParamType::TMemoryObjectIDConstPointer>(
os, paramValue.MemoryObjectIDConstPointerVal);
break;
case ParamType::TMemoryObjectIDPointer:
WriteParamValueToStream<ParamType::TMemoryObjectIDPointer>(
os, paramValue.MemoryObjectIDPointerVal);
break;
case ParamType::TPathID:
WriteParamValueToStream<ParamType::TPathID>(os, paramValue.PathIDVal);
break;
......@@ -560,6 +571,12 @@ const char *ParamTypeToString(ParamType paramType)
return "GLenum";
case ParamType::TMatrixType:
return "GLenum";
case ParamType::TMemoryObjectID:
return "GLuint";
case ParamType::TMemoryObjectIDConstPointer:
return "const GLuint *";
case ParamType::TMemoryObjectIDPointer:
return "GLuint *";
case ParamType::TPathID:
return "GLuint";
case ParamType::TPointParameter:
......
......@@ -91,6 +91,9 @@ enum class ParamType
TLogicalOperation,
TMaterialParameter,
TMatrixType,
TMemoryObjectID,
TMemoryObjectIDConstPointer,
TMemoryObjectIDPointer,
TPathID,
TPointParameter,
TPrimitiveMode,
......@@ -206,6 +209,9 @@ union ParamValue
gl::LogicalOperation LogicalOperationVal;
gl::MaterialParameter MaterialParameterVal;
gl::MatrixType MatrixTypeVal;
gl::MemoryObjectID MemoryObjectIDVal;
const gl::MemoryObjectID *MemoryObjectIDConstPointerVal;
gl::MemoryObjectID *MemoryObjectIDPointerVal;
gl::PathID PathIDVal;
gl::PointParameter PointParameterVal;
gl::PrimitiveMode PrimitiveModeVal;
......@@ -730,6 +736,27 @@ inline gl::MatrixType GetParamVal<ParamType::TMatrixType, gl::MatrixType>(const
}
template <>
inline gl::MemoryObjectID GetParamVal<ParamType::TMemoryObjectID, gl::MemoryObjectID>(
const ParamValue &value)
{
return value.MemoryObjectIDVal;
}
template <>
inline const gl::MemoryObjectID *GetParamVal<ParamType::TMemoryObjectIDConstPointer,
const gl::MemoryObjectID *>(const ParamValue &value)
{
return value.MemoryObjectIDConstPointerVal;
}
template <>
inline gl::MemoryObjectID *GetParamVal<ParamType::TMemoryObjectIDPointer, gl::MemoryObjectID *>(
const ParamValue &value)
{
return value.MemoryObjectIDPointerVal;
}
template <>
inline gl::PathID GetParamVal<ParamType::TPathID, gl::PathID>(const ParamValue &value)
{
return value.PathIDVal;
......@@ -1140,6 +1167,12 @@ T AccessParamValue(ParamType paramType, const ParamValue &value)
return GetParamVal<ParamType::TMaterialParameter, T>(value);
case ParamType::TMatrixType:
return GetParamVal<ParamType::TMatrixType, T>(value);
case ParamType::TMemoryObjectID:
return GetParamVal<ParamType::TMemoryObjectID, T>(value);
case ParamType::TMemoryObjectIDConstPointer:
return GetParamVal<ParamType::TMemoryObjectIDConstPointer, T>(value);
case ParamType::TMemoryObjectIDPointer:
return GetParamVal<ParamType::TMemoryObjectIDPointer, T>(value);
case ParamType::TPathID:
return GetParamVal<ParamType::TPathID, T>(value);
case ParamType::TPointParameter:
......@@ -1688,6 +1721,27 @@ inline void SetParamVal<ParamType::TMatrixType>(gl::MatrixType valueIn, ParamVal
}
template <>
inline void SetParamVal<ParamType::TMemoryObjectID>(gl::MemoryObjectID valueIn,
ParamValue *valueOut)
{
valueOut->MemoryObjectIDVal = valueIn;
}
template <>
inline void SetParamVal<ParamType::TMemoryObjectIDConstPointer>(const gl::MemoryObjectID *valueIn,
ParamValue *valueOut)
{
valueOut->MemoryObjectIDConstPointerVal = valueIn;
}
template <>
inline void SetParamVal<ParamType::TMemoryObjectIDPointer>(gl::MemoryObjectID *valueIn,
ParamValue *valueOut)
{
valueOut->MemoryObjectIDPointerVal = valueIn;
}
template <>
inline void SetParamVal<ParamType::TPathID>(gl::PathID valueIn, ParamValue *valueOut)
{
valueOut->PathIDVal = valueIn;
......@@ -2164,6 +2218,15 @@ void InitParamValue(ParamType paramType, T valueIn, ParamValue *valueOut)
case ParamType::TMatrixType:
SetParamVal<ParamType::TMatrixType>(valueIn, valueOut);
break;
case ParamType::TMemoryObjectID:
SetParamVal<ParamType::TMemoryObjectID>(valueIn, valueOut);
break;
case ParamType::TMemoryObjectIDConstPointer:
SetParamVal<ParamType::TMemoryObjectIDConstPointer>(valueIn, valueOut);
break;
case ParamType::TMemoryObjectIDPointer:
SetParamVal<ParamType::TMemoryObjectIDPointer>(valueIn, valueOut);
break;
case ParamType::TPathID:
SetParamVal<ParamType::TPathID>(valueIn, valueOut);
break;
......
......@@ -3230,7 +3230,7 @@ bool ValidateMapBufferRangeEXT(Context *context,
bool ValidateBufferStorageMemEXT(Context *context,
TextureType target,
GLsizeiptr size,
GLuint memory,
MemoryObjectID memory,
GLuint64 offset)
{
if (!context->getExtensions().memoryObject)
......@@ -3243,7 +3243,7 @@ bool ValidateBufferStorageMemEXT(Context *context,
return false;
}
bool ValidateCreateMemoryObjectsEXT(Context *context, GLsizei n, GLuint *memoryObjects)
bool ValidateCreateMemoryObjectsEXT(Context *context, GLsizei n, MemoryObjectID *memoryObjects)
{
if (!context->getExtensions().memoryObject)
{
......@@ -3254,7 +3254,9 @@ bool ValidateCreateMemoryObjectsEXT(Context *context, GLsizei n, GLuint *memoryO
return ValidateGenOrDelete(context, n);
}
bool ValidateDeleteMemoryObjectsEXT(Context *context, GLsizei n, const GLuint *memoryObjects)
bool ValidateDeleteMemoryObjectsEXT(Context *context,
GLsizei n,
const MemoryObjectID *memoryObjects)
{
if (!context->getExtensions().memoryObject)
{
......@@ -3266,7 +3268,7 @@ bool ValidateDeleteMemoryObjectsEXT(Context *context, GLsizei n, const GLuint *m
}
bool ValidateGetMemoryObjectParameterivEXT(Context *context,
GLuint memoryObject,
MemoryObjectID memoryObject,
GLenum pname,
GLint *params)
{
......@@ -3304,7 +3306,7 @@ bool ValidateGetUnsignedBytei_vEXT(Context *context, GLenum target, GLuint index
return false;
}
bool ValidateIsMemoryObjectEXT(Context *context, GLuint memoryObject)
bool ValidateIsMemoryObjectEXT(Context *context, MemoryObjectID memoryObject)
{
if (!context->getExtensions().memoryObject)
{
......@@ -3316,7 +3318,7 @@ bool ValidateIsMemoryObjectEXT(Context *context, GLuint memoryObject)
}
bool ValidateMemoryObjectParameterivEXT(Context *context,
GLuint memoryObject,
MemoryObjectID memoryObject,
GLenum pname,
const GLint *params)
{
......@@ -3336,7 +3338,7 @@ bool ValidateTexStorageMem2DEXT(Context *context,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLuint memory,
MemoryObjectID memory,
GLuint64 offset)
{
if (!context->getExtensions().memoryObject)
......@@ -3363,7 +3365,7 @@ bool ValidateTexStorageMem3DEXT(Context *context,
GLsizei width,
GLsizei height,
GLsizei depth,
GLuint memory,
MemoryObjectID memory,
GLuint64 offset)
{
if (!context->getExtensions().memoryObject)
......@@ -3377,7 +3379,7 @@ bool ValidateTexStorageMem3DEXT(Context *context,
}
bool ValidateImportMemoryFdEXT(Context *context,
GLuint memory,
MemoryObjectID memory,
GLuint64 size,
HandleType handleType,
GLint fd)
......
......@@ -949,7 +949,7 @@ bool ValidateTexStorageMem2DMultisampleEXT(Context *context,
GLsizei width,
GLsizei height,
GLboolean fixedSampleLocations,
GLuint memory,
MemoryObjectID memory,
GLuint64 offset)
{
if (!context->getExtensions().memoryObject)
......@@ -1898,7 +1898,7 @@ bool ValidateTexStorageMem3DMultisampleEXT(Context *context,
GLsizei height,
GLsizei depth,
GLboolean fixedSampleLocations,
GLuint memory,
MemoryObjectID memory,
GLuint64 offset)
{
if (!context->getExtensions().memoryObject)
......
......@@ -868,19 +868,23 @@ bool ValidateMapBufferRangeEXT(Context *context,
bool ValidateBufferStorageMemEXT(Context *context,
TextureType targetPacked,
GLsizeiptr size,
GLuint memory,
MemoryObjectID memoryPacked,
GLuint64 offset);
bool ValidateCreateMemoryObjectsEXT(Context *context, GLsizei n, GLuint *memoryObjects);
bool ValidateDeleteMemoryObjectsEXT(Context *context, GLsizei n, const GLuint *memoryObjects);
bool ValidateCreateMemoryObjectsEXT(Context *context,
GLsizei n,
MemoryObjectID *memoryObjectsPacked);
bool ValidateDeleteMemoryObjectsEXT(Context *context,
GLsizei n,
const MemoryObjectID *memoryObjectsPacked);
bool ValidateGetMemoryObjectParameterivEXT(Context *context,
GLuint memoryObject,
MemoryObjectID memoryObjectPacked,
GLenum pname,
GLint *params);
bool ValidateGetUnsignedBytevEXT(Context *context, GLenum pname, GLubyte *data);
bool ValidateGetUnsignedBytei_vEXT(Context *context, GLenum target, GLuint index, GLubyte *data);
bool ValidateIsMemoryObjectEXT(Context *context, GLuint memoryObject);
bool ValidateIsMemoryObjectEXT(Context *context, MemoryObjectID memoryObjectPacked);
bool ValidateMemoryObjectParameterivEXT(Context *context,
GLuint memoryObject,
MemoryObjectID memoryObjectPacked,
GLenum pname,
const GLint *params);
bool ValidateTexStorageMem2DEXT(Context *context,
......@@ -889,7 +893,7 @@ bool ValidateTexStorageMem2DEXT(Context *context,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLuint memory,
MemoryObjectID memoryPacked,
GLuint64 offset);
bool ValidateTexStorageMem2DMultisampleEXT(Context *context,
TextureType targetPacked,
......@@ -898,7 +902,7 @@ bool ValidateTexStorageMem2DMultisampleEXT(Context *context,
GLsizei width,
GLsizei height,
GLboolean fixedSampleLocations,
GLuint memory,
MemoryObjectID memoryPacked,
GLuint64 offset);
bool ValidateTexStorageMem3DEXT(Context *context,
TextureType targetPacked,
......@@ -907,7 +911,7 @@ bool ValidateTexStorageMem3DEXT(Context *context,
GLsizei width,
GLsizei height,
GLsizei depth,
GLuint memory,
MemoryObjectID memoryPacked,
GLuint64 offset);
bool ValidateTexStorageMem3DMultisampleEXT(Context *context,
TextureType targetPacked,
......@@ -917,12 +921,12 @@ bool ValidateTexStorageMem3DMultisampleEXT(Context *context,
GLsizei height,
GLsizei depth,
GLboolean fixedSampleLocations,
GLuint memory,
MemoryObjectID memoryPacked,
GLuint64 offset);
// GL_EXT_memory_object_fd
bool ValidateImportMemoryFdEXT(Context *context,
GLuint memory,
MemoryObjectID memoryPacked,
GLuint64 size,
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