Pack handle type enum for glImportMemoryFd & glImportSemaphoreFd

Bug: angleproject:3289

Change-Id: Ic20b1d55641494b46622e1e28d93e2ca30655ea6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1566143
Commit-Queue: Michael Spang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
This commit is contained in:
Michael Spang authored and Commit Bot committed 2019-04-16 19:57:12 +00:00
1 parent 50eb1e6f77
commit e0da9cefcd
10 files changed
+78 -22

No files matched your search

+6
View File
@@ -265,6 +265,12 @@
"glGetTexParameterxv": {
"target": "TextureType"
},
"glImportMemoryFdEXT": {
"handleType": "HandleType"
},
"glImportSemaphoreFdEXT": {
"handleType": "HandleType"
},
"glLightf" : {
"pname" : "LightParameter"
},
+6 -6
View File
@@ -92,7 +92,7 @@
"GL/EGL entry points:scripts/egl_angle_ext.xml":
"745534010f31fbe8e1a1fcddce15ed2d",
"GL/EGL entry points:scripts/entry_point_packed_gl_enums.json":
"263af9517ddb1c9f3ba83894fe837095",
"384494b3910e97cc05db34fa3cff54b8",
"GL/EGL entry points:scripts/generate_entry_points.py":
"70f826962543838df966ed8c7155d0dd",
"GL/EGL entry points:scripts/gl.xml":
@@ -112,7 +112,7 @@
"GL/EGL entry points:src/libANGLE/validationES3_autogen.h":
"4617942e5bf67fa5e35675daf66afc5c",
"GL/EGL entry points:src/libANGLE/validationESEXT_autogen.h":
"8e501839a051c0f1b646343b665369df",
"9401b0db013a8b95431ce2a4eb8a0405",
"GL/EGL entry points:src/libGLESv2/entry_points_enum_autogen.h":
"1c50aa0844ece3d673d563a8b23a7166",
"GL/EGL entry points:src/libGLESv2/entry_points_gles_1_0_autogen.cpp":
@@ -132,7 +132,7 @@
"GL/EGL entry points:src/libGLESv2/entry_points_gles_3_1_autogen.h":
"043d09a964c740067bf4279e0b544aed",
"GL/EGL entry points:src/libGLESv2/entry_points_gles_ext_autogen.cpp":
"9131b9e072a25e09f10cedaccfdd68f8",
"d4ef39b11966fa6a7aff057b8d67b679",
"GL/EGL entry points:src/libGLESv2/entry_points_gles_ext_autogen.h":
"2c746d064fe2d8ed4769dc9acbb9ad67",
"GL/EGL entry points:src/libGLESv2/libGLESv2_autogen.cpp":
@@ -368,15 +368,15 @@
"packed enum:src/common/PackedEGLEnums_autogen.h":
"4073274726e0c926765c5ab8b21dc3de",
"packed enum:src/common/PackedGLEnums_autogen.cpp":
"b64a7cadc5c8c054f788d1e0b58a11a1",
"e9ac6361c857133a2f1cea1c3eaabd7e",
"packed enum:src/common/PackedGLEnums_autogen.h":
"80724ac8fc2cbdebee81fb43b4345c1a",
"0b43ae9a66b731dfbf30e7edf913973e",
"packed enum:src/common/gen_packed_gl_enums.py":
"0cd1a1cb6d5fde8cbac2994db24eb901",
"packed enum:src/common/packed_egl_enums.json":
"5f591d220ee53b6e54a27d1523a3ab79",
"packed enum:src/common/packed_gl_enums.json":
"6e2e2845f96754509b8add1f77e203b3",
"b148c43156d73b60cbd936118beeeb41",
"proc table:src/libGLESv2/gen_proc_table.py":
"20ebe54894d613de42b0b15ca34078d9",
"proc table:src/libGLESv2/proc_table_autogen.cpp":
+24
View File
@@ -335,6 +335,30 @@ GLenum ToGLenum(FogMode from)
}
}
template <>
HandleType FromGLenum<HandleType>(GLenum from)
{
switch (from)
{
case GL_HANDLE_TYPE_OPAQUE_FD_EXT:
return HandleType::OpaqueFd;
default:
return HandleType::InvalidEnum;
}
}
GLenum ToGLenum(HandleType from)
{
switch (from)
{
case HandleType::OpaqueFd:
return GL_HANDLE_TYPE_OPAQUE_FD_EXT;
default:
UNREACHABLE();
return 0;
}
}
template <>
HintSetting FromGLenum<HintSetting>(GLenum from)
{
+12
View File
@@ -146,6 +146,18 @@ template <>
FogMode FromGLenum<FogMode>(GLenum from);
GLenum ToGLenum(FogMode from);
enum class HandleType : uint8_t
{
OpaqueFd = 0,
InvalidEnum = 1,
EnumCount = 1,
};
template <>
HandleType FromGLenum<HandleType>(GLenum from);
GLenum ToGLenum(HandleType from);
enum class HintSetting : uint8_t
{
DontCare = 0,
+4
View File
@@ -255,5 +255,9 @@
{
"FirstVertexConvention": "GL_FIRST_VERTEX_CONVENTION",
"LastVertexConvention": "GL_LAST_VERTEX_CONVENTION"
},
"HandleType":
{
"OpaqueFd": "GL_HANDLE_TYPE_OPAQUE_FD_EXT"
}
}
+2 -2
View File
@@ -7184,7 +7184,7 @@ void Context::bufferStorageMem(TextureType target, GLsizeiptr size, GLuint memor
UNIMPLEMENTED();
}
void Context::importMemoryFd(GLuint memory, GLuint64 size, GLenum handleType, GLint fd)
void Context::importMemoryFd(GLuint memory, GLuint64 size, HandleType handleType, GLint fd)
{
UNIMPLEMENTED();
}
@@ -7235,7 +7235,7 @@ void Context::signalSemaphore(GLuint semaphore,
UNIMPLEMENTED();
}
void Context::importSemaphoreFd(GLuint semaphore, GLenum handleType, GLint fd)
void Context::importSemaphoreFd(GLuint semaphore, HandleType handleType, GLint fd)
{
UNIMPLEMENTED();
}
+2 -2
View File
@@ -393,7 +393,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
void bufferStorageMem(TextureType target, GLsizeiptr size, GLuint memory, GLuint64 offset);
// GL_EXT_memory_object_fd
void importMemoryFd(GLuint memory, GLuint64 size, GLenum handleType, GLint fd);
void importMemoryFd(GLuint memory, GLuint64 size, HandleType handleType, GLint fd);
// GL_EXT_semaphore
void genSemaphores(GLsizei n, GLuint *semaphores);
@@ -415,7 +415,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
const GLenum *dstLayouts);
// GL_EXT_semaphore_fd
void importSemaphoreFd(GLuint semaphore, GLenum handleType, GLint fd);
void importSemaphoreFd(GLuint semaphore, HandleType handleType, GLint fd);
// GLES1 emulation: Interface to entry points
ANGLE_GLES1_CONTEXT_API
+5 -2
View File
@@ -3184,7 +3184,7 @@ bool ValidateTexStorageMem3DEXT(Context *context,
bool ValidateImportMemoryFdEXT(Context *context,
GLuint memory,
GLuint64 size,
GLenum handleType,
HandleType handleType,
GLint fd)
{
if (!context->getExtensions().memoryObjectFd)
@@ -3299,7 +3299,10 @@ bool ValidateWaitSemaphoreEXT(Context *context,
return false;
}
bool ValidateImportSemaphoreFdEXT(Context *context, GLuint semaphore, GLenum handleType, GLint fd)
bool ValidateImportSemaphoreFdEXT(Context *context,
GLuint semaphore,
HandleType handleType,
GLint fd)
{
if (!context->getExtensions().semaphoreFd)
{
+5 -2
View File
@@ -853,7 +853,7 @@ bool ValidateTexStorageMem3DMultisampleEXT(Context *context,
bool ValidateImportMemoryFdEXT(Context *context,
GLuint memory,
GLuint64 size,
GLenum handleType,
HandleType handleTypePacked,
GLint fd);
// GL_EXT_occlusion_query_boolean
@@ -908,7 +908,10 @@ bool ValidateWaitSemaphoreEXT(Context *context,
const GLenum *srcLayouts);
// GL_EXT_semaphore_fd
bool ValidateImportSemaphoreFdEXT(Context *context, GLuint semaphore, GLenum handleType, GLint fd);
bool ValidateImportSemaphoreFdEXT(Context *context,
GLuint semaphore,
HandleType handleTypePacked,
GLint fd);
// GL_EXT_texture_storage
bool ValidateTexStorage1DEXT(Context *context,
@@ -3460,10 +3460,11 @@ void GL_APIENTRY ImportMemoryFdEXT(GLuint memory, GLuint64 size, GLenum handleTy
Context *context = GetValidGlobalContext();
if (context)
{
HandleType handleTypePacked = FromGLenum<HandleType>(handleType);
if (context->skipValidation() ||
ValidateImportMemoryFdEXT(context, memory, size, handleType, fd))
ValidateImportMemoryFdEXT(context, memory, size, handleTypePacked, fd))
{
context->importMemoryFd(memory, size, handleType, fd);
context->importMemoryFd(memory, size, handleTypePacked, fd);
}
}
}
@@ -3719,10 +3720,11 @@ void GL_APIENTRY ImportSemaphoreFdEXT(GLuint semaphore, GLenum handleType, GLint
Context *context = GetValidGlobalContext();
if (context)
{
HandleType handleTypePacked = FromGLenum<HandleType>(handleType);
if (context->skipValidation() ||
ValidateImportSemaphoreFdEXT(context, semaphore, handleType, fd))
ValidateImportSemaphoreFdEXT(context, semaphore, handleTypePacked, fd))
{
context->importSemaphoreFd(semaphore, handleType, fd);
context->importSemaphoreFd(semaphore, handleTypePacked, fd);
}
}
}
@@ -10876,10 +10878,11 @@ void GL_APIENTRY ImportMemoryFdEXTContextANGLE(GLeglContext ctx,
if (context)
{
ASSERT(context == GetValidGlobalContext());
HandleType handleTypePacked = FromGLenum<HandleType>(handleType);
if (context->skipValidation() ||
ValidateImportMemoryFdEXT(context, memory, size, handleType, fd))
ValidateImportMemoryFdEXT(context, memory, size, handleTypePacked, fd))
{
context->importMemoryFd(memory, size, handleType, fd);
context->importMemoryFd(memory, size, handleTypePacked, fd);
}
}
}
@@ -10897,10 +10900,11 @@ void GL_APIENTRY ImportSemaphoreFdEXTContextANGLE(GLeglContext ctx,
if (context)
{
ASSERT(context == GetValidGlobalContext());
HandleType handleTypePacked = FromGLenum<HandleType>(handleType);
if (context->skipValidation() ||
ValidateImportSemaphoreFdEXT(context, semaphore, handleType, fd))
ValidateImportSemaphoreFdEXT(context, semaphore, handleTypePacked, fd))
{
context->importSemaphoreFd(semaphore, handleType, fd);
context->importSemaphoreFd(semaphore, handleTypePacked, fd);
}
}
}