Commit 215b2191 by Michael Spang Committed by Commit Bot

Add packed enum for GL_EXT_semaphore image layouts

Add a new packed enum gl::ImageLayout which consists of the following enum values: GL_LAYOUT_GENERAL_EXT GL_LAYOUT_COLOR_ATTACHMENT_EXT GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT GL_LAYOUT_SHADER_READ_ONLY_EXT GL_LAYOUT_TRANSFER_SRC_EXT GL_LAYOUT_TRANSFER_DST_EXT GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT Bug: angleproject:3289 Change-Id: Idc1615717d54fb1193e2f27c84a24993f6007d7b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1623810Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Michael Spang <spang@chromium.org>
parent e4452440
...@@ -368,15 +368,15 @@ ...@@ -368,15 +368,15 @@
"packed enum:src/common/PackedEGLEnums_autogen.h": "packed enum:src/common/PackedEGLEnums_autogen.h":
"4073274726e0c926765c5ab8b21dc3de", "4073274726e0c926765c5ab8b21dc3de",
"packed enum:src/common/PackedGLEnums_autogen.cpp": "packed enum:src/common/PackedGLEnums_autogen.cpp":
"41faf7a2b9b7a5008269f3e57bbe361d", "0e3a0ded47594dd6d8a324dbc9d033f3",
"packed enum:src/common/PackedGLEnums_autogen.h": "packed enum:src/common/PackedGLEnums_autogen.h":
"0766f2bb7874b2b6b4aaed4a6d0ef49e", "89396fc19b94f0fd48739b841ae172a8",
"packed enum:src/common/gen_packed_gl_enums.py": "packed enum:src/common/gen_packed_gl_enums.py":
"cc463afc5e37b0f73e119fec59a39420", "cc463afc5e37b0f73e119fec59a39420",
"packed enum:src/common/packed_egl_enums.json": "packed enum:src/common/packed_egl_enums.json":
"5f591d220ee53b6e54a27d1523a3ab79", "5f591d220ee53b6e54a27d1523a3ab79",
"packed enum:src/common/packed_gl_enums.json": "packed enum:src/common/packed_gl_enums.json":
"cd2c00958dd8cc546b816dedaf4769d3", "3f730faeebe986cd3017432ad56cf203",
"proc table:src/libGLESv2/gen_proc_table.py": "proc table:src/libGLESv2/gen_proc_table.py":
"3be3e8ed7fad58e8cc6fcf348da7b17d", "3be3e8ed7fad58e8cc6fcf348da7b17d",
"proc table:src/libGLESv2/proc_table_autogen.cpp": "proc table:src/libGLESv2/proc_table_autogen.cpp":
......
...@@ -428,6 +428,62 @@ GLenum ToGLenum(HintSetting from) ...@@ -428,6 +428,62 @@ GLenum ToGLenum(HintSetting from)
} }
template <> template <>
ImageLayout FromGLenum<ImageLayout>(GLenum from)
{
switch (from)
{
case GL_LAYOUT_GENERAL_EXT:
return ImageLayout::General;
case GL_LAYOUT_COLOR_ATTACHMENT_EXT:
return ImageLayout::ColorAttachment;
case GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT:
return ImageLayout::DepthStencilAttachment;
case GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT:
return ImageLayout::DepthStencilReadOnlyAttachment;
case GL_LAYOUT_SHADER_READ_ONLY_EXT:
return ImageLayout::ShaderReadOnly;
case GL_LAYOUT_TRANSFER_SRC_EXT:
return ImageLayout::TransferSrc;
case GL_LAYOUT_TRANSFER_DST_EXT:
return ImageLayout::TransferDst;
case GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT:
return ImageLayout::DepthReadOnlyStencilAttachment;
case GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT:
return ImageLayout::DepthAttachmentStencilReadOnly;
default:
return ImageLayout::InvalidEnum;
}
}
GLenum ToGLenum(ImageLayout from)
{
switch (from)
{
case ImageLayout::General:
return GL_LAYOUT_GENERAL_EXT;
case ImageLayout::ColorAttachment:
return GL_LAYOUT_COLOR_ATTACHMENT_EXT;
case ImageLayout::DepthStencilAttachment:
return GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT;
case ImageLayout::DepthStencilReadOnlyAttachment:
return GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT;
case ImageLayout::ShaderReadOnly:
return GL_LAYOUT_SHADER_READ_ONLY_EXT;
case ImageLayout::TransferSrc:
return GL_LAYOUT_TRANSFER_SRC_EXT;
case ImageLayout::TransferDst:
return GL_LAYOUT_TRANSFER_DST_EXT;
case ImageLayout::DepthReadOnlyStencilAttachment:
return GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT;
case ImageLayout::DepthAttachmentStencilReadOnly:
return GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT;
default:
UNREACHABLE();
return 0;
}
}
template <>
LightParameter FromGLenum<LightParameter>(GLenum from) LightParameter FromGLenum<LightParameter>(GLenum from)
{ {
switch (from) switch (from)
......
...@@ -187,6 +187,26 @@ template <> ...@@ -187,6 +187,26 @@ template <>
HintSetting FromGLenum<HintSetting>(GLenum from); HintSetting FromGLenum<HintSetting>(GLenum from);
GLenum ToGLenum(HintSetting from); GLenum ToGLenum(HintSetting from);
enum class ImageLayout : uint8_t
{
General = 0,
ColorAttachment = 1,
DepthStencilAttachment = 2,
DepthStencilReadOnlyAttachment = 3,
ShaderReadOnly = 4,
TransferSrc = 5,
TransferDst = 6,
DepthReadOnlyStencilAttachment = 7,
DepthAttachmentStencilReadOnly = 8,
InvalidEnum = 9,
EnumCount = 9,
};
template <>
ImageLayout FromGLenum<ImageLayout>(GLenum from);
GLenum ToGLenum(ImageLayout from);
enum class LightParameter : uint8_t enum class LightParameter : uint8_t
{ {
Ambient = 0, Ambient = 0,
......
...@@ -266,5 +266,17 @@ ...@@ -266,5 +266,17 @@
"HandleType": "HandleType":
{ {
"OpaqueFd": "GL_HANDLE_TYPE_OPAQUE_FD_EXT" "OpaqueFd": "GL_HANDLE_TYPE_OPAQUE_FD_EXT"
},
"ImageLayout":
{
"General": "GL_LAYOUT_GENERAL_EXT",
"ColorAttachment": "GL_LAYOUT_COLOR_ATTACHMENT_EXT",
"DepthStencilAttachment": "GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT",
"DepthStencilReadOnlyAttachment": "GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT",
"ShaderReadOnly": "GL_LAYOUT_SHADER_READ_ONLY_EXT",
"TransferSrc": "GL_LAYOUT_TRANSFER_SRC_EXT",
"TransferDst": "GL_LAYOUT_TRANSFER_DST_EXT",
"DepthReadOnlyStencilAttachment": "GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT",
"DepthAttachmentStencilReadOnly": "GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT"
} }
} }
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